feat: surface post_condition symmetrically with pre_condition#8
Merged
Conversation
post_condition was stored on tasks and emitted in JSON payloads but never shown in the text output an agent sees when claiming or completing a task. Only pre_condition printed on `go`, so agents had to opt into JSON mode to see their own acceptance criteria. Changes: - `plandb go` now prints post_condition as "post-condition (acceptance)" right after pre_condition. Symmetric with how pre is already handled. - `plandb done` missing-result hint now mentions post_condition so the agent knows a verifiable result is expected (previously only fired when downstream dependents existed). - The existing trailing echo of post_condition on done transition is preserved — it reads as a verification reminder. Zero schema change. Pure surfacing fix. JSON payload unchanged. Test: tests/functional_test.sh adds three assertions verifying the text-mode output on go/done.
4f6b318 to
29342f3
Compare
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
post_conditionis stored on every task and emitted in JSON payloads but is invisible in the text output an agent actually reads during claim and completion. Onlypre_conditionprinted ongo, creating an asymmetry: agents had to remember to request JSON mode to see their own acceptance criteria. This PR closes that gap with a pure surfacing change — zero schema impact.What changes
plandb goprintspost-condition (acceptance): …right afterpre-condition: …. Declarative, not executed (that'spost_hook's role).plandb donemissing---resulthint now fires when either downstream dependents exist or apost_conditionis set, and names the reason so the agent understands why.post-condition: …echo ondoneis kept — it reads as a verification reminder at the moment the transition commits.Why this shape
pre_condition/post_conditionare the declarative half of the pair — shown to the agent, agent self-verifies.pre_hook/post_hookare the executable half — shell hooks that actually run and warn on failure. We already had the executable side symmetric. The declarative side was half-wired: stored, emitted in JSON, but never printed ongo. This PR restores symmetry with oneeprintln!and one hint extension.Follow-up roadmap (NOT in this PR — deliberate)
While auditing the surfacing model I inventoried everything an agent stores vs. what's auto-injected at claim time. Opening this as a separate investigation. Below is the product-level verdict per candidate, scored on "does it earn its context cost?":
t-xyz → <result> [artifacts: report.md, data.csv]previously failed: <last_error first 120ch>parent: t-abc "<title>"at claimupstream touched: src/foo.rs, src/bar.rsalongside handoffsiblings: 3/5 done— count only, no titlesgoresumed: <note>eventsif debuggingsearchitself when context shiftsBudget: worst-case addition to the
gopayload is ~6 lines on top of today's ~10-15. The rule applied throughout: nothing surfaces unless an agent would regret not having it the moment after claim. History, siblings-full, metadata all fail that test. Retry context, parent framing, upstream artifacts all pass it.Test plan
cargo build— greencargo test— 8/8 passbash tests/functional_test.sh— 131/131 pass (added 3 assertions for text-mode surfacing)