Skip to content

refactor(C2): relocate resource facade and split evidence layout - #458

Open
Dong1017 wants to merge 2 commits into
mainfrom
impl/c2-resources-t376
Open

Dong1017 wants to merge 2 commits into
mainfrom
impl/c2-resources-t376

Conversation

@Dong1017

Copy link
Copy Markdown
Collaborator

Scope

Refs #451 — C2 in the accepted eight-PR sequence; this does not close the issue.

  • Move the byte-identical neutral pack reader to resources/repository_packs.py, with an import-free parent, one shared seven-entry REPO_TYPES object, and the unchanged files("inferrsi").joinpath("harness", "data", "repo_packs", ...) anchor. Pack data stays with its current owner; no Harness/core import or new mandatory dependency.
  • Split pure evidence paths into contracts/evidence.py and directory creation into apps/evidence_layout.py, preserving signatures, order, errors, and mkdir behaviour. Retire both old root modules in this PR, without shells or aliases; update active consumers and negative import/pickle checks.
  • Shrink the exact tracked-root guard from 23 to 21 and retain its negative controls and wheel-only generated-version allowance. Preserve C1's single RunSpec initialization/identity and no-IO invariants.
  • Relock the manifest's exact relocated leaf/module/file/SHA/import/shape/parent constraints and two importer targets; retain all nine staged compatibility pairs. The manifest description, base/revision provenance and canonical-route notes are updated too. Formal architecture review of this relock is required and has not been obtained or self-approved.
  • Independently update CHANGELOG.md, docs/architecture.md, docs/module-layout.md, and docs/contracts/current-design.md, including the retirement/pickle notice and staged/final-boundary distinction. Historical/frozen evidence is not rewritten.

R1's eleven old-entry retirements and permanent exact inspection rule are not implemented here; neither are A/M or later loader work. Existing staged isolation blockers remain, rather than prematurely asserting the final gate is clear. The older architecture data block and SVG were not expanded into a separate cleanup.

Independent validation

The tested source checkpoint is 23fc2a2ad21d4d9600780aa20daed2ebc9fb7eba; the final commit is documentation-only, and all 20 tested source/test/manifest path bytes were independently verified unchanged after documentation completion.

  • Ten focused pytest modules: 199 passed + 108 subtests, exit 0 (test_contracts_package, test_evidence_paths, test_first_wave_isolation_policy, test_knowledge_compatibility_shells, test_module_boundaries, test_package_root_inventory, test_repository_packs_facade, test_resource_migration, test_smoke, test_target_module_import_gate).
  • Changed Python files: Ruff zero findings, exit 0. This is not a claim that the full repository suite or repository-wide lint is green; the four existing run_store.py F811 diagnostics are outside this change.
  • Separate semantic checks: 65 vectors, seven packs, 954 source-owned resource files byte-compared, consumer tuple identity, cold facade no-core/no-business-IO with positive controls, path/error/IO split, retired imports and old function-pickle negatives, canonical pickle roundtrips, exact root21, precise manifest/closure rules. PASS.
  • Real SCM sdist -> wheel -> standard installation in a fresh venv, executed outside the checkout: unchanged full tests/check_installed.py, installed C2 semantics and distribution/version-origin checks all exit 0. 929 applicable installed resource files match the baseline bytes; all seven packs, identity/no-core/no-IO/path vectors pass.
  • Wheel tested: 0.1.11.dev18+g23fc2a2ad; SHA-256 74cb649250138a580ee90205b6792990f6dacaf6ca4930f7f1037eeccf2b32e3. This artifact belongs to the source checkpoint above, not a rebuild of the later docs-only head.

Preserved environment failures: the first coordinator helper used the Windows default GBK decoder for UTF-8 JSON; only the outside-repository helper encoding was corrected. The first fresh no-deps venv full installed check lacked the project's already-declared optional [skills] dependency PyYAML>=6.0; installing that dependency in that venv made the unchanged checker pass. Original failed receipts remain. No checker bypass, global configuration change, dependency-policy change or repeated broad build/test run was used.

Git/main and authorship

Base main is cd8fcb452bd2c7969a7a6e2544aa1cb5f8ad5332 (merged PR453, with #450 already in its ancestry), freshly fetched before delivery and unchanged. This branch contains the normal source checkpoint plus one normal documentation commit; no history rewrite or additional merge was necessary.

All material changed product/source/test/manifest and documentation content is from the original Claude Code Fable session. Local provenance review replayed successful tool mutations for all 20 source/test/manifest paths from the base (ordinary Git LF/CRLF normalization only). The final four documents were independently written by that same session using Read/Edit only and replay-verified against their saved originals. An unused coordinator documentation draft stayed outside the checkout and was never supplied to the session or applied. The coordinator scoped the task, independently validated/read the results, and performed Git/PR metadata operations; it did not rewrite the product/docs content. No governance exception is sought.

The following model/effort values are the explicitly requested/reported client settings, not independent backend attestation.

{"schema_version":1,"head_sha":"def0557ff99ddc804a7084710003eb5a80b7e04b","human_only":false,"material_ai_authors":[{"tool":"Claude Code","model_id":"claude-fable-5-2","effort":"max","role":"author"}]}

Formal architecture/content review and the normal CI/review gates remain pending. No auto-merge or issue closure is requested.

Agent-assisted-by: Claude Code (author)
Signed-off-by: GUOGUO <xwdong1998@163.com>
Agent-assisted-by: Claude Code (author)
Signed-off-by: GUOGUO <xwdong1998@163.com>
@Dong1017 Dong1017 added the kind:task Bounded delivery task with a delegated slice label Nov 15, 2026

@amy-why-3459 amy-why-3459 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

PR review verdict — PASS
Reviewed base cd8fcb452bd2c7969a7a6e2544aa1cb5f8ad5332 and head def0557ff99ddc804a7084710003eb5a80b7e04b (source checkpoint 23fc2a2ad21d4d9600780aa20daed2ebc9fb7eba, then the docs-only commit).

This also covers the formal architecture review of the docs/legacy-knowledge-manifest.json C2 relock requested in #451:

  • src/inferrsi/resources/repository_packs.py is byte-identical to the retired root _repo_pack_data.py. SHA-256 751d7bf663318962a2e73cf9d75369e0f8f8c2bda27964c56e44021b9f86c992 matches technical_leaf.file_sha256 and both sides of module_path_revision.
  • The leaf module/file, neutral_leaf_export, and the catalog / infra.inspection pair targets all point at inferrsi.resources.repository_packs. The nine-pair count is unchanged, and no pair remains on inferrsi._repo_pack_data.
  • The importlib anchor, allowed imports, two symbols, and REPO_TYPES object identity across catalog, knowledge.catalog, and arguments are preserved. resources/__init__.py is import-free. contracts.evidence only builds paths; ensure_evidence_layout lives in apps.evidence_layout with the same mkdir(parents=True, exist_ok=True) call. The two old root modules are gone with no alias, and the exact root inventory shrinks 23 → 21.
  • Hosted CI on this head is green, including full-check and installed-package on 3.10 and 3.11. I did not independently re-run the author's outside-checkout wheel install.

No blocking findings. The issue stays open, as this PR does not close #451.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:task Bounded delivery task with a delegated slice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants