Repository navigation
Warn when a first action's guard reads a staged field no row holds - #1686
Merged
Merged
Conversation
Muizzkolapo
force-pushed
the
guards/first-action-guard-reads
branch
from
November 8, 2026 12:39
ed2cd83 to
5f972d9
Compare
The staged-row check compared the source reads of every action below the first stage with the fields the staged rows hold, but it never read the first action's own guard. A misspelled field there under IS NULL passed every record with no message, while the same guard on a later action was warned of. The first-record render covers the first action's prompt and observe reads, but it does not evaluate a guard. The check now also reads the first action's guard and logs the same warning. It never refuses: a guard decides what a record without the field does. The function is renamed to validate_staged_source_reads, because it no longer covers only the actions below the first.
Muizzkolapo
force-pushed
the
guards/first-action-guard-reads
branch
from
November 8, 2026 13:43
5f972d9 to
61200c2
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
source.<field>an action reads with the fields the staged rows hold. It read every action below the first stage, but not the first action's own guard. A first action withguard: { condition: "source.scroe IS NULL", on_false: filter }passed every record with no message.Action 'tag' guards on source.scroe, but no record staged from staging/rows.json holds 'scroe'. Records from that file will not have it.observereads stay with the first-record render, which already checks them.validate_source_reads_belowis renamed tovalidate_staged_source_reads. It has one caller, ininitial_pipeline.py. That caller now passes the first action's config the way the seed-selector check beside it does.guards.mddocuments the warning. Its sentence about an upstream with no schema or withadditionalPropertiessaid the guard "says nothing". Preflight warnsCannot validate field 'descriptio'in both cases, so the sentence now says that.input-formats.md,input/ARCHITECTURE.mdand the staging and input manifests describe the first action's guard read.Verification
gate.sh redrecordedtest_a_first_action_guard_on_a_field_no_row_holds_warns_and_runs(a realagac run) failing on the missing warning line for== 'x'andIS NULL. The stored counts already matched (0 and 1), so the run itself does not change. The later-action guard test in the same file is the live positive control.gate.sh green: RED target passes,ruff format --check,ruff check,mypy agent_actions, full pytest 17242 passed, 37 skipped.test_a_first_action_guard_on_a_field_no_row_holds_warns.py: one exact warning for a misspelled guard field, none for a held field, and no scan of the first action's prompt,observeorpassthroughreads. A mutant that also scanspassthroughfails it (mutate.sh: KILLED).ql_guard_probewithsource.scroe IS NULLontag: this branch prints the warning andGuard pre-filter for 'tag': 2 passed, exit 0.mainprints no warning.additionalProperties: true, and with no schema:agac inspectwarnsCannot validate field 'descriptio';agac runpasses 2 of 2 records.agac inspectandagac run --freshonql_staging_precheckandql_contract_probe: validated, exit 0, no new refusal.risk.sh): 2 YES, 1 NO. The NO named a false design note in the staging manifest; it is corrected, withinput-formats.mdand thepassthroughtest case the other reviewers named. GREEN ran again after those edits. Recorded YES_WITH_ISSUES.gate.sh smoke --skip:risk.shreportedsmoke_required=no; the change is in staging validation only, and the sample-project runs above cover it.Known limit
maindoes the same for a later action. This change does not fix it.