Skip to content

feat(readme): apply only a hash-bound approved README proposal - #232

Merged
drevendev merged 6 commits into
masterfrom
beautifulrepo/readme-apply-approved-20261101
Nov 1, 2026
Merged

drevendev merged 6 commits into
masterfrom
beautifulrepo/readme-apply-approved-20261101

Conversation

@drevendev

@drevendev drevendev commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Reader-facing outcome

Complete the local README edit-after-explicit-approval step in the existing improve-readme workflow (#70), without making the read-only preview tool writable.

  • New dependency-free tools/readme_apply.py takes an existing target README and an outside-checkout candidate plus the two exact SHA-256 values from the separately approved preview. It refuses missing/stale hashes, invalid/symlinked inputs and untrusted display controls, and replaces only README.md via a temporary sibling on an ordinary local filesystem.
  • Preserve candidate bytes (including CRLF/BOM) and POSIX mode bits; clean up temporary file after ordinary errors.
  • Ten isolated, black-box regressions cover missing approval hashes, success/no-op, stale source/candidate, invalid UTF-8/controls, symlinks, checkout-local candidate rejection, byte fidelity, and not executing target code.
  • Document the separate human explicit yes to the exact diff and file list, the helper's scope, and the required read-only audits before and after.

Important: Hash arguments only bind to approved bytes; they do not authenticate or infer consent. This helper must be invoked only after the agent has obtained separate explicit approval, as the skill specifies. It does not execute target scripts, commit, push, validate claims or prove model safety. Atomic replacement on an ordinary local filesystem is not protection against a concurrently hostile filesystem or crash durability.

Validation

  • Local focused python -m unittest discover -s tests -v: 10 new tests passed in a minimal local working copy using the current preview helper's input guards. This is not a full checked-out repository test.
  • Exact-head Quality CI #41337354195 on cbeaaee2332d1e8ebd3a5206da625e4ac1aeb44b: all six jobs passed (Linux Python 3.11/3.14, Windows Python 3.14, lint and both Action self-tests). The first run failed on Windows because the test fixture used write_text() and expected LF bytes; corrected the fixture to use write_bytes() without changing the implementation. Full local repository tests still not run.
  • No external repository README was edited. This is the production step, not separate later-run acceptance or permission to merge.

Related: #70. The issue remains open until actual post-consent agent behavior, before/after results and model evaluations are demonstrated.

@drevendev drevendev 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.

Exact-head review — cbeaaee2332d1e8ebd3a5206da625e4ac1aeb44b

Content judgement: no blocking defect identified within the documented local-filesystem contract. This is a COMMENT, not an independent approval: the authenticated reviewing account and PR author are both drevendev. A distinct authorized reviewer is still needed if actor-separated approval is the acceptance gate.

I inspected the five-file patch, the current tools/readme_apply.py and its dependency tools/readme_preview.py, the improve-readme skill, #70, repository instructions, and the existing review/discussion state (none on this PR). In the proposed implementation:

  • Both current and proposed byte hashes must match the separately approved preview; missing/malformed/stale hashes fail before a write. read_file also bounds size and rejects symlinked/non-regular, invalid UTF-8, bare-CR and unsafe-display inputs.
  • The candidate is required to resolve outside the target checkout. The tool writes a temporary sibling, flushes/fsyncs it, copies the existing POSIX mode bits, re-reads the current README, then replaces only README.md. Ordinary error handling removes the temporary file; the candidate remains intact.
  • skills/improve-readme/SKILL.md still requires an explicit human yes to the actual file list and displayed diff before invocation, followed by the three read-only before/after checks. SHA-256 arguments alone do not establish consent, and the documentation does not claim otherwise.
  • Ten new black-box tests cover successful application, exact-byte preservation, stale-input refusal, no-op, input restrictions, symlinks, and non-execution of target code. The changelog and tool documentation are updated.

Verification evidence: Quality CI #41337354195 completed successfully on this head: 6/6 jobs. Hosted Python suites report 547 tests each (6 skipped on Linux Python 3.11, 6 on Linux Python 3.14, 2 on Windows Python 3.14), alongside successful lint and both Action self-tests. I inspected source and hosted job logs; I did not independently run the repository suite or a real target-repository edit.

Scope limits: This establishes content/source and hosted-regression evidence, not a model-driven proof of user consent or a real post-consent edit/re-audit. The helper explicitly does not defend against hostile concurrent filesystem changes or guarantee crash durability. Keep #70 open for the remaining end-to-end/model evaluation; do not promote this same-actor review to a formal independent approval.

@andy-zen-dev andy-zen-dev 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.

Independent exact-head assessment: cbeaaee2332d1e8ebd3a5206da625e4ac1aeb44b (PR #232, Related: #70).

I inspected all five changed files, including the actual readme_apply.py control flow and black-box tests, the existing readme_preview.py file guards, the improve-readme skill, AGENTS.md, CONTRIBUTING.md, linked issue #70, and prior discussion/review state.

The bounded implementation matches its declared contract: it validates both explicitly supplied SHA-256 digests against bounded regular UTF-8 files, refuses stale source/candidate or checkout-local proposal paths, stages a sibling file and rechecks the original bytes before replacing only README.md. The candidate remains intact, POSIX permission bits are copied, no target code runs, and tests cover happy path, stale inputs, display controls, symlinks, byte fidelity, and no-op. The skill explicitly requires a separate human approval of the exact file list and displayed diff: hash possession is not consent. The documentation and Unreleased changelog state the limitations without treating the remaining #70 acceptance criteria as complete.

CI on this exact head: Quality checks run #41337354195 passed, with all six jobs passed (Linux Python 3.11/3.14, Windows Python 3.14, both Action self-tests, Lint). Separate commit statuses: unavailable / none returned. Independent local repository suite and actual post-consent target-repository edit/re-audit: not_run. The helper does not guarantee safety against concurrent hostile filesystem mutation or crash durability; neither is claimed.

No merge-blocking defect found within that explicitly limited contract. APPROVE applies to this change only, not end-to-end/model-driven completion of Issue #70.

@drevendev
drevendev merged commit 7e32bd1 into master Nov 1, 2026
6 checks passed
@drevendev
drevendev deleted the beautifulrepo/readme-apply-approved-20261101 branch November 1, 2026 19:25
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.

2 participants