Skip to content

Reconcile stale failure ledger projections - #1493

Merged
Chris0Jeky merged 6 commits into
mainfrom
issue-1492/failure-ledger-reconciliation
Jul 26, 2026
Merged

Reconcile stale failure ledger projections#1493
Chris0Jeky merged 6 commits into
mainfrom
issue-1492/failure-ledger-reconciliation

Conversation

@Chris0Jeky

@Chris0Jeky Chris0Jeky commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

Part of #1291; #1291 remains open.

Closes #1492

Implementation Notes

Verification

  • dotnet test backend/Taskdeck.sln -c Release (not run: no backend/product behavior changed)
  • Push-Location frontend/taskdeck-web; npm run typecheck; if ($LASTEXITCODE -ne 0) { Pop-Location; exit $LASTEXITCODE }; npm run build; if ($LASTEXITCODE -ne 0) { Pop-Location; exit $LASTEXITCODE }; npx vitest --run; $code = $LASTEXITCODE; Pop-Location; if ($code -ne 0) { exit $code } (not run: no frontend behavior changed)
  • Playwright smoke/E2E executed (not applicable: no UI or cross-surface behavior changed)
  • py -3.14 -B -m unittest discover -s scripts/agent_hooks -p 'test_render_failure_ledger.py' -v — 11/11 passed
  • py -3.13 -B -m unittest discover -s scripts/agent_hooks -p 'test_render_failure_ledger.py' -v — 11/11 passed
  • Stale-Markdown control — the synchronization test failed as intended against an in-memory stale projection
  • Workflow YAML parsed with PyYAML; exact actions/setup-python@v7 / Python 3.12 pin and test-before-render ordering assertions passed
  • Exact malformed/non-object entry-point probes — each returned 1 and preserved the sentinel target
  • Python 3.14 denied-read entry-point probe — returned 1, preserved the sentinel target, and reported the source path plus Permission denied
  • Drop-all-rendered-rows mutation probe — failed 2/11 tests as intended (mixed issue-less rendering and checked-in JSONL/Markdown synchronization)
  • $env:PATH = 'C:\Python314;' + $env:PATH; py -3 -B scripts/agent_hooks/smoke_test.py — hook behavior smoke matrix passed
  • Fresh renderer run is byte-identical — SHA-256 52C4CBC17BC401AC41B3DA50A4CBA9A3AB95AA5AEA52A857DC492FD6EF8E4B7B
  • JSONL parsed with required fields — raw 23 (9 open/14 resolved), projected 15 (1 open/14 resolved)
  • Sole open projection remains invalid_signal / ci/e2e-smoke; raw seed count 1, projected seed count 0
  • node scripts/check-docs-governance.mjs
  • node scripts/check-golden-principles.mjs
  • node scripts/check-github-ops-governance.mjs
  • git diff --check 61f718af941c56c31b8b7595333b9debd6e47da8..HEAD
  • Exact eight-file PR scope, clean worktree, and DCO 6/6

Documentation

  • docs/agentic/failure_ledger.jsonl appended and docs/agentic/FAILURE_LEDGER.md regenerated
  • docs/STATUS.md updated with the Required Docs Governance synchronization invariant and corrected Gate configured-handler hook smoke matrix in Required CI #1476 scope
  • docs/IMPLEMENTATION_MASTERPLAN.md updated with the delivered gate/history; roadmap sequencing and ADRs unchanged
  • docs/STATUS.md, docs/IMPLEMENTATION_MASTERPLAN.md, and docs/TESTING_GUIDE.md Last Updated: lines verified exactly as 2026-07-26
  • docs/TESTING_GUIDE.md updated with the enforced unittest before renderer regeneration; docs/MANUAL_TEST_CHECKLIST.md reviewed and unchanged

Tracking

  • Linked issue included: Closes #1492
  • Linked issue and PR project items verified as Review / Priority II

CI Workflow Validation

  • Exact-head CI is in progress on 161638cf80a4b7d6116cf08a7b5cd8c61e1ec2e4 — run 30191454890
  • Exact-head CI Extended passed on 161638cf80a4b7d6116cf08a7b5cd8c61e1ec2e4 — run 30191455034
  • All CI/review evidence on earlier heads is stale after the review-fix commit.

Risk Notes

Signed-off-by: Chris0Jeky <jeky.tck@gmail.com>
Signed-off-by: Chris0Jeky <jeky.tck@gmail.com>

Copy link
Copy Markdown
Owner Author

@codex review exact head b3838d0. Please focus on seed-only and issue-less projection semantics, append-only ledger truth, resolution evidence/overclaiming, future appendability of tests, linked-issue safety, and generated-render synchronization. All earlier-head evidence is stale if this head moves.

Copy link
Copy Markdown
Owner Author

Deliberate self-review findings — exact head b3838d0632d9465f4ec16216d13fca312d568d4d

HIGH — PR metadata could close the parent tracker unintentionally

The initial PR body used a negated close-keyword sentence beside #1291. GitHub nevertheless added both #1291 and #1492 to closingIssuesReferences, so merging the PR could have closed the still-open parent tracker.

Expected fix: remove every close/fix/resolve keyword near #1291, retain only Closes #1492, and verify the live closing-link set rather than trusting the prose.

Status: fixed in PR metadata before handoff.

MEDIUM — regression test froze a mutable append-only ledger

The first local test draft loaded the repository JSONL directly and hard-coded today's 23 raw / 15 projected / 14 resolved / 1 open counts. The next legitimate ledger append would have failed the renderer unit suite even if projection behavior remained correct.

Expected fix: use a deterministic synthetic fixture containing seed metadata, the issue-less E2E row, and the four open/resolved projection pairs; keep live repository counts as verification evidence only.

Status: fixed before push in test commit b3838d0632d9465f4ec16216d13fca312d568d4d.

Other severities

  • CRITICAL: none.
  • LOW: none.
  • Out-of-scope findings: none.

Existing-comment triage at review time: one @codex exact-head review request is pending; there are no inline threads or submitted reviews yet.

Copy link
Copy Markdown
Owner Author

Self-review fix evidence

  • HIGH — parent-tracker closing link: metadata-only fix; no source commit applies. The body now says Part of #1291; #1291 remains open. and retains Closes #1492. A fresh gh pr view 1493 --json closingIssuesReferences,headRefOid,baseRefOid returned exactly closing=[1492], head b3838d0632d9465f4ec16216d13fca312d568d4d, base 61f718af941c56c31b8b7595333b9debd6e47da8.
  • MEDIUM — future appendability: commit b3838d0632d9465f4ec16216d13fca312d568d4d replaces the live-ledger invariant with a 10-row synthetic fixture: one seed, one issue-less ci/e2e-smoke row whose future_fix itself contains seed, and four open/resolved tracked pairs. It asserts 5 projected rows, 4 resolved/1 open, all four latest target states resolved, no projected seed, and E2E as the sole open row.

Verification after the fixes:

  • py -3 -m unittest test_render_failure_ledger.py — 5/5 passed.
  • Fresh renderer run remained byte-identical at SHA-256 52C4CBC17BC401AC41B3DA50A4CBA9A3AB95AA5AEA52A857DC492FD6EF8E4B7B.
  • Live ledger remains verification evidence, not a unit fixture: 23 raw (9 open/14 resolved) → 15 projected (1 open/14 resolved); the sole open projection is invalid_signal / ci/e2e-smoke; raw seed 1/projected seed 0.
  • JSONL exact-base diff is append-only +4/-0.
  • All three governance gates pass; git diff --check, exact four-file scope, clean worktree, and DCO 2/2 pass.
  • CI Extended run 30189284513 is green on the exact head.

The outstanding @codex review request remains pending and will be triaged when it reports.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: b3838d0632

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Review Result

No findings on exact head b3838d0632d9465f4ec16216d13fca312d568d4d.

  • Seed entries are removed before projection, while issue-less non-seed entries retain per-row identities and are not accidentally collapsed. Empty or seed-only inputs render the ledger structure without fabricating a fallback record. scripts/agent_hooks/render_failure_ledger.pyL48-L84
  • The tests independently cover tracked-state replacement, distinct tracking issues, issue-less rows, seed-only rendering, and a synthetic reconciliation fixture that will not break after legitimate future ledger appends. scripts/agent_hooks/test_render_failure_ledger.pyL8-L79 scripts/agent_hooks/test_render_failure_ledger.pyL81-L172
  • The raw ledger remains append-only, with the four resolution records preserving the original open history and explicitly retaining residual scope for #1343. docs/agentic/failure_ledger.jsonlL15-L23
  • The generated Markdown is synchronized with the projected data: seed metadata is absent, the issue-less E2E failure remains the sole open row, and the four reconciled targets render resolved. docs/agentic/FAILURE_LEDGER.mdL11-L25
  • Resolution evidence is appropriately scoped: #1343 explicitly preserves #1388/#1410 residuals, while the other records identify the exact merged repair and browser-evidence commits. docs/agentic/failure_ledger.jsonlL20-L23
  • Based on the supplied PR metadata, only #1492 is closing-linked and #1291 is described as a non-closing parent tracker.
  • No files were changed, so no commit or follow-up PR was created.

Tooling Limitation

I could not independently post the required no-findings review comment or re-read live GitHub comments because this checkout has neither the gh executable nor authenticated GitHub web access. The review therefore used all comments and metadata supplied in the request. This is an environment limitation, not a source-code finding.

Testing

  • python3 -m unittest test_render_failure_ledger.py — 5 tests passed.
  • python3 render_failure_ledger.py — regenerated output remained byte-identical in this checkout.
  • sha256sum ../../docs/agentic/FAILURE_LEDGER.md — before and after both produced a4aa196b15afdc07757f8ca4a3d31ba6bb545553621c73153fa9415373f719e4; this differs from the Windows-reported hash because checkout line endings are platform-dependent.
  • node scripts/check-docs-governance.mjs
  • node scripts/check-golden-principles.mjs
  • node scripts/check-github-ops-governance.mjs
  • git diff --check 61f718af941c56c31b8b7595333b9debd6e47da8..HEAD
  • git diff --numstat 61f718af941c56c31b8b7595333b9debd6e47da8..HEAD -- docs/agentic/failure_ledger.jsonl — append-only 4/0.
  • git show -s --format='%H %s' <evidence-commit> — all five cited merge/evidence commits exist locally.
  • git status --short — clean worktree.
  • ⚠️ gh pr view 1493 --json headRefOid,baseRefOid,closingIssuesReferences,comments,reviews,statusCheckRollup,files — unavailable because gh is not installed.
  • ⚠️ GitHub PR page retrieval — unavailable because the environment returned HTTP 401.

Documentation

  • docs/STATUS.md and docs/IMPLEMENTATION_MASTERPLAN.md were reviewed and left unchanged because this review introduced no change to product reality or roadmap sequencing.
  • No tests or files were added or modified.

Outstanding Maintainer Checklist

Open items remain in OUTSTANDING_TASKS.md, including #1133, #1134, #1123, #1132, #1131, #1166, #1138, #1136, #1137, #1135/#1140/#1141/#1139, the cohort-metrics and Ollama-streaming gaps, GEN/REVIVAL trackers, and the archive/revival execution items. OUTSTANDING_TASKS.mdL28-L58 OUTSTANDING_TASKS.mdL64-L86

The explicit operational residuals also remain: #1173, #1303, #1482, project-priority access, harness/security/Paper follow-ups, #1323, the #1456/#1457 trust gate, merged-worktree pruning, and explicit-base branch discipline. OUTSTANDING_TASKS.mdL91-L115

View task →

@chatgpt-codex-connector

Copy link
Copy Markdown

Review Result

No findings at exact head b3838d0632d9465f4ec16216d13fca312d568d4d.

  • Seed rows are removed before projection, while issue-less non-seed rows receive unique file-order keys and remain independently visible. scripts/agent_hooks/render_failure_ledger.pyL48-L71
  • The deterministic synthetic fixture covers seed-only rendering, the issue-less E2E entry, and four open/resolved projection pairs without coupling the test suite to mutable repository counts. scripts/agent_hooks/test_render_failure_ledger.pyL64-L79 scripts/agent_hooks/test_render_failure_ledger.pyL81-L172
  • The ledger remains append-only: the four reconciliation records occupy new lines 20–23, and their resolution claims retain precise issue, PR, merge-SHA, and residual-debt evidence. docs/agentic/failure_ledger.jsonlL20-L23
  • The generated Markdown is synchronized with the projected ledger: seed metadata is absent, the issue-less E2E failure remains open, and the four reconciled entries render resolved. docs/agentic/FAILURE_LEDGER.mdL13-L25
  • Live GitHub API checks confirmed issues #1343, #1347, #1348, and #1490 are closed, and the cited PRs/merge SHAs match the ledger records.
  • PR metadata contains only Closes #1492; #1291 is referenced without a close/fix/resolve keyword.
  • All existing PR comments, inline comments, reviews, and exact-head checks were inspected. There were no unresolved inline threads or submitted reviews.
  • No code changes were necessary, so no commit or follow-up PR was created.

Testing and Verification

  • python3 -m unittest test_render_failure_ledger.py — 5 tests passed.
  • python3 render_failure_ledger.py; cmp -s /tmp/FAILURE_LEDGER.before ../../docs/agentic/FAILURE_LEDGER.md — regenerated Markdown was byte-identical.
  • node scripts/check-docs-governance.mjs
  • node scripts/check-golden-principles.mjs
  • node scripts/check-github-ops-governance.mjs
  • git diff --check 61f718af941c56c31b8b7595333b9debd6e47da8..HEAD
  • ✅ Synthetic/live projection audit — 23 raw rows → 15 projected rows; 14 resolved and one open; zero projected seed rows.
  • ✅ Append-only audit — exact base contained 19 rows, head contains 23 rows, and the first 19 rows are unchanged.
  • ✅ GitHub REST verification — all four cited issues are closed and all five cited PR merge SHAs match.
  • ✅ DCO audit — both commits contain Signed-off-by: trailers.
  • git status --short --branch — clean worktree at completion.
  • ⚠️ bash scripts/check-git-env.sh — repository was usable and no index.lock existed, but the script warned that /usr/bin/git appears MSYS/Cygwin-like.
  • ❌ Initial governance checks from scripts/agent_hooks — agent invocation error because the scripts expect repository-root working directory; immediately rerun from /workspace/Taskdeck, where all three passed.

Outstanding Maintainer Items

OUTSTANDING_TASKS.md still contains human-owned open work, notably #1291, the v0.1/revival and generalist tracks, project-priority synchronization, the #1457 interactive trust gate, and merged-worktree pruning. None were checked off during this review.

View task →

Copy link
Copy Markdown
Owner Author

Independent adversarial review — projection/test-correctness

Exact head: b3838d0632d9465f4ec16216d13fca312d568d4d.

CRITICAL

None.

HIGH

None.

MEDIUM

  1. Fail closed before replacing the projection when a JSONL row is malformed or is not an objectscripts/agent_hooks/render_failure_ledger.py:93-102.

main() currently catches malformed JSON and silently skips non-dictionary JSON, then returns 0 after overwriting FAILURE_LEDGER.md. A partial/interleaved hook append can therefore disappear from the human ledger while the renderer reports success. Empty/missing/seed-only input may legitimately render an empty table; corrupt input must remain distinguishable.

Exact negative probe (temporary files only):

@'
import sys, tempfile
from pathlib import Path
sys.path.insert(0, str(Path.cwd() / "scripts" / "agent_hooks"))
import render_failure_ledger as r
for name, payload in {"malformed": "{not-json}\n", "non_object": "[]\n"}.items():
    with tempfile.TemporaryDirectory() as d:
        source, target = Path(d) / "failure_ledger.jsonl", Path(d) / "FAILURE_LEDGER.md"
        source.write_text(payload, encoding="utf-8")
        target.write_text("sentinel", encoding="utf-8")
        old_source, old_target = r.JSONL, r.MD
        r.JSONL, r.MD = source, target
        try: rc = r.main()
        finally: r.JSONL, r.MD = old_source, old_target
        output = target.read_text(encoding="utf-8")
        body = output.partition("| --- | --- | --- | --- | --- | --- | --- |")[2].partition("## Classification")[0]
        rows = [line for line in body.splitlines() if line.startswith("| ")]
        print(f"{name}: rc={rc} sentinel_preserved={output == 'sentinel'} rendered_data_rows={len(rows)}")
'@ | py -3 -B -

Result:

malformed: rc=0 sentinel_preserved=False rendered_data_rows=0
non_object: rc=0 sentinel_preserved=False rendered_data_rows=0

Expected fix: validate every nonblank source line as a JSON object, report the line/error, return nonzero, and leave the existing Markdown untouched; add both malformed and non-object entry-point regressions.

  1. The new tests do not prove that normal rows render, so a drop-all-rendered-rows mutation survives 5/5scripts/agent_hooks/test_render_failure_ledger.py:64-172 and render_failure_ledger.py:74-84.

The projection helper tests are useful, but the only render_markdown() assertion is seed-only and expects zero rows. There is also no checked-in JSONL → Markdown synchronization assertion. This exact mutation simulates render_markdown() receiving no normal projected rows while leaving the directly tested projection helper intact:

@'
import io, sys, unittest
from pathlib import Path
sys.path.insert(0, str(Path.cwd() / "scripts" / "agent_hooks"))
import render_failure_ledger as r
import test_render_failure_ledger as tests
original = r.project_latest_entries
r.project_latest_entries = lambda entries: []
try:
    result = unittest.TextTestRunner(stream=io.StringIO(), verbosity=0).run(
        unittest.defaultTestLoader.loadTestsFromModule(tests))
finally:
    r.project_latest_entries = original
print(f"drop_all_render_rows_mutant_tests_run={result.testsRun} failures={len(result.failures)} errors={len(result.errors)} successful={result.wasSuccessful()}")
'@ | py -3 -B -

Result:

drop_all_render_rows_mutant_tests_run=5 failures=0 errors=0 successful=True

Expected fix: add a positive mixed-input render assertion proving a normal issue-less row appears and seed does not, plus a future-appendable repository synchronization test that parses the checked-in JSONL and compares render_markdown(entries) with FAILURE_LEDGER.md without hard-coding mutable row/status counts.

LOW

None.

Exact-head evidence and comment triage

  • All six existing top-level comments were read. The self-review HIGH closing-link and MEDIUM hard-coded-count findings are fixed/verified. The three no-finding bot notices do not invalidate the two findings above because they exercised current happy-path output, not these reproduced negative/mutation paths.
  • Submitted reviews: 0. Inline review comments/threads: 0 (REST fallback after GraphQL rate limiting). No untriaged bot/human item remains.
  • Raw JSONL is an exact byte-prefix extension of the base blob: 19 original rows + 4 appended rows; 23 raw → 15 projected; 14 resolved/1 open; seed suppressed; issue-less ci/e2e-smoke remains open; all four targets resolve by first-issue/file-order identity.
  • Checked-in Markdown equals a fresh in-memory render; Windows working-tree SHA-256 is 52C4CBC17BC401AC41B3DA50A4CBA9A3AB95AA5AEA52A857DC492FD6EF8E4B7B.
  • Local unit suite: 5/5 passed. Hook smoke passed after prepending the active Python 3.14.3 directory because bare python initially resolved to the Microsoft Store alias. All three governance gates and git diff --check passed; worktree stayed clean; DCO trailers are present 2/2.
  • Hosted exact-head checks: 36 complete, 25 success / 11 intentional skips / 0 pending / 0 failed. No backend/frontend behavior finding.

No out-of-scope finding was discovered.

Signed-off-by: Chris0Jeky <jeky.tck@gmail.com>

Copy link
Copy Markdown
Owner Author

Addressed both MEDIUM findings from the changes-requested projection review on new exact head 75eb8023597802f7d775dc775dd642e7fe00167b.

Finding → fix → evidence:

  1. Malformed/non-object JSONL could be silently skipped and overwrite Markdown → commit 75eb8023 adds a validating loader and makes the entry point return nonzero before any target creation/write. Missing, empty, and seed-only sources remain valid. The exact reviewer probes now report rc=1, sentinel_preserved=True, and rendered_data_rows=0 for both malformed JSON and a non-object JSON value. Entry-point regressions also prove a malformed second line is reported with path/line/error context and preserves the target.
  2. Drop-all projection mutation survived the tests → commit 75eb8023 adds a positive mixed seed + issue-less normal row rendering assertion and a future-appendable checked-in JSONL→Markdown synchronization test without mutable count constants. The reviewer mutation now fails 2/10 tests: test_mixed_input_renders_issue_less_row_but_not_seed and test_checked_in_markdown_matches_jsonl_projection.

Additional exact-head verification:

  • Python unit discovery: 10/10 passed.
  • Hook behavior smoke matrix: passed.
  • Fresh renderer output remained byte-identical: SHA-256 52C4CBC17BC401AC41B3DA50A4CBA9A3AB95AA5AEA52A857DC492FD6EF8E4B7B.
  • JSONL evidence: raw 23 (9 open / 14 resolved), projected 15 (1 open / 14 resolved), raw seed 1 / projected seed 0.
  • Docs, golden-principles, and GitHub-operations governance gates: passed.
  • Exact four-file scope, git diff --check, clean worktree, DCO 3/3: passed.

Exact-head CI and CI Extended are running as 30190054648 and 30190054621. All CI/review evidence on b3838d06 is stale after this head change.

Copy link
Copy Markdown
Owner Author

@codex review

Please perform a fresh adversarial review of PR #1493 at exact head 75eb8023597802f7d775dc775dd642e7fe00167b. The prior changes-requested evidence on b3838d0632d9465f4ec16216d13fca312d568d4d is stale. Please specifically re-test fail-closed malformed/non-object JSONL handling, target preservation, mixed issue-less rendering, and the checked-in JSONL→Markdown synchronization boundary.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 75eb802359

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/agent_hooks/test_render_failure_ledger.py
Signed-off-by: Chris0Jeky <jeky.tck@gmail.com>

Copy link
Copy Markdown
Owner Author

Review-fix evidence — exact head c0d90457b9eb09b42a31eb38c9260ef5e386453e

P2 — synchronization unittest was not enforced → commit c0d90457:

  • .github/workflows/reusable-docs-governance.yml: setup actions/setup-python@v7 with Python 3.12, then run the existing failure-ledger unittest in Required CI.
  • docs/TESTING_GUIDE.md: run the same unittest via py -3 with fail-fast exit handling before renderer regeneration.

Verification:

  • Normal enforced command: 10/10 passed.
  • Stale-Markdown control: 1/10 failed at the synchronization assertion, proving the gate catches stale checked-in output before rendering; reverse patch restored the original file and 10/10 passed.
  • Generated Markdown restored byte-for-byte at SHA-256 52C4CBC17BC401AC41B3DA50A4CBA9A3AB95AA5AEA52A857DC492FD6EF8E4B7B with zero diff.
  • Workflow YAML parsed; Python pin and test-before-render order asserted.
  • Docs, golden-principles, and GitHub-operations governance gates passed.
  • Exact six-file PR scope, clean worktree, git diff --check, DCO 4/4 passed.

Inline reply 3651900587 maps the finding to the fix, and thread PRRT_kwDOQXwLG86T01ZO is resolved. Exact-head CI/CI Extended remain pending; all earlier-head evidence is stale.

Copy link
Copy Markdown
Owner Author

@codex review

Please perform a fresh adversarial review of PR #1493 at exact head c0d90457b9eb09b42a31eb38c9260ef5e386453e. All earlier-head review evidence is stale. Please specifically verify that Required CI now executes the checked-in JSONL↔Markdown synchronization assertion and that the documented Windows sequence fails before renderer regeneration can mask stale output.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c0d90457b9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/reusable-docs-governance.yml
Signed-off-by: Chris0Jeky <jeky.tck@gmail.com>

Copy link
Copy Markdown
Owner Author

Review-fix evidence — exact head 9842e945af62416262a52db846f4cf71122346ae

P1 — Required-CI behavior absent from canonical docs → commit 9842e945:

  • docs/STATUS.md now states the enforced failure-ledger JSONL↔Markdown synchronization invariant.
  • docs/IMPLEMENTATION_MASTERPLAN.md records the delivered gate in the 2026-07-26 history.
  • Both canonical date lines are exactly Last Updated: 2026-07-26.
  • No roadmap reprioritization, planning-horizon change, or ADR change.

Verification:

  • Failure-ledger unittest: 10/10 passed.
  • Docs, golden-principles, and GitHub-operations governance gates: passed.
  • Exact two-file fix scope, git diff --check, clean worktree, and DCO 5/5: passed.
  • Existing six implementation/test/workflow files are unchanged by this fix.
  • The previously posted stale-Markdown control evidence remains valid and was not repeated.

Inline reply 3651917906 maps the finding to the fix; thread PRRT_kwDOQXwLG86T052N is resolved. Exact-head CI and CI Extended are pending, and all earlier-head evidence is stale.

Copy link
Copy Markdown
Owner Author

@codex review

Please perform a fresh adversarial review of PR #1493 at exact head 9842e945af62416262a52db846f4cf71122346ae. All earlier-head review evidence is stale. Please specifically verify that the Required Docs Governance synchronization gate is recorded accurately and concisely in both canonical documents, with exact 2026-07-26 date lines and no roadmap or ADR drift.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 9842e945af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Chris0Jeky Chris0Jeky left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent adversarial review — operational truth

Exact head: 9842e945af62416262a52db846f4cf71122346ae.

CRITICAL

None.

HIGH

None.

MEDIUM

  1. Narrow the stale zero-CI-coverage claim to the remaining smoke/deny-floor gapdocs/STATUS.md:25.

This PR makes Required Docs Governance execute test_render_failure_ledger.py, but STATUS still says scripts/agent_hooks/ has zero CI coverage. That now contradicts the new invariant added at the top of the same document. Issue #1476 remains valid for the ungated smoke_test.py / configured-handler deny-floor matrix; update the historical residual wording to say that precise remaining gap instead of zero coverage.

LOW

  1. Fail closed when source metadata/read access is denied on Python 3.14scripts/agent_hooks/render_failure_ledger.py:94.

Path.exists() can return False for a source PermissionError under the documented/local Python 3.14 runtime. The renderer then treats the denied ledger as missing, returns 0, and overwrites an existing Markdown target with an empty projection. Exact probe: Python 3.14 returned rc=0 / target_preserved=False; Python 3.13 returned rc=1 / preserved. Read directly, catch only FileNotFoundError as the valid missing-source case, and add a regression proving other OSError values remain nonzero and preserve the target.

  1. Refresh the materially changed testing guide datedocs/TESTING_GUIDE.md:5.

The guide now documents a new fail-before-render required check, but its Last Updated line remains 2026-07-14. Set it to 2026-07-26 so the active document's date matches its new operational contract.

Review state

All current conversation comments, both resolved Codex threads, the exact-head Codex no-major-issues response, project/closing metadata, and hosted checks were swept. The exact head remained pinned during reproduction. These findings block merge and require a fresh exact-head review/CI round after the fix; no finding is waived.

Signed-off-by: Chris0Jeky <jeky.tck@gmail.com>

Copy link
Copy Markdown
Owner Author

Formal review 4781131779 is addressed at exact head 161638cf80a4b7d6116cf08a7b5cd8c61e1ec2e4 (Harden failure ledger operational checks):

  • MEDIUM — stale Gate configured-handler hook smoke matrix in Required CI #1476 scope: docs/STATUS.md now says the configured-handler smoke_test.py / deny-floor matrix remains ungated while failure-ledger synchronization is already enforced by Required Docs Governance.
  • LOW — denied reads treated as missing: the renderer now reads the source directly and catches only FileNotFoundError; other read failures return nonzero through the entry point without replacing the target. The new Python 3.14 regression simulates Path.exists() == false plus read_text() raising PermissionError and verifies the sentinel target survives.
  • LOW — stale testing-guide date: docs/TESTING_GUIDE.md now records Last Updated: 2026-07-26.

Fix evidence:

  • Python 3.14 focused suite: 11/11 passed.
  • Python 3.13 focused suite: 11/11 passed.
  • Exact Python 3.14 denied-read probe: exit 1, target preserved, source filename and Permission denied reported.
  • Malformed/non-object controls: exit 1 and target preserved.
  • Drop-all mutation: 2/11 failures as intended; stale-projection control failed as intended.
  • Hook smoke and all three docs/project governance checks passed.
  • Exact scope remains eight files; git diff --check passed; DCO is 6/6.
  • Exact-head CI Extended passed in run 30191455034; required CI run 30191454890 is still in progress.

Copy link
Copy Markdown
Owner Author

@codex review

Please perform a fresh adversarial review of exact head 161638cf80a4b7d6116cf08a7b5cd8c61e1ec2e4. In particular, re-check the three findings from review 4781131779: the narrowed #1476 wording, denied-source-read fail-closed behavior and regression, and the testing-guide update date. Earlier-head review evidence is superseded.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 161638cf80

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Chris0Jeky Chris0Jeky left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent adversarial review — exact-head operational truth

Exact head: 161638cf80a4b7d6116cf08a7b5cd8c61e1ec2e4.

CRITICAL

None.

HIGH

None.

MEDIUM

None.

LOW

  1. Narrow the live #1476 tracker now that this PR adds partial agent-hook CI coverage — GitHub issue #1476.

The source docs are now accurate, but the durable tracker itself still says scripts/agent_hooks has zero CI coverage, no automated gate whatsoever, and that searching .github/ finds no agent_hooks references. At this exact head, Required Docs Governance runs test_render_failure_ledger.py; only the configured-handler smoke_test.py / deny-floor matrix remains ungated. Leaving #1476 unchanged gives future agents a false current-state premise and can cause them to duplicate the renderer gate while triaging the real smoke/configuration gap.

Expected fix: update #1476's title and opening/current-state text to distinguish the newly gated renderer synchronization suite from the still-ungated configured-handler/deny-floor smoke matrix. Keep #1476 open for that remaining work; no source change is required for this metadata-only correction.

Exact-head evidence

  • Read all 26 current conversation items, all five submitted reviews, and both resolved inline threads, including review 4781131779, fix map 5082405095, and the exact-head Codex no-major-issues notice.
  • The three findings in 4781131779 are fixed in source: STATUS narrows #1476 correctly; Python 3.14-shaped denied reads return 1 and preserve the sentinel; TESTING_GUIDE now has the exact 2026-07-26 date.
  • Python 3.14 and 3.13 focused suites each passed 11/11. Malformed/non-object probes returned 1 and preserved the target. The drop-all mutation failed 2/11 as intended. A temporary stale-Markdown control failed exactly the synchronization assertion.
  • Raw JSONL is a byte-prefix append of the 19-row base plus four rows; the 23 raw rows project to 15 (14 resolved / one open), seed stays raw-only, and invalid_signal / ci/e2e-smoke remains the sole open projection. The checked-in Markdown equals the exact HEAD render.
  • YAML parsed; Required CI calls the reusable docs workflow. Hosted job Docs Governance / Docs Governance completed successfully with Setup Python → synchronization test → three governance checks in that order. Exact-head CI Extended and Workflow Lint are green.
  • All three local governance checks and hook smoke passed. Scope is exactly eight files, JSONL numstat is 4/0, git diff --check passed, DCO trailers are present 6/6, and local/remote head remained exact and clean.

NOT verified / residual risk

  • Required CI run 30191454890 was still in progress because its Windows API integration job had not completed at review time; this review does not claim the whole run green.
  • No backend/frontend/full E2E suite was rerun locally because product runtime code did not change.
  • The denied-read regression uses the deliberate Python 3.14-shaped mock seam rather than changing real Windows ACLs.

This LOW finding blocks merge under the repository's all-severity review policy until the existing tracker metadata is corrected and mapped back here.

Copy link
Copy Markdown
Owner Author

Formal exact-head review 4781149104 is fully addressed without changing PR head 161638cf80a4b7d6116cf08a7b5cd8c61e1ec2e4.

@Chris0Jeky Chris0Jeky left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent adversarial review — final exact-head operational/provenance verdict

Exact head: 161638cf80a4b7d6116cf08a7b5cd8c61e1ec2e4.

CRITICAL

None.

HIGH

None.

MEDIUM

None.

LOW

  1. Live #1476 tracker overstated the remaining CI gap — resolved during this review.

At the start of this exact-head review, #1476 still claimed that scripts/agent_hooks had zero/no CI coverage even though this PR makes Required Docs Governance run the failure-ledger synchronization suite. The accurate residual is the configured-handler smoke_test.py / deny-floor matrix.

Resolution verified: without changing the PR head, #1476 was updated at 2026-07-26T06:50:22Z to “Gate configured-handler hook smoke matrix in Required CI.” Its current body distinguishes the renderer gate delivered here, keeps the remaining smoke/configuration work open, depends on #1487's launcher contract, and contains concrete acceptance criteria. No source change is required and no LOW finding remains open.

Exact-head evidence

  • Re-read the complete eight-file diff and the pre-submission live feedback set: 28 merged conversation items, six submitted reviews, and both inline threads resolved. This includes operational review 4781131779, its fix map 5082405095, exact-head review 4781149104, and resolution map 5082426644.
  • Independently confirmed all three findings from review 4781131779 are fixed: STATUS precisely narrows #1476; denied reads fail nonzero while preserving the target; TESTING_GUIDE carries the exact 2026-07-26 date.
  • Python 3.14 and 3.13 focused suites each passed 11/11. The real hook smoke matrix passed with the Python 3.14 path prepared. Independent denied-read probes on both runtimes returned 1, preserved the target, and named the inaccessible source. The stale-projection and drop-all-rows controls failed as intended.
  • Raw JSONL is a byte-for-byte prefix-preserving append: 19 rows / 10,171 bytes at base to 23 rows / 12,759 bytes at head, with four additions and no deletions. Projection is 15 rows (14 resolved, one open); seed remains raw-only; invalid_signal / ci/e2e-smoke remains the sole open projection. Each of #1343, #1347, #1348, and #1490 has one latest resolved record.
  • The checked-in Markdown equals a fresh render; Windows file SHA-256 is 52C4CBC17BC401AC41B3DA50A4CBA9A3AB95AA5AEA52A857DC492FD6EF8E4B7B.
  • Live provenance matches the ledger: #1343/#1347/#1348/#1490 are closed-completed; #1388/#1410 remain open; PRs #1386/#1360/#1361/#1362/#1491 are merged at the five cited merge SHAs, and each SHA is an ancestor of this exact head.
  • Required CI's hosted Docs Governance job passed with Setup Python then Validate failure ledger projection synchronization then all three governance checks. Local docs, Golden Principles, and GitHub-operations governance checks, hook smoke, and git diff --check passed.
  • Scope is exactly eight files, JSONL numstat is 4/0, DCO is 6/6, and the worktree is clean at the remote head.
  • Live closing metadata contains exactly #1492; #1492 and parent #1291 are both open before merge. The #1492 issue and PR project items are each Review / Priority II.
  • Draft PR #1488 remains open at 34c163c30ebf7e2594ac7d29a61f2bcf3c727f95 and overlaps five files here; it must absorb current main and regenerate/reverify after this PR lands.

NOT verified / residual risk

  • Required CI run 30191454890 is still in progress: its Windows API Integration job is the only unfinished job. CI Extended run 30191455034, CodeQL, Codex, and all other observed Required-CI jobs are green. This review does not claim the full exact-head CI gate is complete.
  • Backend, frontend, and full E2E suites were not rerun locally because no product/runtime code changed.
  • The committed denied-read regression uses a deterministic Python-3.14-shaped mock seam; independent real entry-point probes covered both installed runtimes without altering Windows ACLs.
  • #1476 correctly remains open for the configured-handler smoke matrix, #1388/#1410 remain explicit residuals, and #1291 remains open.

Verdict: no remaining CRITICAL/HIGH/MEDIUM/LOW finding at this exact head. Source, documentation, provenance, metadata, and comment-triage controls are clean. Merge eligibility still requires the pending exact-head Required CI run to finish green.

Copy link
Copy Markdown
Owner Author

Exact-head merge gate — PASS

Head 161638cf80a4b7d6116cf08a7b5cd8c61e1ec2e4 remained unchanged and mergeable against base 61f718af941c56c31b8b7595333b9debd6e47da8.

  • Hosted checks: 36 total check entries — 25 passed, 11 intentionally skipped, 0 pending/failed. Required CI 30191454890, CI Extended 30191455034, and CodeQL are green on this exact head. Required CI includes the new passing ledger synchronization step and final E2E Smoke.
  • Independent review: exact-head reviews 4781149104 and 4781153807 completed. The sole LOW live-tracker finding was fixed in Gate configured-handler hook smoke matrix in Required CI #1476 and mapped in comment 5082426644; the final verdict reports no remaining CRITICAL/HIGH/MEDIUM/LOW findings.
  • Codex and threads: fresh Codex review 5082413357 found no major issue on 161638cf80; all 29 conversation items and seven submitted reviews were swept; both inline threads are resolved.
  • Local evidence: Python 3.14 and 3.13 renderer suites passed 11/11 each; denied-read, malformed/non-object, stale-projection, and drop-all mutation controls behaved as intended; hook smoke and all three governance gates passed; fresh render is byte-identical; git diff --check passed; worktree is clean and equals its remote.
  • Scope and provenance: exactly eight files and six signed-off commits; raw ledger history is prefix-preserving with four appended resolution rows; projection is 15 rows (14 resolved, one intentionally open).
  • Metadata: closing references are exactly Reconcile stale agent failure ledger projections #1492; Adopt agent-harness T3 profile: harness right-sizing plan #1291 remains open. Issue Reconcile stale agent failure ledger projections #1492 and PR Reconcile stale failure ledger projections #1493 are both Review / Priority II. No open child PR targets this branch.

All repository merge conditions hold. Merging by merge commit with the branch retained.

@Chris0Jeky
Chris0Jeky merged commit 6fd3936 into main Jul 26, 2026
36 checks passed
@github-project-automation github-project-automation Bot moved this from Review to Done in Taskdeck Execution Jul 26, 2026
@Chris0Jeky
Chris0Jeky deleted the issue-1492/failure-ledger-reconciliation branch July 31, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Reconcile stale agent failure ledger projections

1 participant