Skip to content

fix(maintenance): prevent report output from overwriting inspected inputs - #175

Merged
lostlight530 merged 3 commits into
mainfrom
fix/2026-10-26-maintenance-report-output-guard
Oct 26, 2026
Merged

lostlight530 merged 3 commits into
mainfrom
fix/2026-10-26-maintenance-report-output-guard

Conversation

@lostlight530

Copy link
Copy Markdown
Owner

Current defect / 当前缺陷

core/maintenance_cadence.py currently writes its report directly to the caller's --output path. If that path already names maintenance/cadence.yaml, MANIFEST.yaml, or another existing input, it silently destroys that file while the report asserts inspected_files_mutated: false

Minimal correction

  • Refuse to overwrite an existing file unless its content is an actual previously generated same-repository maintenance report with expected profile, cadence, SHA-256 config identity and maintenance-boundary structure
  • Continue to allow creation of a new report path and repeat writes to an existing valid report
  • Add subprocess regression against config, Manifest and unrelated JSON files, plus repeat-run success
  • Update only the active Maintenance Cadence contract, no historical backfill, timestamp refresh, or broad refactor

Evidence and limits

  • Base SHA: d032368056b582dd0b265e02264d0cc89c6da4c3
  • Head SHA: 4cb237f805ddcab91fad21a308e7e2a5a672643e
  • Before: isolated execution of the exact prior write branch replaces config bytes while report claims no inspected mutation
  • Targeted existing source and contract review: EXECUTED
  • Native checker/test execution locally: NOT_EXECUTED due unavailable authorized host and GitHub DNS in local container
  • Pull-request smoke CI: to be observed on exact PR head, not assumed
  • Fresh comparison at PR preparation: ahead=3, behind=0, exactly core/maintenance_cadence.py, tests/test_tool_cli.py, docs/03-maintenance-and-audit/MAINTENANCE_CADENCE.md

Delivery gate

READY_FOR_MAINTAINER_REVIEW after CI result and independent review. Remain Draft. No direct main write, force push, auto-merge or maintenance-producer self-merge

Copy link
Copy Markdown
Owner Author

Maintenance verification receipt — Asia/Shanghai 2026-10-26

  • REMOTE_STATE_VERIFIED current main / PR base = d032368056b582dd0b265e02264d0cc89c6da4c3
  • Exact PR head = 4cb237f805ddcab91fad21a308e7e2a5a672643e, ahead=3, behind=0
  • Exact changed files: core/maintenance_cadence.py, tests/test_tool_cli.py, docs/03-maintenance-and-audit/MAINTENANCE_CADENCE.md
  • STATIC_SOURCE_REVIEW reviewed the scanner write path, current cadence control, and the active documentation, excluding archived research
  • TEST_EXECUTED (GitHub Actions) https://github.com/lostlight530/sci-render-kit/actions/runs/40246047122 — completed / success; exact PR revision checkout, unittest tests.test_tool_cli, full native make test, catalog generation all succeeded
  • Runner log explicitly confirms test_maintenance_report_output_cannot_overwrite_inspected_files ... ok: config, Manifest and unrelated JSON unchanged after rejected collisions; new and existing valid maintenance report outputs succeeded
  • ISOLATED_REPRODUCTION the original write branch was executed locally against a disposable configuration, demonstrating overwrite while declaring inspected_files_mutated: false; not an original-repo checkout
  • CHECKER_EXECUTED native checker on the full current repository: NOT_EXECUTED; fixture subprocess was executed inside CI only
  • RUNTIME_EXECUTED scientific/render/provenance validity workflows: NOT_EXECUTED
  • Local full checkout / local native tests: NOT_EXECUTED (remote host offline, local GitHub DNS unavailable)
  • Submitted independent review: 0 / NOT_EXECUTED
  • READY_FOR_MAINTAINER_REVIEW; remain Draft, no producer merge, no auto-merge, no direct main write; independent reviewer must redo exact-head freshness and policy checks before any authorized merger

@lostlight530
lostlight530 marked this pull request as ready for review October 26, 2026 03:29
@lostlight530
lostlight530 merged commit 58f6dbb into main Oct 26, 2026
1 check passed
@lostlight530
lostlight530 deleted the fix/2026-10-26-maintenance-report-output-guard branch October 26, 2026 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant