Skip to content

fix(verification): reject symlinked source parent directories - #248

Merged
LIghtJUNction merged 1 commit into
mainfrom
fix/source-fingerprint-symlink-parents
Nov 20, 2026
Merged

LIghtJUNction merged 1 commit into
mainfrom
fix/source-fingerprint-symlink-parents

Conversation

@LIghtJUNction

@LIghtJUNction LIghtJUNction commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Problem

content_fingerprint records leaf symlinks without following them, but a tracked directory replaced by a symlink is still traversed when reading its tracked children. This can fingerprint files outside the checkout as verified source, contradicting the verifier's no-follow contract.

Change

  • Check parent components from the checkout outward before inspecting or reading a source entry.
  • Reject symlinked parents while preserving existing leaf-symlink recording and clean gitlink handling.
  • Add shallow/nested regressions that fail if file content is read, plus a real Git checkout regression for a tracked directory replaced by a symlink.

This is a static checkout guard, not a claim of race-proof traversal under concurrent hostile filesystem changes. No production access, credentials, deployment, or security settings changed.

Verification

  • Before fix: 2 new focused regression cases failed by observing external-file read attempts; 17 existing cases passed.
  • After fix: 49 standalone local-verification and CI-shard tests passed using Python 3.12, pytest --noconftest -c /dev/null tests/test_local_verification.py tests/test_ci_shards.py -q.
  • Ruff 0.16.9 check and format-check on both changed files passed.
  • Warnings-as-errors compilation of both changed files and git diff --check passed.
  • Full application tests were not run: this environment is Python 3.12, while MSG requires 3.15; repository conftest imports 3.15-only syntax. The standalone tooling tests do not need application fixtures.
  • Repository-wide Ruff/format remain blocked only by the existing deploy/check_home_seo.py issues already fixed independently in fix(ci): stabilize Python 3.15 quality and recovery checks #247. This PR deliberately does not duplicate that change.

Base: a97c9c40f08bb19846166fc057a2ae0dff2a81e6. Full CI is pending; keep draft.

Maintenance validation — 2026-11-20

Revalidated fixed head 9946bc819ceff2ffdddabf5edbe7bc5ad76887d3 for the authorized PR cleanup. The four executed Python source/test files were read from GitHub and their Git blob hashes verified before testing. With Python 3.12.14 and pytest 8.4.2, the unchanged standalone tooling suite passed 49/49 in 1.82 seconds:

PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python3 -m pytest --noconftest -c /dev/null tests/test_local_verification.py tests/test_ci_shards.py -q

The first preparation attempt omitted the repository pyproject.toml: 48 passed and one setup case failed with FileNotFoundError. Adding that exact repository input yielded the complete pass above; neither source nor assertions changed. Current main 527dd3d4d7c8d66c09deb77f4910f5000c618fef only adds README work after this PR's base, and the unaffected shard source/test blobs match exactly. This validates the isolated verification tooling, not the Python 3.15 application or production deployment. Per the current local-validation policy, no remote workflow was dispatched or awaited.

Copy link
Copy Markdown
Member Author

本 PR 正文中的“Full CI is pending”已有结果:head 9946bc819ceff2ffdddabf5edbe7bc5ad76887d3 的 9 个 workflow run 均已结束,8 个 success,仅 Python quality failure。

已核对 quality artifact 的 source manifest(PR 合成提交 51cd4fcb4ec1b3bbbe319e308fe380b262e655b2)和 Ruff JSON:三条错误全在本 PR 未修改的 deploy/check_home_seo.py,分别是 I001、B007、B904。contracts、recovery 和 issue recovery 已通过。

这项基线修复由 #247 跟踪,不应在这里重复实现。下一步是处理该依赖后更新分支,核验新的组合提交;保留 draft。本次只复核既有 CI 产物,没有重跑或改代码。

@LIghtJUNction
LIghtJUNction marked this pull request as ready for review November 20, 2026 13:09
@LIghtJUNction
LIghtJUNction merged commit c71a41d into main Nov 20, 2026
16 of 17 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-20T13:12:50.380331Z 9946bc8 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

LIghtJUNction added a commit that referenced this pull request Nov 20, 2026
… ci]

Preserve PR #248 fingerprint boundary changes. The combined tree passed all 48 recovery, live-agent-space and internet tests against an isolated disk-backed PostgreSQL cluster.
LIghtJUNction added a commit that referenced this pull request Nov 20, 2026
…n [skip ci]

Source tree bf8a2d0 passed 48 real isolated PostgreSQL recovery/live-space/internet tests, Ruff, formatting and warnings-as-errors compilation. Preserve #248 and the original dependency lock. No deployment or release.
LIghtJUNction added a commit that referenced this pull request Nov 20, 2026
…n [skip ci]

Source tree bf8a2d0 passed 48 real isolated PostgreSQL recovery/live-space/internet tests, Ruff, formatting and warnings-as-errors compilation. Preserve #248 and the original dependency lock. No deployment or release.
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