Repository navigation
refactor(autoimplement): apply the review polish on the prompt evidence work - #101
Merged
Merged
Conversation
…ce work A Fable review of the merged change found no defect and five small improvements. This applies four of them and documents the fifth. - The `EvidenceRef` digest comment claimed that a digest locates the durable record. That holds for a reference built from a recorded subtree, but the ledger and observation bounds digest a projected value, which matches no stored blob. Say what the digest covers. - The ledger kept the `dispatch` step, which returns the decision the `decide` step already recorded, so one control turn listed the same decision twice. Skip the steps whose output the prompt already shows in one named set. - `describeValue` returned `typeof value` in every branch, so delete it. - `docs/WORKFLOWS.md` said the ceiling keeps room for the engine's appended block. No code reserves that room, so state the real relation instead. - Record two accepted limits in the plan: the `Plan:` line stays whole, and the observation shortens field by field rather than as one value, because that would drop the available routes. Correct the branch coverage figure. Co-Authored-By: DeepSeek V4.1 Flash · Auto · Novita <noreply@pi.dev> Generated-By: pi 0.85.1 (https://pi.dev)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The bounded-evidence change merged in #100 was correct, and a Fable review found five small ways to
improve it.
Four are now applied, and the fifth is recorded as an accepted limit.
None of them fixes a defect that could break a run.
The largest one is a small waste: the decide prompt listed one control decision twice, because the
dispatchstep returns the decision thedecidestep already recorded.The rest are an inaccurate code comment, a dead helper, and two documentation corrections.
What Changed
The prompt already deduplicates results, but it missed the
dispatchstep.A control turn records
decide(the decision) and thendispatch(the same decision, returnedunchanged), so both copies reached the ledger.
The ledger now skips the steps whose output the prompt shows elsewhere, in one named set.
src/builtins/autoimplement.workflow.ts:PROMPT_ECHO_STEP_NODESreplaces the singleobserveconstant and holds
observeanddispatch. The ledger skips both, plus the include return steps italready skipped.
src/workflows/prompt-evidence.ts: theEvidenceRef.digestcomment said a digest lets a readerlocate the durable record. That holds for a reference built from a recorded subtree, but the ledger
and observation bounds digest a projected value, which matches no stored blob. The comment now says
what the digest covers.
src/workflows/prompt-evidence.ts: deleteddescribeValue, which returnedtypeof valuein everybranch.
refSourceusestypeof valuedirectly.docs/WORKFLOWS.md: the ceiling section said the ceiling keeps room for the live-control block thatthe engine appends. No code reserves that room. The section now states the real relation: one
complete request can be about 8,192 characters plus the step contract larger than the ceiling, and
that headroom is far below the context window the ceiling protects.
docs/plans/2026-09-17-prompt-evidence-budget-plan.md: records two accepted limits and corrects thebranch coverage figure from 92.75% to 94.38%.
The two recorded limits are deliberate:
Plan:line stays whole, because it is the decider's main input. A plan near the ceiling makesthe decide node fail with a named error, and the controller blocks after three failures.
observation would also drop
availableRoutesand the other small decisive fields, and a deciderwithout the routes is worse than a named failure that reports the sizes.
Testing
I ran the full local suite and one real-model live E2E.
The new ledger case uses the real include node id shapes and a realistic step order, so the fixture
can occur in a real run.
It fails on the earlier code: the decision reason appears twice without the fix.
npm run checkpasses: format, lint, typecheck, build, tests, coverage.npm run test:e2epasses (14 tests).npx slophammer-ts@latest dry .reports 0 candidates.npx slophammer-ts@latest check . --only ts.dependency-boundaries-requiredreports no findings.deepseek/deepseek-v4-flashthroughopenrouter,result: passed, measured model cost$0.0024.
Not tested: the prompt builders of the other built-in workflows still embed raw command output. That
work is unchanged and still open.
Risks
Risk is low. The change touches a prompt-only filter, one comment, and documentation.
dispatchstep, which carries no evidence thedecidestep does not carry.A test asserts that the decision appears once and that the include and observation steps stay out.
Follow-ups
The other Autoimplement prompt sites (review, CI, and comment inspection) still embed command output,
which the command-batch limit allows up to 1,000,000 characters per check.
Those results carry no log file path, so bounding them needs a decision about how an agent reads the
full log afterwards.