Skip to content

prototype: reduce knowledge projection and declaration churn - #359

Merged
Dong1017 merged 7 commits into
mainfrom
codex/issue355-knowledge-workflow
Nov 10, 2026
Merged

Dong1017 merged 7 commits into
mainfrom
codex/issue355-knowledge-workflow

Conversation

@Dong1017

@Dong1017 Dong1017 commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #355

What this changes

This implements the representation accepted in the #355 design decision, after the reader landed in #360.

  • One shared knowledge/_provenance.json stores the full source revision and the registry hash. Generated skill records are stored as schema 2 and keep only their own fields and resource hashes.
  • inferrsi.catalog resolves each stored record into a public schema-1 record with the same fields and order: the sources entry with the full commit URL, and source_files including the registry hash. Search, knowledge show, Collect and installed wheels keep reading schema 1. The generator refuses to write a record that does not resolve back to the record it rendered.
  • tools/knowledge_declaration_paths.py (read-only) lists the head SHA and the protected, policy, generated and other paths under the target branch's policy, including deletions and both rename endpoints. It never supplies an author, model, effort or exception.
  • Contributor workflow: what authors write versus what tools derive, the four commands, the stored format and the limits. contributing.md, knowledge-base.md and skill-eval-pr.md point to it.

No canonical skill, matrix, coverage view, ranking, policy or workflow changes.

Commits

Commit Content
4260fc75 Reverts the earlier prototype d1d64da1; the tree equals its base. The prototype stays in branch history
e9a4b69a Merges main 56c50036; the tree equals main
f6762d7f The implementation, tests, docs and the one-time migration of 80 records from the already-pinned revision d648f257
0241800e Re-pins the snapshot to 56c50036, the squash commit on main with identical skill-library bytes. Only _provenance.json changes
b9851bf9 Fixes the two tests that failed on hosted full-check: the divergent-edit merge now uses the fixture's Git identity (runners have none), and the coverage-view test passes a full-length revision to the strict snapshot. States in the docs that the helper's path lists overlap
dfae5ed5 Docs only: the Stored-format paragraph now records the pin move from d648f257 to 56c50036 and that only sources[0].commit and sources[0].url change in resolved records

0241800e is itself the smallest example of the new cost: changing the snapshot revision now touches 1 file instead of 82.

Measured contribution cost

One appended line in performance-ceiling-analysis/SKILL.md, on main 56c50036, regenerated with each generator:

Before (main) This PR
Generated files changed 82 3
Skill records changed 80 1
Other generated files README, coverage view _provenance.json, coverage view

The coverage view changes in both cases because it hashes the edited SKILL.md. These are file counts, not authoring-time or efficacy claims.

Verification

  • Migration: at f6762d7f (pin d648f257), all 80 resolved records are byte-identical to the records on main. 0241800e then changes only source_revision in _provenance.json, so at the head the resolved records differ from main only in sources[0].commit and sources[0].url (now 56c50036); every content hash and the registry hash are unchanged.
  • build_skill_index.py --check (80 records) and build_skill_coverage.py --check pass at the head.
  • 22 new tests (tests/test_source_snapshot.py, tests/test_knowledge_declaration_paths.py) cover: stored schema and resolution for all 80 records; field order; 8 invalid-snapshot and 5 invalid-record cases; a one-skill edit changing only its record and the snapshot; two skills edited on parallel branches and integrated in both orders, keeping both contributions with the third skill's record unchanged; divergent edits to one skill remaining a conflict; --check failing on a tampered or missing snapshot and a tampered record; and the helper's protected, renamed, deleted and policy paths, with the base branch's policy deciding scope.
  • Focused local run (Python 3.13, Windows): 161 passed, 5 skipped across the snapshot, index, catalog CLI, Collect selection, knowledge contract, catalog, library readers, tiers and knowledge CLI suites. ruff check src tests tools and git diff --check pass. The two tests that failed on hosted full-check at 0241800e pass locally at b9851bf9 with no global or system Git identity. Hosted Python 3.10/3.11 full and installed-package checks are the full-suite evidence.
  • Local preflight against main's trusted code: the SkillEval planner from fix: read shared provenance in trusted SkillEval planning #360 returns ready with source revision 56c50036 declared in _provenance.json; the declaration helper reports 84 protected paths (82 generated, catalog.py, knowledge-base.md); and check_knowledge_model_policy.assess returns declaration compliance for this body.

Limits

  • Raw stored records changed from schema 1 to schema 2. Code that reads the generated JSON files directly must go through inferrsi.catalog or inferrsi._source_snapshot.resolve. No such reader exists in src or tools on main.
  • After a squash merge, a snapshot pinned to a branch commit is not an ancestor of main, and Git-backed SkillEval planning reports it as unavailable. This already happened with the previous format. Re-pinning to the squash commit is the one-file repair shown by 0241800e.
  • This PR does not check off trim & improve: reduce knowledge contribution cost and generated-file churn #355's acceptance items or close it.

Knowledge authorship declaration

The design came from the earlier prototype and the accepted #355 decision. That prototype's commit is reverted here, and the code, tests, docs and regenerated records in this PR's diff were written for this rewrite.

{
  "schema_version": 1,
  "head_sha": "dfae5ed5cc45294b8e31229c2f991b843f61a412",
  "human_only": false,
  "material_ai_authors": [
    {
      "tool": "Claude Code",
      "model_id": "claude-opus-5-5",
      "effort": "xhigh",
      "role": "author"
    }
  ]
}

Keep owner projections content-local, resolve the legacy catalog shape at read time, and derive complete declaration paths from trusted-base policy. Include strict provenance validation, compatibility tests and an explicit protected-main squash recovery workflow. Canonical knowledge is unchanged.

This is a design-review prototype, not accepted architecture or knowledge-policy admission. Actual author model and effort are unknown and are not inferred.

Signed-off-by: Codex <codex@openai.com>
Agent-assisted-by: dot / unknown [effort=unknown] (author)
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Skill evaluation

PLANNED: not executed; there are no task outcomes yet.
No approval, model efficacy or current-head test result is implied.

  • Next: run the pinned source/index --check below at head dfae5ed5cc45294b8e31229c2f991b843f61a412.
  • Task selection: no supported automatic comparison; choose a relevant source/content check and disposition uncovered claims.
  • Selected comparisons: 0 · Estimated task calls: 0. Uncovered/unsupported changes: 94; Canonical library paths: 0; Generated projection paths: 82; Other paths: 12. These are paths, not independent claims.
  • Return: command, input/source pin, exit status, outputs/failures and untested claims for independent verified/refuted/unverified disposition.
Author verification steps (nonpaid; not yet run)
  1. Bind the checkout. Run git rev-parse HEAD; it must equal dfae5ed5cc45294b8e31229c2f991b843f61a412. If it differs, obtain a current plan; do not reuse old results.
  2. Check source/index consistency. At that PR checkout, using the reviewed repository tool and its documented development dependencies, run:
python tools/build_skill_index.py --source-revision 56c500367d5495fdd9f0e35030c9cd957f70eac5 --check

The declared source pin matches this head's canonical library bytes. The command has not run: retain its exit code and full drift/success output. It checks the generated projection, not claim truth or skill efficacy.
No supported automatic comparison is selected. Review the canonical changes and explain which claims need evidence, are unaffected, or remain unverified; do not treat generated records as separate behavioral claims.
Uncovered scope by location: Canonical library paths: 0; Generated projection paths: 82; Other paths: 12. Path counts are not claim counts; no metadata-only conclusion is inferred.
3. Return evidence for independent review: head, check/task/source pin, command, environment, exit status, outputs/failures and untested claims. Label scripted controls. Request each claim's disposition: verified, refuted or unverified; this plan proves neither model provenance nor benefit.
Check recipes and evidence limits

Evidence and logs · Retention: 30 days.
Retained artifacts are verifiable only before Unix time 1796894053 while the linked artifact is available. Expired evidence is unverified.

Plan bindings, budget, frozen exam and advisory details

Advisory: obtain missing evidence

Retained evidence availability: planned / unexecuted. No approval or merge authorization is issued.
Applicable only while these revisions and inputs match the current PR.
Paid execution requires trusted label authorization and cumulative PR reservation. Unknown accounting blocks new paid calls; planning is not execution.
Pipeline evidence only; offline fixed outputs do not establish skill efficacy.
Unchanged-correct is valid neutral evidence, not incremental benefit.
Content/source review and authorship admission remain separate.
Trusted regrading checks retained answers, not model/hardware provenance or a hostile executor; this is not an efficacy certification.

  • Retained evidence is planned / unexecuted.
  • No supported comparison cases were selected.
  • Uncovered/unsupported scope needs a case or explicit reviewer disposition.
    Plan SHA-256: 4bbed2c3ec89616460e501ad2add2953a50cd91b4b6c4057cad76405df495f69
    Base: 56c500367d5495fdd9f0e35030c9cd957f70eac5 · Head: dfae5ed5cc45294b8e31229c2f991b843f61a412
    Trusted implementation: d699e570025d768b38528bd620d60b17553996ef

Model/settings: {"effort":"not_applicable","name":"claude-opus-5-5"}
Budget: {"comparisons":0,"estimated_calls":0,"limits_per_comparison":{"campaign_seconds":600,"max_task_calls":2,"repeats":1,"timeout_seconds":180,"token_stop_new_trials":200000},"provider_config_sha256":"b28d80f8194fbe0f5a9f01515efb24b218979fd45f702776560da276f4b30d04","reservation":null}

Skill Comparison Cases Estimated calls

Automatic execution / cumulative PR budget:

{"reason":"Trusted configuration or pricing missing, invalid or expired","remaining_usd":"unknown","reserved_or_unresolved_usd":"unknown","spent_or_legacy_usd":"unknown","state":"blocked"}

Projection check selection (not an executed result):

{"declared_in":"src/inferrsi/data/repo_packs/inferrsi/knowledge/_provenance.json","source_revision":"56c500367d5495fdd9f0e35030c9cd957f70eac5","status":"ready"}

Provider/settings: {"client":{"api_version":"2023-06-01","endpoint":"https://yibuapi.com/v1/messages","kind":"anthropic-messages-full-context-v1","max_output_tokens":4096,"max_read_bytes":32768,"max_request_bytes":262144,"max_requests":1,"max_tool_calls":12,"provider":"yibuapi"},"limits":{"token_stop_new_trials":200000},"model":{"effort":"not_applicable","name":"claude-opus-5-5"},"pricing":{"currency":"USD","expires_at":1793271228,"group":"default","max_input_tokens":1000000,"model":"claude-opus-5-5","rate_evidence":"https://github.com/InferMatrixLab/InferRSI/issues/215#issuecomment-6467531341","rates":{"cache_read":"0.4","cache_write":"10","input":"8","output":"40"},"request_fee":"0","unit":"per_million_tokens"},"spend_limit":{"amount":"200","currency":"USD"}}

Uncovered / unsupported paths (94)
  • uncovered: "docs/contributing.md"
  • uncovered: "docs/knowledge-base.md"
  • uncovered: "docs/knowledge-contribution-workflow.md"
  • uncovered: "docs/skill-eval-pr.md"
  • uncovered: "src/inferrsi/_source_snapshot.py"
  • uncovered: "src/inferrsi/catalog.py"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/README.md"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/_provenance.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/ascend/skills/ascend-aclgraph-capture-replay.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/ascend/skills/ascend-device-health.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/ascend/skills/ascend-distributed-parallel.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/ascend/skills/ascend-graph-mode.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/ascend/skills/ascend-model-adaptation.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/ascend/skills/ascend-operator-profiling.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/ascend/skills/ascend-operator-tuning.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/ascend/skills/ascend-optimization-casebook.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/ascend/skills/ascend-performance-analysis.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/ascend/skills/ascend-video-diffusion-optimization.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/ascend/skills/ascendc-tiling-design.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/ascend/skills/cann-attribution-overlap.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/ascend/skills/torch-npu.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/ascend/skills/torchnpu-device-memory-lifecycle.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/ascend/skills/torchnpu-pinned-host-memory-lifecycle.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/ascend/skills/vllm-ascend.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/assess-serving-preemption.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/assess-split-backward-schedule.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/audit-fixed-workload-claim.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/audit-h3-metal-fasth3-semantics.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/audit-h3-runtime-residency.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/audit-llama-runtime-state.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/audit-recurrent-kv-finalization.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/audit-sd-cpp-residency.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/audit-sglang-diffusion-lifetimes.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/audit-vllm-kv-lifetimes.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/bound-windowed-attention-replay.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/budget-speculative-verification.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/calibrate-serving-simulation.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/cgroup-resource-controls.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/checkpoint-recovery-consistency.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/choose-parallel-training-plan.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/cite-check-downstream-pr.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/claim-contract.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/comfy-ui.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/competitor-scan.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/dcp-async-save-performance.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/dense-performance-evidence.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/diagnose-vllm-admission-pressure.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/diffusers-invocation-state.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/draft-acceptance-issue.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/dwarfstar.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/evaluate-elastic-serving-placement.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/generation-cache-lifecycle.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/host-memory-management.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/host-overhead-optimization.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/husky.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/inference-benchmark-design.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/inference-optimization-casebook.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/kernel-writing-guide.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/kv-tier-management.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/lazy-evaluation-stream-lifetimes.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/lily.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/lithos-metal.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/local-dream.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/mistral-rs.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/mlc-llm.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/mlx-swift-lm.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/npu-skill-factory.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/optimization-search-policy.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/os-process-placement.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/performance-ceiling-analysis.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/plan-activation-residency.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/project-maya.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/pytorch.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/repository-evolution-analysis.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/rsi-evidence.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/skill-evolution-playbook.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/splash.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/storage-io-measurement.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/training-input-pipeline.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/training-resource-budget.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/video-diffusion-optimization.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/vllm-metal.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/common/skills/weight-loading-optimization.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/cuda/skills/audit-afd-p2p-exchanges.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/cuda/skills/audit-flare-session-lifecycle.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/cuda/skills/diagnose-attention-bottlenecks.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/cuda/skills/host-overhead-profiling.json"
  • uncovered: "src/inferrsi/data/repo_packs/inferrsi/knowledge/cuda/skills/reason-hopper-kernels.json"
  • uncovered: "tests/test_knowledge_declaration_paths.py"
  • uncovered: "tests/test_skill_coverage_view.py"
  • uncovered: "tests/test_skill_index.py"
  • uncovered: "tests/test_source_snapshot.py"
  • uncovered: "tools/build_skill_index.py"
  • uncovered: "tools/knowledge_declaration_paths.py"

Copy link
Copy Markdown
Collaborator

Review (independent; COMMENT only — not an approval)

Reviewed range: 01c73521ced6ca760cdfa42c9b937fe985a20d64 .. d1d64da1cbfd594f6fc35d5386c4715028b03526 (PR head tree acb34b23…; 1 commit). Refs #355.

Verdict

Do not Approve / merge while Draft, #355 design acceptance, and protected-path admission remain unresolved.

Blockers

  1. Draft + unresolved trim & improve: reduce knowledge contribution cost and generated-file churn #355 design acceptance — the prototype matches the posted trade-off sketch, but issue acceptance is still open. Please keep Draft until that design is explicitly accepted.
  2. Authorship / knowledge-model policy — the declaration uses model_id/effort = unknown for material AI authors; the PR correctly states this does not satisfy protected-path admission. Hosted knowledge-model-policy is failure on this head (run). Need truthful approved model/effort or a separately approved exception covering the full protected scope (including generated projections). Do not invent authorship.
  3. Not Issue completion — treat this as design/prototype evidence for trim & improve: reduce knowledge contribution cost and generated-file churn #355, not as closing the issue.

Code / design observations (non-blocking if design is accepted later)

  • Shared _provenance.json + catalog v2→v1 resolve looks carefully fail-closed; the contribution helper does not infer authorship; generated paths stay in exception scope.
  • Dual-owner squash / same-owner conflict / tamper tests and installed-wheel v2 checks look aligned with trim & improve: reduce knowledge contribution cost and generated-file churn #355 acceptance intent.
  • The documented squash→non-ancestor pin + repair-PR cost still needs an explicit “accepted / not accepted” design call.
  • On this PR, the trusted-base skill-eval planner correctly cannot select a pin (legacy README pin removed; new planner not yet trusted tip) — expected migration friction, not a silent bypass.

What would unblock Approve later

No approval implied. Canonical skill bodies appear unchanged; this is storage/tooling/migration.

The #355 design decision accepted the shared source-snapshot manifest.
Remove the prototype so the replacement implementation is authored and
declared on its own; the prototype stays in branch history.

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
@Dong1017 Dong1017 added kind:rfc Proposal / design discussion; scope review before build kind:task Bounded delivery task with a delegated slice and removed kind:rfc Proposal / design discussion; scope review before build labels Nov 10, 2026
…shot

Each generated record repeated the repository-wide source commit and registry
hash, so editing one skill rewrote every record. Keep those two values in one
_provenance.json snapshot and store the records as schema 2 with only their own
fields and resource hashes. The catalog resolves them into the unchanged public
schema-1 records, and the generator refuses to write a record that does not
resolve back to what it rendered.

Migrate the 80 records from the already-pinned source revision; every resolved
record is byte-identical to the previous stored record. Add a read-only helper
that lists a PR's protected, policy and generated paths for the authorship
declaration without supplying any author fact, and document the workflow.

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>
The migrated snapshot named the pre-squash branch commit of #325. Point it at
the squash commit on main, which has identical skill-library bytes, so the pin
stays an ancestor after this change lands. Only _provenance.json changes.

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>

Copy link
Copy Markdown
Collaborator

Re-review (independent; COMMENT only — not an approval)

Reviewed range: d1d64da1cbfd594f6fc35d5386c4715028b03526 .. 0241800e6200ae8844ef77e5ba9f6532cf40a727 (revert 4260fc75, merge of main 56c50036, then f6762d7f + 0241800e). Net PR diff checked against base 56c500367d5495fdd9f0e35030c9cd957f70eac5 (93 files: 82 generated projections, _source_snapshot.py, catalog.py, build_skill_index.py, knowledge_declaration_paths.py, docs, 2 new test files).

Earlier findings

Blocking on this head

  1. full-check fails on both Python versions. full-check (3.11) (job) and full-check (3.10) (job) both concluded failure (exit code 1); installed-package, lint-and-smoke and pr-references pass. I can't see the job logs from here, so I can't tell which test fails. The PR text notes the local run was a focused subset on Windows / 3.13; please identify the failing test(s) and fix or explain them. My hunch, unverified: something on main that reads generated knowledge/**/*.json directly (a test or tool outside src/tools) is now seeing schema 2 or the new _provenance.json.
  2. Still Draft. Please mark it ready only after full-check is green.

Code observations (non-blocking, questions)

  • src/inferrsi/catalog.py (the new parts == (_source_snapshot.MANIFEST,) skip): this only skips the manifest at the knowledge root. Is that intentional, i.e. should a stray _provenance.json in a sub-directory fail validation? A one-line test either way would make that explicit.
  • src/inferrsi/catalog.py: the snapshot is loaded once per repo pack and only resolved for records with schema_version == 2. A pack that mixes schema-1 and schema-2 records is then accepted silently. If that is not a supported state, consider rejecting it (or a test showing it's intended for the migration window).
  • src/inferrsi/_source_snapshot.py resolve(): sources[0].paths is built from the sorted merged hashes, so it relies on the v1 paths list having been sorted in the same order. The generator's round-trip check (tools/build_skill_index.py, the resolve(stored, snapshot) != record guard) covers this for generated records, which looks right.
  • tools/knowledge_declaration_paths.py: generated_paths overlap with protected_paths, and other_paths excludes both. That's fine, but please state in the docs that these lists overlap, so nobody sums them.
  • Re-pinning to 56c50036 (a main commit) fixes the non-ancestor problem for this merge. After a squash, the next PR that edits a skill will again pin a branch commit. The limits section says so; just noting the repair path is still manual.

What would unblock Approve

  • full-check green on 3.10 and 3.11 at the current head.
  • Out of Draft.
  • I'll re-review the next head.

No approval implied.

Hosted CI failed two tests. The divergent-edit merge ran without the fixture's
Git identity, so on a runner without a global identity it stopped before any
conflict; every fixture Git call now uses the same identity. The coverage-view
test rendered the index with the placeholder revision "test-source", which the
strict snapshot no longer accepts; it now passes a full-length revision.

Also state in the workflow docs that the helper's path lists overlap.

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>

@cursor cursor Bot 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.

PR review verdict — DO NOT PASS

Reviewed base 56c500367d5495fdd9f0e35030c9cd957f70eac5 and head b9851bf93d762a991c31320e4c27449f176338eb (full base..head diff; pr/prior-reviews.md is empty and no previous head was recorded).

This review does not approve and does not change the issue #355 scope. I will re-read after you push.

Blocker

Public source pin disagrees with the migration contract. resolve() writes sources[0].commit and sources[0].url from the shared snapshot revision (src/inferrsi/_source_snapshot.py, the git source object built in resolve). _provenance.json sets that revision to 56c500367d5495fdd9f0e35030c9cd957f70eac5. On base, every visible record and the generated README pin d648f25732dee1c974da62a94c46a642ad52cef8 (example: knowledge/ascend/skills/ascend-aclgraph-capture-replay.json sources[0].commit; README source-snapshot line removed in this diff).

docs/knowledge-contribution-workflow.md (Stored format, the catalog paragraph) says the migration regenerated all 80 records from the already-pinned source revision, that each resolved record is byte-identical to the previous stored record, and that search, knowledge show, Collect, and installed wheels see no change. With this snapshot, catalog consumers observe commit 56c50036… and blob URLs under that commit. Per-file content digests in the visible records are unchanged, and the registry sha256 7904275c3383380db179287171e1430617aaa9ac4f439291eff8a71426987fbb is only relocated into _provenance.json.

Trigger: catalog.knowledge_records() on any schema-2 skill record.

Correction, either one:

  • Put source_revision back to d648f25732dee1c974da62a94c46a642ad52cef8 and regenerate so resolved sources match the previous public records, or
  • Keep 56c50036… (it is an ancestor of this head, which the old squash pin is documented not to be) and correct the workflow text so it records the pin move, states that sources.commit and sources.url change, and points at a generator --check against that revision for the stored digests.

Verified in the seeded diff

  • compact drops sources and the registry digest; resolve rebuilds one git source, inserts it after origin, and merges the registry digest back into sorted source_files. Snapshot validation requires schema 1, the InferRSI repository, a 40-hex revision, skill-index.json, and a 64-hex digest.
  • catalog.knowledge_records resolves only dicts with schema_version == 2, skips knowledge/_provenance.json, and raises if a schema-2 record has no snapshot.
  • Visible skill JSON keeps its own resource hashes. The shared commit and registry hash leave the per-record files.
  • Docs that describe the new path (docs/contributing.md, docs/knowledge-base.md, docs/skill-eval-pr.md, knowledge/README.md) point at _provenance.json for the pin.

Not verified here

  • Seeded pr/diff.patch stops at host-overhead-optimization.json (…[truncated]). Generator, coverage builder, tools/knowledge_declaration_paths.py, SkillEval planner, tests, and package-data rules were not in the reviewed text.
  • Tests and build_skill_index.py --check were not run. CI was not inspected.
  • PR body was not seeded, so the knowledge authorship declaration for head b9851bf… was not checked.
  • Records after the truncation point were not checked for origin, skill_documents.original, and a matching source_files entry. The visible ones have that shape, which resolve requires.

Optional

  • knowledge/README.md no longer embeds a concrete revision; the check example is the placeholder <committed-source-revision>. Pointing at _provenance.json is enough if the pin and the workflow text agree.

Copy link
Copy Markdown
Collaborator

Incremental re-review (COMMENT only, not an approval)

Reviewed range: 0241800e6200ae8844ef77e5ba9f6532cf40a727..b9851bf93d762a991c31320e4c27449f176338eb (one commit, b9851bf9), against my previous review.

What this commit changes

  • tests/test_source_snapshot.py: every fixture Git call now goes through one shared GIT prefix that carries the identity. This includes the merge in test_same_owner_divergent_edits_remain_an_explicit_conflict, which previously ran without one. That test now also asserts "CONFLICT" in merge.stdout, so a merge that fails for an unrelated reason, such as a missing identity, can no longer pass as the expected conflict. Good tightening.
  • tests/test_skill_coverage_view.py: the placeholder revision "test-source" becomes "0" * 40, matching the strict 40-hex snapshot validation.
  • docs/knowledge-contribution-workflow.md: adds the note that the declaration path lists overlap. This resolves my earlier non-blocking point.

These look like the right fixes for the two full-check failures, but I can't see the job logs, so I can't confirm they were the only failures.

Still blocking

  1. CI on this head. full-check (3.10) and full-check (3.11) are still in progress on b9851bf9. installed-package (both), lint-and-smoke and pr-references pass. declarations has one failed and one later successful run on this head. I assume the body was updated in between; please confirm.
  2. The workflow doc contradicts the pin move. I checked this myself; it agrees with the automated review on this head. docs/knowledge-contribution-workflow.md (Stored format) says the one-time migration "regenerated all 80 records from the already-pinned source revision; every resolved record is byte-identical to the previous stored record", and that consumers "see no change". However, src/inferrsi/data/repo_packs/inferrsi/knowledge/_provenance.json sets source_revision to 56c500367d5495fdd9f0e35030c9cd957f70eac5. The removed lines in, for example, knowledge/ascend/skills/ascend-aclgraph-capture-replay.json pinned d648f25732dee1c974da62a94c46a642ad52cef8 in both sources[0].commit and the blob URL. Resolved records therefore differ from the previous ones in sources[0].commit and sources[0].url. I'm fine with keeping 56c50036 because it is an ancestor of main, which I noted last time. In that case, please reword that paragraph to say that the migration also moved the pin from d648f257… to 56c50036…, that sources.commit and sources.url change accordingly, and that everything else in the resolved record is unchanged. The alternative is to regenerate at d648f257….
  3. Still Draft.

What would unblock Approve

  • Both full-check jobs green on the current head.
  • The Stored-format paragraph corrected, or the records regenerated at the old pin.
  • Out of Draft.

No approval implied.

The migration regenerated the records at the previous pin d648f25, where
every resolved record was byte-identical, and then moved the pin to the
squash commit 56c5003 on main. State that resolved records therefore differ
only in sources[0].commit and sources[0].url, and how to check the stored
hashes against the recorded revision.

Agent-assisted-by: Claude Code / claude-opus-5-5 [effort=xhigh] (author)
Signed-off-by: Dong1017 <55723162+Dong1017@users.noreply.github.com>

@cursor cursor Bot 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.

LGTM

PR review verdict — PASS
Reviewed base 56c500367d5495fdd9f0e35030c9cd957f70eac5 and head dfae5ed5cc45294b8e31229c2f991b843f61a412 (incremental b9851bf93d762a991c31320e4c27449f176338eb..dfae5ed5cc45294b8e31229c2f991b843f61a412).

Earlier finding

Resolved: the public source pin now matches the migration contract in docs/knowledge-contribution-workflow.md (Stored format, catalog paragraph). The paragraph states that all 80 records were regenerated at d648f25732dee1c974da62a94c46a642ad52cef8 and that each resolved record was byte-identical to the previous stored record, then the shared pin moved to 56c500367d5495fdd9f0e35030c9cd957f70eac5. It states that resolved records differ in sources[0].commit and sources[0].url, while every content hash and the registry hash stay the same. That matches resolve() writing those two source fields from the _provenance.json snapshot revision (src/inferrsi/_source_snapshot.py).

Schema 1, field set, and field order stay in place for search, knowledge show, Collect, and installed wheels. Hash checks are python tools/build_skill_index.py --source-revision <source_revision> --check with the source_revision from _provenance.json.

Verified

  • Incremental diff contains only docs/knowledge-contribution-workflow.md.
  • The replacement contract names both revisions and limits the public delta to the two source fields traced in the previous review.

Not verified here

  • tools/build_skill_index.py --check was not run.
  • Ancestry of d648f25732dee1c974da62a94c46a642ad52cef8 and byte-equality of the skill-library trees against 56c500367d5495fdd9f0e35030c9cd957f70eac5 were not re-checked in this pass.
  • CI was not inspected.

No outstanding blocker. This review stays on the issue #355 workflow contract.

@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

Incremental range: b9851bf93d762a991c31320e4c27449f176338eb..dfae5ed5cc45294b8e31229c2f991b843f61a412. The net PR was reviewed earlier against base 56c500367d5495fdd9f0e35030c9cd957f70eac5.

  • docs/knowledge-contribution-workflow.md (Stored format) now records the pin move. Records were regenerated at d648f257…, where they were byte-identical, and then re-pinned to 56c50036…, an ancestor of main. As a result, only sources[0].commit and sources[0].url differ, and it shows how to --check against _provenance.json. This resolves the remaining doc blocker from my last review.
  • CI on this head: full-check (3.10) and full-check (3.11) pass, as do installed-package (both), lint-and-smoke, pr-references and the latest declarations run. An earlier declarations run on the same head failed and a later one passed.
  • The PR is out of Draft.

The manual repair path after future squash merges, already listed under Limits, stays as a known follow-up.

@Dong1017
Dong1017 merged commit 14fa1f5 into main Nov 10, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:knowledge Knowledge line: packs, skill library, knowledge admission kind:task Bounded delivery task with a delegated slice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants