Skip to content

Print each staged-row source warning once per run - #1709

Merged
Muizzkolapo merged 3 commits into
mainfrom
issue-1700-warn-once
Nov 8, 2026
Merged

Muizzkolapo merged 3 commits into
mainfrom
issue-1700-warn-once

Conversation

@Muizzkolapo

@Muizzkolapo Muizzkolapo commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Closes #1700. Now based on main, since #1708 merged.

Problem

validate_staged_source_reads runs in _check_and_prepare, which the walk calls twice for each staged file:

  • from precheck_staged_file, before the first file is processed;
  • from process_initial_stage, when the file is processed.

Each call logged its warnings, so every warning printed twice.

Change

  • validate_staged_source_reads and _check_and_prepare take warn=True.
  • process_initial_stage passes warn=False. The walk pre-checks every staged file it will process (a file limit does not shorten that pass), so the pre-check's log is the one that prints.
  • Only logging is affected. A refusal still raises, at the pre-check.
  • Warn when a first action's guard reads a staged field no row holds #1686 renamed the function on main. The merge keeps main's name and docstring and adds the warn flag.

Verification

  • New test_each_warning_prints_once_per_staged_file, with one and two staged files, run through a real agac run. On main each warning printed twice and the test failed; now it passes.
  • After merging main: tests/unit/input and tests/integration give 3089 passed. The 3 failures are tokenizer downloads my sandbox cannot reach.
  • ruff, ruff format and mypy are clean.

Four tests in tests/unit/input failed when the folder ran in file order
and passed alone. TestOutputFieldPromotionInTaskPreparer patches
scope_builder.build_field_context_with_history, and the code under the
patch imports prompt.service for the first time. prompt.service binds
that name at import, so it kept the mock for the rest of the process,
and every later prompt build read the mock's source, which has no
ticket_id.

The test module now imports prompt.service and context_provider, the
two modules that bind the name at import, before any patch runs.

Closes #1702

Signed-off-by: Muizz Lateef <Lateefmuizz@gmail.com>
validate_source_reads_below runs in _check_and_prepare, which the walk
calls twice for each staged file: from precheck_staged_file, before the
first file is processed, and from process_initial_stage, when the file
is processed. Each call logged its warnings, so every one printed twice.

The pre-check logs them. The processing pass runs the same checks with
warn=False, so a refusal still stops the run, and each warning prints
once per file.

Closes #1700

Signed-off-by: Muizz Lateef <Lateefmuizz@gmail.com>
Signed-off-by: Muizz Lateef <Lateefmuizz@gmail.com>

# Conflicts:
#	agent_actions/input/preprocessing/staging/_MANIFEST.md
#	agent_actions/input/preprocessing/staging/field_validation.py
@Muizzkolapo
Muizzkolapo changed the base branch from issue-1702-input-test-leak to main November 8, 2026 15:17
@Muizzkolapo
Muizzkolapo merged commit 849875d into main Nov 8, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A staged-row source warning prints two times per run

1 participant