Skip to content

feat(knowledge): add the repo-tree discovery rung to map-corpus - #12305

Merged
kyle-sexton merged 2 commits into
mainfrom
work-resolve-issue/issue-7368-41393858166-1
Nov 2, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
work-resolve-issue/issue-7368-41393858166-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #7368

Summary

Opened by the work-resolve-issue lane. The run's own summary:

/knowledge:map-corpus gains a repo-tree discovery rung. parse_discovery.py --rung repo-tree reads a forge's recursive tree listing, a repository seed pinned to a full commit SHA, and include and exclude globs, and emits the same discovery-output/v1 shape plus a repository record. The URL set (raw file URLs for listed blobs the globs select) is computed by the script through a forge adapter registry (repo_tree_adapters.py, GitHub entry), and the GitHub fetch commands live in reference/providers/github/repo-tree.md, so SKILL.md names the adapter and not gh grammar, per ADR 0060. check_linkmap.py accepts the rung, requires the output's repository seed to be a declared seed, and passes a corpus whose only seed is a repository seed. Design choices, decided from the code and ADR 0060: the schema stays v1 with the additions recorded in link-map-format.md, since every previously valid map still passes; the GitHub adapter is split into a Python parse half and a markdown fetch half, following ADR 0060's 'provider commands under reference/providers/github/'; the parser refuses an unpinned ref, a truncated listing, and any include glob that selects nothing.

Not verified

  • test_discovery.py (existing and new tests) was not executed: this lane cannot run python. The review traced each assertion by hand; the PR's CI runs the suite.
  • Tidy skipped: the change is over the 300 changed-line cutoff (about 400 tracked lines plus new files).
  • The fixture is synthetic (placeholder SHAs, a small pstack-shaped tree), not a capture of cursor/plugins at a real pinned SHA; a live mapping of the 167-file pstack corpus was not run here.
  • Optional unit grouping (one downstream digest per skill directory) from the issue's Proposal was not built; the re-triage done-when list does not include it.
  • check-evals-quality not run on the edited eval: it reads evals.json sets, and this case is prompt.md plus case.yaml; CI's evals-schema covers it.
  • Untracked files at the checkout root (.bashrc, .bash_profile, .gitconfig, .idea, .mcp.json, .profile, .ripgreprc, .vscode, .zprofile, .zshrc) were not created by this run and are not part of the change.

Fix

  • plugins/knowledge/skills/map-corpus/discovery/parse_discovery.py: new repo-tree rung with --forge/--owner/--repo/--ref/--include/--exclude, a path-glob matcher (** spans directories, */? stay in one segment), and fail-loud refusals for an unpinned ref, a truncated or malformed listing, a mis
  • plugins/knowledge/skills/map-corpus/discovery/repo_tree_adapters.py: new forge adapter registry with the GitHub adapter (blob paths from a trees listing, refusing truncated; seed, base and percent-encoded raw resource URLs)
  • plugins/knowledge/skills/map-corpus/discovery/check_linkmap.py: accepts the repo-tree rung in discovery outputs and row rungs, requires and validates the repository record on repo-tree outputs, checks its seed_url is a declared seed, and updates the no-discovery message
  • plugins/knowledge/skills/map-corpus/discovery/test_discovery.py: TestRepoTreeRung over the committed fixture: glob filtering and URL order, the repository-seed-only map passing the gate with every file classified (and failing when a row is dropped), undeclared repository seed, truncated listing, unp
  • plugins/knowledge/skills/map-corpus/discovery/fixtures/github-tree-pstack.json: new synthetic tree listing in GitHub's documented trees API shape, laid out like the cursor/plugins pstack corpus (skills, agents, docs, plus directories, a submodule, a .DS_Store and out-of-scope files)
  • plugins/knowledge/skills/map-corpus/discovery/link-map-format.md: documents the repo-tree rung, the repository key, the rung in row rungs, the seed check, and records the schema addition as kept at v1
  • plugins/knowledge/skills/map-corpus/SKILL.md: Phase 1 adds the repository seed kind naming the forge's repo-tree adapter; a corpus may have only a repository seed; Phase 2 gives the repo-tree parse invocation; --include/--exclude arguments; rung wording updated
  • plugins/knowledge/reference/providers/github/repo-tree.md: new GitHub adapter reference: pin the ref, snapshot the recursive tree listing, truncation handling, seed and raw URL forms
  • plugins/knowledge/reference/ingest-deferred-decisions.md: section 2 reads taken, with the 2026-10-13 cursor/plugins pstack trigger evidence; Disposition updated
  • plugins/knowledge/evals/mc-resource-seeds-route-away/prompt.md: description and expected outcome no longer cite the removed 'V1 requires at least one origin seed' rule
  • .changes/knowledge/work-resolve-issue-issue-7368-41393858166-1-abe98d31.md: minor changelog fragment for the new rung

Verification

The runner ran each check from the base copy against 077d5ed:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • read https: //docs.github.com/en/rest/git/trees?apiVersion=2022-11-28: Get a tree takes a SHA or ref, any recursive value recurses, recursive listing capped at 100,000 entries / 7 MB, truncated true when exceeded, entries carry path, mode, type, sha (size, url optional), types blob/tree/commit
  • read https: //docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#get-a-commit: ref accepts a commit SHA, branch or tag, and the response has a top-level sha
  • .lane/checks/bin/check-changelog-fragments: all 2 fragments valid
  • .lane/checks/bin/check-changed-skills: map-corpus PASS, 0 errors, 3 warnings (body length above Pocock's max and grew 215 -> 229 lines; an existing numbered procedure without completion signals)
  • .lane/checks/bin/check-affected: 12 passed, 6 skipped over 11 changed files (first run failed markdownlint MD032 in link-map-format.md and ruff F401 unused import; both fixed)
  • .lane/verify/bin/cant-fail-scan --file test_discovery.py --check: PASS, 38 test blocks, no gating findings
  • fresh-context review subagent over the whole diff: no high findings; it traced every new test assertion as passing; fixed its medium finding (truncation recovery advice that the parser could not consume) and two lows (per-include dead-glob check, repository seed row classified ignore), and updated t
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41393858166

Left out: the items under Not verified.

Related

#7368

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 62ff286431fb484123605ac287d86ae6fb9a5490: read 1 of 1 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #12305, incremental since 077d5edc

I found no security issues in this change.

Scope. I read the whole incremental change to plugins/knowledge/skills/map-corpus/SKILL.md: one hunk, at lines 60–83 of the head file. I used the full diff only for context. The file does not match any trusted-path glob. No plugin manifest, workflow, token, kill-switch or merge-hold file changed.

What I checked

  • Slug hash input: The <slug> hash now covers seeds.txt, which is the sorted, normalized seeds plus one include <glob> / exclude <glob> line per sorted glob. The slug is still the slugified topic plus 8 hex characters of a SHA-256. The globs feed only the hash, never the path, so glob text cannot reach the slice path and there is no path-injection route.
  • Collision check: Before, the check compared only the seeds. Now it also compares the Include and Exclude lines. Different globs, or a missing checklist, still mean refuse and stop. This tightens the check: two runs with different globs can no longer resume or overwrite each other's slice. The immutable-snapshot rule ("never re-fetch over") is unchanged.
  • Instruction surface: The change does not delete, narrow or soften any instruction; it only adds refusal conditions. I didn't consult the instruction exception register because this lane can't read it. Nothing was removed, so there was no removed rule to check against it.

Prior findings: The only earlier post is this lane's summary at 077d5edc, which had 0 findings. There is nothing to restate.

Embedded text in the PR context: none that directs this lane.

Spend: none.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 1 inline finding(s) on 077d5edc70e743f9da3bfa1d24bc5493be332093; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 62ff286431fb484123605ac287d86ae6fb9a5490: read 1 of 1 changed file(s); 0 finding(s), 0 as inline comments.

Code review, incremental: plugins/knowledge/skills/map-corpus/SKILL.md (#12305)

This round covers only the change since 077d5edc, in .claude-lane/incremental.diff: one hunk in SKILL.md. I read all of it, plus the whole head file for context. The other 10 files haven't changed since the last review. I ran nothing.

The last round's finding is fixed. It said --include and --exclude weren't part of the slice's identity (#12305 (comment)). The change fixes it both ways that finding suggested:

  • Slug hash (SKILL.md#L62-L67): the hash is now taken over seeds.txt. When a repository seed is present, that file holds the sorted seeds followed by one sorted include <glob> line per include and one exclude <glob> line per exclude. If the same topic and seed are run with different globs, the hash differs, so the run gets a new slice and doesn't resume the old one.
  • Collision check (SKILL.md#L69-L72): it now also compares the checklist's Include and Exclude lines and refuses on a mismatch. The slice-layout comments for map-corpus-checklist.md and seeds.txt were updated to match.

I traced the earlier failure case by hand: --include 'pstack/skills/**' and then --include 'pstack/docs/**' on the same seed. The two runs now hash to different slugs, and even if they shared a slice, the checklist comparison would refuse. A slice created before this change, whose seeds.txt has no glob lines, also hashes differently, so it can't be resumed with a mismatched glob set by mistake.

No new findings. The checklist's line formats (Seeds, and now Include and Exclude) still aren't written out as a template anywhere in the skill. That was already true of Seeds, and the layout comment says the checklist holds the repo globs, so I'm not raising it as a finding.

Closing issue #7368: this hunk changes nothing that affects the "Done when" items checked last round, so those results still hold.

No plugin manifest changed. No settled threads apply, and the round cap (1 of 3) wasn't reached. Nothing here needs a hold.

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM6yjRAT
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on 62ff286.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 62ff286431fb484123605ac287d86ae6fb9a5490.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 2, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 2, 2026
@melodic-automation-lanes

melodic-automation-lanes Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 62ff286431fb484123605ac287d86ae6fb9a5490. The lanes clear this reason on their own; the next scheduled run judges it again.

pr-merge's gate holds it on its risk score (evidence-unbound:claude-review: not bound: no-run;
  evidence-unbound:claude-security-review: not bound: no-run)

Merged via the queue into main with commit 01d149d Nov 2, 2026
44 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-7368-41393858166-1 branch November 2, 2026 07:00
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.

knowledge: add the deferred repository-tree enumeration rung to map-corpus

1 participant