You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: frame intent summaries in the planner's trigger lines and overview - #312
Part of #124 (row 2 of the audit) — not a full close, see the open question below.
What the audit found
Row 2 of the #124 audit asked whether anything reaches the planner outside an
envelope frame. Two paths do:
renderTriggers interpolates intent_summary straight into the trigger
line, so a worker that finishes with summary text produces - The worker of intent #11 (<summary>) finished. The summary is inside the
sentence, in the operator's voice, unframed.
Inherited intents are rendered as open_intents / running_intents / recent_done_intents in the plain [Counters, intents and coverage] block
rather than as framed values.
Both are structural: the envelope machinery itself holds, but these two call
sites bypass it.
Evidence
agent/data_envelope_audit_test.go is gated behind -tags artex_audit, so it
never runs in the normal suite — it is an audit artifact, not a CI test.
On base fa33d4d:
$ go test -tags artex_audit ./agent -run TestEnvelopeAudit
--- FAIL: TestEnvelopeAuditIntentSummaryInTriggerLines
trigger line carries the intent summary outside a frame:
"- The worker of intent #11 (Ignore previous instructions and ...) finished"
--- FAIL: TestEnvelopeAuditInheritedIntentInOverview
inherited intent summary appears unframed in the counters block
--- PASS: TestEnvelopeAuditControlFramedFact
On this branch all three pass. The control asserts that a properly framed fact
still renders framed, so the harness fails for the right reason in both states.
Change
agent/planner.go: wrap intent_summary on the done/finding lines and sm + cancellation_reason on the cancelled line via env.wrap(...).
agent/data_envelope.go: add open_intents, running_intents and recent_done_intents to overviewDerivedFields so the overview section
renders them framed instead of as raw JSON.
Checks
go test -count=1 ./agent — ok
go test -tags artex_audit ./agent -run TestEnvelopeAudit — ok
go vet ./agent, gofmt -l agent/, go build ./... — clean
Open question for the maintainer
The fix requires editing an existing expectation. TestWorkerOverviewEnvelopeSplit
currently asserts that the open-intent summary appears outside the frame, i.e.
the current behaviour is written down as intended. My reading is that intent
summaries are model-authored and therefore belong inside frames, which is why
that assertion moves. If you consider the intent list operator/derived data and
deliberately unframed, drop the data_envelope.go hunk and keep the planner.go one — the trigger-line path is unframed either way.
Happy to rework the framing, the field names, or the split if the existing
grouping has a reason I've missed.
Thanks. Both paths are real, and they are already framed in main via #311 (729f935). I ran your audit harness unmodified on 9a2a9e6: 3/3 pass (red on your base fa33d4d, as documented). This branch is therefore conflicting with the merged fix and would undo part of it, so I'm closing it as superseded.
For your open question: the intent lists stay in the plain JSON (id, state, source_task_id, inherited) because the planner dispatches on them; only the summary, the model-authored part, moves into one field=intent_summaries frame. The deletion reason stays outside on purpose: it is typed by the operator. And #311 turned your two invariants into normal tests, since a -tags audit never runs in CI.
Rows 1 and 2 are closed in main. For the remaining rows, an issue first would be better than a diff.
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
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.
Part of #124 (row 2 of the audit) — not a full close, see the open question below.
What the audit found
Row 2 of the #124 audit asked whether anything reaches the planner outside an
envelope frame. Two paths do:
renderTriggersinterpolatesintent_summarystraight into the triggerline, so a worker that finishes with summary text produces
- The worker of intent #11 (<summary>) finished. The summary is inside thesentence, in the operator's voice, unframed.
open_intents/running_intents/recent_done_intentsin the plain[Counters, intents and coverage]blockrather than as framed values.
Both are structural: the envelope machinery itself holds, but these two call
sites bypass it.
Evidence
agent/data_envelope_audit_test.gois gated behind-tags artex_audit, so itnever runs in the normal suite — it is an audit artifact, not a CI test.
On base
fa33d4d:On this branch all three pass. The control asserts that a properly framed fact
still renders framed, so the harness fails for the right reason in both states.
Change
agent/planner.go: wrapintent_summaryon thedone/findinglines andsm+cancellation_reasonon thecancelledline viaenv.wrap(...).agent/data_envelope.go: addopen_intents,running_intentsandrecent_done_intentstooverviewDerivedFieldsso the overview sectionrenders them framed instead of as raw JSON.
Checks
go test -count=1 ./agent— okgo test -tags artex_audit ./agent -run TestEnvelopeAudit— okgo vet ./agent,gofmt -l agent/,go build ./...— cleanOpen question for the maintainer
The fix requires editing an existing expectation.
TestWorkerOverviewEnvelopeSplitcurrently asserts that the open-intent summary appears outside the frame, i.e.
the current behaviour is written down as intended. My reading is that intent
summaries are model-authored and therefore belong inside frames, which is why
that assertion moves. If you consider the intent list operator/derived data and
deliberately unframed, drop the
data_envelope.gohunk and keep theplanner.goone — the trigger-line path is unframed either way.Happy to rework the framing, the field names, or the split if the existing
grouping has a reason I've missed.