Skip to content

fix(generator): resolve a file-sourced skill body in the candy-walk complement - #31

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/file-sourced-skill-bodies-2
Nov 24, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
fix/file-sourced-skill-bodies-2

Conversation

@aitrawog

Copy link
Copy Markdown
Contributor

Summary

Successor to #30, which the validator auto-closed at its five-verdict threshold; this is a clean PR from main carrying the whole change with every finding addressed. Closes #28.

collectCandySkills read only the node's inline content:, so a moved candy whose body lives in <repo>/.agents/skills/<name>/SKILL.md projected a BLANK recipe card — and the module's go test ./... gate was red on main and on the released tag (TestCollectCandySkills_ProjectsMovedCandySkill).

The complement now:

  • resolves the file through candywalk.ReadSkillFile — the SAME reader collectSkills uses — and fills a missing body;
  • does not reconcile the two forms: refusing a disagreement is the AUTHORITY's check (the marketplace generator's fillSkillFromFile), and enforcing it here failed the live tree on description drift alone (cuda-skill, in the charly root manifest);
  • skips visibly (a named stderr line per node) a node with neither an inline body nor a file — this complement is a fallback, and the corpus may carry the real body under the same name.

How tested

Module gate, GREEN again (it was red on main):

$ cd candy/plugin-docs
$ gofmt -l .        -> (empty)
$ go build ./...    -> build=0
$ go vet ./...      -> vet=0
$ go test ./...     -> ok  github.com/opencharly/plugin-docs/candy/plugin-docs  3.170s

The tests that pin this change (both FAIL on the pre-fix complement):

  • TestCollectCandySkills_SkipsBodilessNodeVisibly — a node with neither an inline body nor a SKILL.md is omitted, its inline-bodied sibling is kept, and the skip line is CAPTURED from stderr. (The live byte-identical proof cannot catch a regression in the skip — a blank card is superseded by the corpus — so the unit case is the only proof.)
  • TestCollectCandySkills_FileBodyAndReferences — a node with no inline body takes BOTH its body and its references from the file.
  • TestCollectCandySkills_ProjectsMovedCandySkill (pre-existing, previously red) now passes: projected 1 candy skills incl. ripgrep (family=tools).

The live proof: a full docs generation with the fixed binary, on the same pins the site builds from, exits 0 and leaves the content tree byte-identical.

$ plugin-docs-bin-28 generate --root <charly> --narrative <umbrella> --plugins <marketplace> --out src/content/docs
exit=0
charly docs: 397 recipe pages, 192 plugin pages (199 provider words), 80 cli pages, 730 candy pages, 151 box pages (1556 generated pages cleared before regeneration)
$ git status --porcelain        # in the docs repo
(empty)

1556 reconciles with the five listed categories: the six generated pages outside them are the root narratives (soul, vision, grievances, liberation), the landing index.md, and recipes/index.md:

$ grep -rl "DO-NOT-EDIT — generated by" src/content/docs | wc -l
1556
$ grep -rl "DO-NOT-EDIT — generated by" src/content/docs | grep -vE '^src/content/docs/(recipes|reference)/'
src/content/docs/index.md
src/content/docs/liberation.md
src/content/docs/soul.md
src/content/docs/grievances.md
src/content/docs/vision.md

Seven routing-only nodes are named on stderr as skipped — the visible record of why they contribute no card.

Rulebook compliance

  • R0 — loaded /charly-build:docs, /charly-internals:plugin, /charly-internals:go, /charly-internals:git-workflow, /charly-internals:strict-policy.
  • R1 — the pre-existing red suite is the issue itself (collectCandySkills projects a BLANK card for a file-sourced skill body — the module's go test gate is red because of it (pre-existing at v2026.289.0814) #28), fixed; the two live-tree refusals of a first attempt were root-caused to a check that belongs to the authority; the closed predecessor's findings are all in this diff or answered here (comment divergence, page count, missing skip tests).
  • R2 — ONE reader for a skill file (candywalk.ReadSkillFile); ONE place that enforces the inline-vs-file contract (the marketplace generator).
  • R3 — no suppression: a bodiless node is skipped VISIBLY, and the authority still hard-errors on the same shape where it is authoritative.
  • R4 — the product (the docs generator) is corrected, not the test.
  • R5 — the blank-card path is deleted, not shimmed.
  • R6 — branch fix/file-sourced-skill-bodies-2 off fresh origin/main; no other session's work touched.
  • R7 — the tests fail without the change; the live proof shows the gate repaired with a byte-identical artifact.
  • R8 — not applicable.
  • R9 — not applicable (no charly binary).
  • R10 — generator behaviour change: the live generation is the gate and it is pasted.
  • R11 — no shape or mechanism added; an existing reader is used.

Change classification

Generator robustness fix; no published-page change (proven). No ! marker. Rollback: revert, which restores the blank card and the red suite.

Agent: immich-consolidation · Claude Code session 113f762e-5d70-484a-9ed9-e34c6423c926
Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

…omplement

Successor to #30 (auto-closed by the validator's five-verdict
threshold): one clean commit carrying the whole change with every finding fixed.

collectCandySkills read only the node's inline `content:`, so a moved candy whose body lives
in `<repo>/.agents/skills/<name>/SKILL.md` projected a BLANK recipe card, and the module's
`go test ./...` gate was red on main and on the released tag (#28).

The complement now resolves the file through candywalk.ReadSkillFile — the SAME reader
collectSkills uses — and FILLS A MISSING body. It does not reconcile the two forms: refusing
a disagreement is the authority's check (the marketplace generator's fillSkillFromFile), and
enforcing it here failed the live tree on description drift (cuda-skill, in the charly root
manifest). A node with neither an inline body nor a file is SKIPPED with a named stderr line:
this complement is a fallback, and the corpus may carry the real body under the same name.

Tests (the findings the closed PR still owed):
- TestCollectCandySkills_SkipsBodilessNodeVisibly — the bodiless node is omitted, its
  inline-bodied sibling is kept, and the skip line is captured from stderr.
- TestCollectCandySkills_FileBodyAndReferences — the file supplies BOTH the body and the
  references.
Both fail on the pre-fix complement.

Verified: `go test ./...` green; a full docs generation with the fixed binary exits 0 and
leaves the content tree byte-identical (1556 generated pages, 0 dirty paths).

Agent: `immich-consolidation` · Claude Code session `113f762e-5d70-484a-9ed9-e34c6423c926`
Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: a1897c4d27294a47a7188be6cea64bc617c92508 (branch: fix/file-sourced-skill-bodies-2)

Security screen: PASS — T1/T2 no injected directives or authority-grabbing prose; T3 the diff adds only a local-file read via the existing candywalk.ReadSkillFile and stderr logging (no secrets, network, egress, or guardrail weakening); T4 not security machinery.

Checklist: All applicable rules PASS or NA. Diff is a self-contained code change in the candy/plugin-docs generator (correct layer; reuses an sdk reader; no core/alias imports). The two added tests fail on the pre-fix complement, and the live proof is internally consistent — 397+192+80+730+151 = 1550, plus the six non-category pages (soul/vision/grievances/liberation, index.md, and recipes/index.md, the last correctly excluded by the recipes|reference grep filter) reconciles to the stated 1556, and git status --porcelain empty is coherent with the 7 stderr-named skips being corpus-covered. 1556 byte-identical live output + the skip-line proof make fully tested and validated defensible. Successor names predecessor (#30), closes #28; Agent:/Assisted-by: footer well-formed. No comments to disposition (thread empty).

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

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

Labels

None yet

Projects

None yet

1 participant