Skip to content

fix(agents): tell the agent to import Piccolo alongside Piccolissimo - #225

Merged
Rchari1 merged 1 commit into
mainfrom
rchari/piccolissimo-imports
Jul 29, 2026
Merged

fix(agents): tell the agent to import Piccolo alongside Piccolissimo#225
Rchari1 merged 1 commit into
mainfrom
rchari/piccolissimo-imports

Conversation

@Rchari1

@Rchari1 Rchari1 commented Jul 29, 2026

Copy link
Copy Markdown
Member

The failure

Cloud solves died at load time with an UndefVarError, before any solve started — the agent had written using Piccolissimo alone.

Piccolissimo does not re-export Piccolo's symbols, and every problem-setup name comes from Piccolo: GATES, TransmonSystem, EmbeddedOperator, UnitaryTrajectory.

Why the agent got it wrong

The HP solver-mode section said to author "with the Piccolissimo stack (SplinePulseProblem, free-phase paths, using Piccolissimo) rather than plain Piccolo" — which reads as a replacement for using Piccolo, not an addition.

It now says to import both, names the symbols that break, and says why it matters: the error surfaces before the solve begins, so on a cloud run you pay the full queue and instance-boot wait (~10 min) before seeing it.

Scope

Guidance only. The bundled template already imports both, so this affects only scripts the agent authors itself — which is exactly where the failures came from.

solverModeSection is exported so the guidance is testable; its sibling routingSection already was.

Testing

New test drives the real solverModeSection() with mode: "hp" and asserts the both-imports instruction, the "does NOT re-export" rationale, and the named symbols — with a guard that the section isn't empty, so a misfiring mode gate can't make the assertions vacuous.

extension: 780 passed, tsc --noEmit clean.

Separate from #219 by request — this is a one-line-of-guidance fix and shouldn't wait on that branch.

Cloud solves were failing at load time with an UndefVarError: the agent wrote
`using Piccolissimo` alone. Piccolissimo does not re-export Piccolo's symbols,
and every problem-setup name the template uses comes from Piccolo — GATES,
TransmonSystem, EmbeddedOperator, UnitaryTrajectory.

The HP solver-mode section told the agent to author "with the Piccolissimo stack
(`using Piccolissimo`)", which reads as a replacement for `using Piccolo` rather
than an addition. It now says to import BOTH, names the symbols that break, and
says why it matters: the error lands before any solve starts, so on a cloud run
you pay the full queue and instance-boot wait before seeing it.

The bundled template already imports both, so this only affects scripts the agent
authors itself.

solverModeSection is exported to make it testable — its sibling routingSection
already was.

extension: 780 passed, tsc clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Rchari1
Rchari1 merged commit 839140f into main Jul 29, 2026
5 checks passed
@Rchari1
Rchari1 deleted the rchari/piccolissimo-imports branch July 29, 2026 02:20
Rchari1 added a commit that referenced this pull request Jul 29, 2026
The template gained a SOLVER flag but nothing told the agent it exists, so an
agent asked for Altissimo would hand-roll a solve call — and silently lose both
telemetry channels plus the iteration budget:

  - frames come off IpoptOptions.intermediate_callback, which AltissimoOptions
    has no equivalent of, so a hand-written call leaves the Run Inspector fully
    dark rather than merely numberless;
  - a `max_iter` passed to solve!(::AltissimoOptions) lands in kwargs... and is
    dropped, so the solve quietly runs Altissimo's default 20 outer iterations;
  - inf_pr/inf_du need deriving from eq_viol/ineq_viol/kkt_error on Altissimo
    builds that predate #414.

The template already handles all three. The guidance now says the switch is ONE
line — `SOLVER = :altissimo` in the FILL-IN block — and states each trap, so the
instruction carries its own justification rather than reading as arbitrary.

solverModeSection is exported to make it testable, matching its already-exported
sibling routingSection. (The same one-line export is on #225; identical change,
so either merge order is fine.)

extension: 778 passed, tsc clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Rchari1 added a commit that referenced this pull request Aug 5, 2026
…nvented API

Third cloud solve, third hand-authored script, zero uses of the vetted
template. The latest (task 975a7c07, exit 1) invented API wholesale:

  CubicSplinePulse(; T=, n_knots=, n_drives=, bounds=)  every real method takes
                                                        POSITIONAL args, so an
                                                        all-keyword call matches
                                                        no method
  CallbackLogger(qcp)                                   not defined in Piccolo
                                                        or Piccolissimo
  get_fidelity(qcp)                                     not defined either

It died with a MethodError at LOAD time, before any optimization — after the
user had already paid the full queue and instance-boot wait. Verified by
running the script locally and by checking each symbol with isdefined against
both packages.

Naming the specific invented symbols is what made the earlier `using Piccolo`
guidance stick (#225), so the same treatment here rather than another abstract
"follow the template" line.

Worth being explicit about what this does NOT fix: guidance is not enforcement.
The durable version is a preflight that resolves the script's symbols against
the entitled packages before submitting, which needs the Julia stack — not
available on a cloud-only machine, which is the whole point of the tier. In the
meantime aws-infra#230 makes the failure VISIBLE: with the runner's output
redirected to run.log, a MethodError reaches the user's run dir instead of
dying invisibly in the SSM stream, which is why this one presented as a bare
"failed, exit 1".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant