Skip to content

fix(roadmap): the stage gate log names each refused finding - #5441

Merged
dan-petty merged 3 commits into
mainfrom
fix/5433-the-stage-gate-log-names-each
Nov 13, 2026
Merged

dan-petty merged 3 commits into
mainfrom
fix/5433-the-stage-gate-log-names-each

Conversation

@dan-petty

@dan-petty dan-petty commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

When the checks refuse a stage plan, the Service logged only the counts of the gates and the codes of the last refused reply. On item #1976 the trace gate refused 10 paths, and nobody could tell if the planner claimed reads that it did not make, or if the gate refused true reads (#4590).

After the stage gate returns: line, log_gate_returns logs one stage gate refused finding: line for each of the first 20 findings of the last refused reply: its place, the count of all findings, the gate, the code and the subject. The subject is the path, the tool or the command that the message of the finding names (finding_subject). redact_text, the mask of mask_secrets, masks it before the line keeps its first 200 characters. The line holds no other text of the plan or of the model. The counts line keeps its fields, so the queries of the shepherd keep their matches.

Closes #5433

Change: openspec/changes/archive/2026-11-13-5433-the-stage-gate-log-names-each/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 13, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Local checks on the head (branch at origin/main 87e813d):

  • uv run devops ci fail-to-pass --base origin/main: 8 failed on base (all new behavior tests in tests/roadmap/stage/test_roadmap_stage_round_log.py), 2 passed on base (the old failed-item test and the no-return guard), 0 errored.
  • uv run devops ci test of test_roadmap_stage_round_log.py, test_roadmap_stage_findings.py, test_roadmap_stage_gate_extension.py, test_roadmap_stage_plan_record.py, test_roadmap_stage_refused_reply.py, test_roadmap_stage_repair_return.py: 178 passed.
  • uv run devops ci test of the other tests that read the round log (stage job, stage and implement negative search, implement submit and verification reason, refine round, refine job result, refine gateway failures, plan check): 269 passed.
  • uv run devops ci test of tests/invariants/ (architectural invariants, source tree, change folders, committed addresses): 185 passed.
  • uv run ruff check, ruff format --check on the 3 changed Python files: passed. uv run mypy on round_log.py and stage_findings.py: no issues.
  • uv run devops ci --check --only lint,format,domain: passed. uv run devops ci docs: up to date. uv run devops openspec check: passed.

Render diff: no k8s/ path and no chart value changes, so no kustomize or helm render difference and no restart.

Release: the stage job runs in the Service image, so the stage gate refused finding: lines come to Loki only after a release and a new Service image.

Scope: the issue text says "for each refused reply", and its Proposed Solution says "the last refused reply". The change logs the findings of the last refused reply, from the same call as the counts line. The design.md of the change folder gives the reason.

When the checks refused a stage plan, the log gave only the counts of
the gates and the codes of the last refused reply. Item #1976 failed
with 10 trace findings, and no log named the paths. So nobody could
tell a fault of the plan from a false positive of the trace gate.

After the counts line, which does not change, log_gate_returns now
logs one "stage gate refused finding" line for each of the first 20
findings of the last refused reply: its place, the count, the gate,
the code and the subject. The subject is the path, the tool or the
command that the template of the code names (finding_subject).
mask_secrets masks it, the line keeps the first 200 characters, and
json.dumps quotes it. The line holds no other text of the plan.

The stage job runs in the Service image, so the new lines need a
release.

Closes #5433.
CodeQL (py/clear-text-logging-sensitive-data) takes the value of a call
whose name holds secret as a secret, so it gave an alert for the log of
the value of mask_secrets. mask_secrets only calls redact_text, so the
mask does not change.
@dan-petty
dan-petty force-pushed the fix/5433-the-stage-gate-log-names-each branch from 3dc1bd0 to 4734fa8 Compare November 13, 2026 16:25
@dan-petty

Copy link
Copy Markdown
Owner Author

Check results

Head commit: 4734fa8883248fcdcc3d184966edab19916deaa8

Check Conclusion Link
Tests & Coverage success run
devops-cli success run
zizmor success run
trivy-config success run
Plan Check skipped run
Fail-to-Pass Check skipped run
Semantic PR title success run
CodeQL success run
Tests on Main skipped run
Test Job Duration skipped run
Dependency Freshness skipped run
MCP Server Image success run
Tests & Coverage (shard 2 of 4) success run
Changed-Test Independence success run
Tests & Coverage (shard 1 of 4) success run
Service Image success run
Tests & Coverage (shard 4 of 4) success run
Design Tokens success run
Static Analysis success run
Tests & Coverage (shard 3 of 4) success run
Runner Image success run
Analyze (python) success run
Analyze (actions) success run
Docs Site Build success run

Skipped check: Plan Check
Skipped check: Fail-to-Pass Check
Skipped check: Tests on Main
Skipped check: Test Job Duration
Skipped check: Dependency Freshness

@dan-petty

Copy link
Copy Markdown
Owner Author

Review fix on head 4734fa8 (rebased on origin/main 0d9ffa1):

  • CodeQL py/clear-text-logging-sensitive-data (alert 280, HIGH) flagged the subject= argument of the stage gate refused finding: line. CodeQL takes the value of a call whose name holds secret as a secret, so it took the value of mask_secrets as a secret. mask_secrets only calls redact_text, so the log now calls redact_text (b96d651). The mask does not change. The docs, the spec and the design.md of the change name redact_text. The CodeQL run on the new head passes, and the alert instance on the pull request is fixed.
  • After the fix: uv run devops ci test of test_roadmap_stage_round_log.py, test_roadmap_stage_findings.py, test_roadmap_stage_refused_reply.py: 120 passed. tests/invariants/test_change_folders.py and test_architectural_invariants.py: 128 passed. ruff check, ruff format --check, mypy on round_log.py: passed. uv run devops openspec check and uv run devops ci docs: passed.
  • The OpenSpec archive is again the last commit (uv run devops openspec archive ran after the fix commit).

@dan-petty
dan-petty marked this pull request as ready for review November 13, 2026 16:37
@dan-petty
dan-petty merged commit 47b1ec5 into main Nov 13, 2026
27 checks passed
@dan-petty
dan-petty deleted the fix/5433-the-stage-gate-log-names-each branch November 13, 2026 16:46
dan-petty pushed a commit that referenced this pull request Nov 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.130.0](v0.129.1...v0.130.0)
(2026-11-13)


### Features

* **k8s:** add RuntimeClass gvisor for the runsc nodes
([#5436](#5436))
([0d9ffa1](0d9ffa1))
* **roadmap:** make the attempt limits of the failing jobs settings
([#5490](#5490))
([a13e520](a13e520)),
closes [#5440](#5440)


### Bug Fixes

* **infra:** a plan shows a skip by a check-mode when as unchecked
([#5442](#5442))
([499b42c](499b42c))
* **infra:** the apply gate leaves out alerts of offline nodes
([#5478](#5478))
([3f0d0f0](3f0d0f0))
* **roadmap:** a named fix-plan run can skip the 6-hour wait
([#5459](#5459))
([94a1999](94a1999)),
closes [#5413](#5413)
* **roadmap:** a review finding must name a part of the plan
([#5418](#5418))
([34cdf12](34cdf12))
* **roadmap:** the stage gate log names each refused finding
([#5441](#5441))
([47b1ec5](47b1ec5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): the stage gate log names each refused claim

2 participants