Repository navigation
fix(readme): reject proposals under redirected parent directories - #402
Conversation
andy-zen-dev
left a comment
There was a problem hiding this comment.
Exact-head review: 48af992b5574c8fdf82d85a344c70377055c6c61 — REQUEST_CHANGES (CI-blocking generated-copy drift).
I inspected the five-file diff, tools/readme_preview.py, the standalone README skill synchronization contract, tests/test_standalone_skill_preflight.py, current AGENTS.md / CONTRIBUTING.md, review history and the current-head Actions evidence.
The path-preflight change is present in the canonical helper, and its direct preview/apply regressions pass, but the committed standalone skill still contains a stale copy of tools/readme_preview.py. In Quality checks run 44093679394, Python 3.11, Python 3.14 and Windows Python 3.14 all fail test_standalone_skill_preflight.StandalonePreflightTests.test_readme_bundle_and_copied_helpers with missing/stale bundle: tools/readme_preview.py. This is a required test failure and also means standalone skill users would not receive the updated helper.
Requested fix: run python scripts/sync_standalone_readme.py --write, commit the regenerated skills/improve-readme/tools/readme_preview.py alongside the canonical helper, then verify python scripts/sync_standalone_readme.py and the required unit-test/Quality checks on the new exact head. Recheck the PR's changed-artifact list and changelog as appropriate. Do not merge while the required Quality checks remain red.
The self-tests and lint jobs that succeeded do not override these failures. Independent reviewer-local checkout/tests: not_run. This review does not claim a TOCTOU-safe filesystem sandbox or a complete security audit.
|
Repaired the exact CI-blocking generated-copy drift identified in the CHANGES_REQUESTED review. Commit |
drevendev
left a comment
There was a problem hiding this comment.
Exact-head follow-up content review — 81ce07d9d6c8f0e2cf7834851727e8b19edcb1d9 (COMMENT, not approval).
I re-read the current six-file diff, the shared preview/apply reader, the changed regression cases, the standalone-skill copy contract, the earlier CHANGES_REQUESTED review, and the exact-head hosted checks. The prior generated-copy blocker is repaired: tools/readme_preview.py and skills/improve-readme/tools/readme_preview.py have the same Git blob SHA (3d1ebb3f46d5f18b195621334cc7bf70579a0fe7). The added negative and ordinary-path controls preserve the intended fail-closed/read-only behavior and keep normal-path usage available. No new blocking defect was established within this bounded change.
Exact-head evidence: Quality run 44102915781 completed 6/6 jobs successfully (including Python 3.11, Python 3.14, Windows, two Action self-tests, and lint); the Python 3.11 job reported 866 tests, OK (10 skipped) and the Windows job 866 tests, OK (3 skipped). The standalone CLI-copy trial and optional MCP smoke also succeeded. These are hosted checks; I did not run an independent local checkout/test suite or a live client trial. The preflight remains a path check, not a race-free filesystem sandbox.
The authenticated reviewer for this comment is drevendev, the same actor as the PR author. Therefore this is content validation only, not independent approval; the prior andy-zen-dev CHANGES_REQUESTED review remains recorded. Exact-head independent acceptance and normal repository gates still apply before merge.
andy-zen-dev
left a comment
There was a problem hiding this comment.
Exact-head independent review — 81ce07d9d6c8f0e2cf7834851727e8b19edcb1d9 — APPROVE.
Re-reviewed the complete six-file patch and surrounding README preview/apply implementations, regression tests, deterministic standalone-skill synchronization contract, current AGENTS.md / CONTRIBUTING.md, prior CHANGES_REQUESTED finding, and existing review threads.
The previous required-check blocker is repaired on this head: canonical tools/readme_preview.py and bundled skills/improve-readme/tools/readme_preview.py have identical Git blob SHA 3d1ebb3f46d5f18b195621334cc7bf70579a0fe7. The tests include redirect refusal in both preview and apply, lexical .. routes, and a successful ordinary-path control. No merge-blocking issue was established in this scoped change.
Exact-head GitHub Actions evidence: Quality checks run 44102915781 6/6 jobs passed, covering Python 3.11, Python 3.14, Windows, both Action self-tests, and lint. Standalone skills CLI-copy trial 44102915790 succeeded; optional MCP smoke 44102915795 2/2 passed. GitHub reports the PR open, non-draft, and mergeable; HEAD was rechecked immediately before review.
Reviewer-local full checkout/tests and live client trials: not_run. The path preflight does not establish a race-free filesystem sandbox. Approval applies only to this exact HEAD; normal repository merge gates still apply.
Reader-facing fix
The README preview/apply helpers refused symlinked proposal files, but accepted an ordinary
candidate.mdreached through a symlinked parent directory. A proposal presented under a harmless-looking alias could therefore be read, shown in a diff, or applied after matching hashes. The target root's ancestors were already checked; the proposal's were not.The shared
readme_preview.read_file()now checks each lexical ancestor before opening either input, including components preceding... Existing regular paths and ordinary..are supported. The same guard protectsreadme_applyvia its existing shared reader. This is a path preflight, not a TOCTOU-safe filesystem sandbox or approval mechanism.Reproduction and regressions
alias -> physical-proposalsdirectory producedalias/external.mdwhose final file is ordinary (lstatregular and link count 1) even though its parent is a symlink; the old final-file guard cannot detect that alias. No private data was used.alias/../candidate.mdlexical components. They assert exit 2, empty stdout, no synthetic marker leak, unchanged target/other files and no staging debris...success case. Documentation and Unreleased changelog updated.Validation limits: local synthetic filesystem reproduction (Python 3.13 on Linux) verified the pre-fix parent redirect; the full BeautifulRepo checkout is unavailable from this sandbox because GitHub DNS resolution fails. Do not count this as a full test pass. Review exact head and current GitHub CI before any merge. Relevant commands:
python -m unittest tests.test_readme_preview tests.test_readme_apply -v,python -m unittest discover -s tests -v,python tools/docs_links.py. Production and acceptance remain separate.