Skip to content

fix(discovery): keep absolute project root out of persisted EXPLORE.md#458

Merged
kyle-sexton merged 3 commits into
mainfrom
fix/409-explore-md-relative-paths
Jul 19, 2026
Merged

fix(discovery): keep absolute project root out of persisted EXPLORE.md#458
kyle-sexton merged 3 commits into
mainfrom
fix/409-explore-md-relative-paths

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Problem

plugins/discovery/skills/explore/SKILL.md and explore-deep/SKILL.md inject a live !git rev-parse --show-toplevel`` as pre-computed Project root: context at skill load. That value is the consumer's absolute machine path. Because `EXPLORE.md` is a handoff artifact meant to let a fresh session resume, the absolute root can bleed into the persisted file — making the artifact machine-specific and violating the marketplace agnosticism boundary (`docs/PLUGIN-PHILOSOPHY.md`: runtime behavior must not depend on absolute machine paths).

Fix

Per the issue's fix direction — keep the live root for orientation, but ensure it is never echoed into the persisted artifact:

  • Both skills: annotate the pre-computed Project root: line as session-orientation only — usable for resolving files while working, never persisted into EXPLORE.md.
  • explore outcome gate: add one binary criterion requiring repo-relative artifact paths (no absolute machine path echoed). explore-deep already runs this same gate in its Step 3, so the check propagates without duplication.

No schema change: the 7-section EXPLORE.md output format and its consumers are untouched. The three pre-computed values (branch, working-tree status, root) still render for orientation; only the absolute root is barred from the artifact.

Verification

  • markdownlint-cli2 (repo config .markdownlint-cli2.jsonc) — clean on all changed files.
  • typos (repo config _typos.toml) — clean.
  • CHANGELOG entry (0.7.1) + plugin.json version bump added per the plugin's per-change convention.

The research/research-deep skills do not carry this pre-computed root pattern, so nothing else in the plugin needed the change.

Related

Closes #409

The explore and explore-deep skills inject a live `git rev-parse
--show-toplevel` as pre-computed context. That absolute machine path could
bleed into the persisted EXPLORE.md handoff, making the artifact
machine-specific.

Mark the pre-computed project root as session-orientation only in both
skills, and add a binary outcome-gate criterion requiring repo-relative
artifact paths. The live root stays available for resolving files while
working; it is never echoed into the handoff.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Jul 19, 2026

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1m 28s —— View job


PR Review — fix(discovery): keep absolute project root out of persisted EXPLORE.md

  • Gather context
  • Read changed files
  • Review diff against origin/main
  • Post findings

Summary

This is a clean, well-scoped fix. The problem is real — git rev-parse --show-toplevel produces an absolute machine path that could leak into a persisted handoff artifact, violating the marketplace agnosticism boundary. The chosen approach (annotate-at-source + outcome-gate binary criterion) is appropriate for a skill/prompt system where structural enforcement isn't available. No issues block merge.


Review findings

Annotation placement and scoping — correct

Only Project root: is called out as problematic. Working tree status: (git status --porcelain) outputs repo-relative paths; Current branch: is just a name. The annotation is correctly scoped to the one value that's actually machine-specific. Both SKILL.md files now carry the warning immediately after the pre-computed context block, which is the right placement (at point-of-use, before the model has a chance to reference it).

explore/SKILL.md L15 · explore-deep/SKILL.md L17

Outcome gate criterion — correct and well-placed

The new gate criterion in explore/SKILL.md is binary, observable, and fits naturally between "claims are Read-verified" and "open questions surfaced." The explore-deep fork already delegates its gate to Step 3 (Before writing, run the Outcome gate the /explore workflow defines), so the criterion propagates without duplication — consistent with the PR description and correct.

explore/SKILL.md L154

Minor: forward cross-reference in explore/SKILL.md

The annotation on line 15 says (see the outcome gate) — a forward reference to a section ~135 lines below. This is a very minor style point; a phrase like (see "Outcome gate", below) would be marginally clearer. Not a correctness concern.

Instruction-based enforcement (acknowledged, appropriate)

The fix is model-compliance-based, which is inherent to this kind of system. The outcome gate is the only structural backstop, and it's binary and explicit. This tradeoff is appropriate here — there's no viable alternative that doesn't require schema changes.

CHANGELOG and semver — correct

0.7.0 → 0.7.1 is the right semver for a bug fix. The changelog entry is accurate, describes the mechanism (not just the symptom), and covers both affected skills.


Verdict

Approve. The fix is correct and complete. The PR description correctly notes that research/research-deep skills don't carry the pre-computed root pattern, so no other files need changes.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce1fa00383

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/discovery/skills/explore/SKILL.md Outdated
…ists

The explore outcome gate's new path criterion required every artifact
path to be "relative to the repo root", but the topic-docs contract
explicitly supports invocations with no repo root (no git toplevel or
project marker), where artifacts resolve under the current directory or
${CLAUDE_PLUGIN_DATA}. In those runs the binary criterion was
unsatisfiable and blocked the EXPLORE.md handoff.

Reframe the criterion around the real invariant — no absolute machine
path in the artifact — with the relative base being the repo root when
one exists, else the current working directory. Align the pre-computed
context annotations in both skills and the CHANGELOG entry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Jul 19, 2026

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1m 25s —— View job


PR Review — fix(discovery): keep absolute project root out of persisted EXPLORE.md

  • Gather context
  • Read changed files on updated HEAD (d76e8f1)
  • Assess whether new commit resolves Codex P2 concern
  • Post findings

Review of updated HEAD (d76e8f1)

The previous Claude review approved the original two-commit state. The branch was then synchronized with one additional commit (d76e8f1) that specifically targets the Codex P2 concern. Here is my assessment of that commit and the full PR.


Codex P2 concern — resolved correctly

The concern was that the original outcome gate criterion ("Paths are repo-relative") was unsatisfiable when no Git repo root exists — the pre-computed Project root: renders as unknown, so there is no base against which paths could be made relative, blocking the handoff in a supported invocation mode.

d76e8f1 reframes the criterion around the real invariant — no absolute machine path in the artifact — and adds the explicit fallback:

"every path it records is written relative to the repo root, or — when there is no repo root — to the current working directory"

explore/SKILL.md L154

This is the right fix. The real constraint is agnosticism (no machine-specific absolute paths), not strict repo-relativeness. The fallback to CWD is consistent with the topic-docs contract and ensures the gate remains satisfiable in non-repo invocations.


Consistency across all three touch-points — correct

All three places that stated the old "repo-relative" constraint are updated in lock-step:

Location Before After
explore/SKILL.md annotation (L15) "records repo-relative paths (see the outcome gate)" "records relative paths (see the outcome gate below)"
explore/SKILL.md outcome gate (L154) "Paths are repo-relative" "Paths are machine-agnostic"
explore-deep/SKILL.md annotation (L17) "requires repo-relative paths" "requires relative, machine-agnostic paths"

No drift between the two skills; the explore-deep annotation stays in sync with the gate it delegates to. The minor "see the outcome gate below" improvement (noted in the prior review as a style point) was picked up here as well — good.


CHANGELOG — accurate

The 0.7.1 entry now correctly describes the full semantic: "relative to the repo root, or to the current working directory when no repo root exists." The version bump (0.7.0 → 0.7.1) remains correct for a bug fix.


No new issues

The second commit is surgical — 6 lines changed across 3 files, all wording updates, no structural changes. No regressions to prior behavior; the absolute-path prohibition still holds. The fix doesn't require a version bump beyond what was already added.


Verdict

Approve. d76e8f1 cleanly resolves the Codex P2 concern without introducing new issues. The PR is complete and ready to merge.

kyle-sexton added a commit that referenced this pull request Jul 19, 2026
…#461)

## Summary

`/discovery:setup` cited a marketplace-repo ADR by bare path
(`docs/adr/0001-defer-gitbook-as-knowledge-vault-backend.md`) at both
`vault_backend: gitbook`
deferral call sites (`skills/setup/SKILL.md:47` and `:63`). That ADR is
a publisher-repo file — not
bundled in the plugin and not present in the consumer repo — so in the
cache-isolated installed
plugin form the reference resolves to nothing, leaving a consumer
reading the setup skill on a dead
path. This violates PLUGIN-PHILOSOPHY cache-isolation and the
never-cross-reference-file-names rule.

## Change

- Inlined the one-sentence rationale directly at both call sites — *git
remains the storage layer
because GitBook offers no concurrency-safe, lossless write path* —
replacing the bare ADR path.
The existing "deferred and non-writable; durable writes target `docs`"
wording is preserved.
- No dead path remains; behavior is unchanged.
- Bumped `plugins/discovery` `0.7.0` → `0.7.2` and added a
Keep-a-Changelog `## [0.7.2]` Changed
entry. (`0.5.1`'s historical CHANGELOG entry citing the same ADR path is
intentionally left as-is.)

Closes #407

## Related
- Stacks on PR #458 (issue #409, discovery plugin); if #458 merges first
this PR needs a trivial version/CHANGELOG rebase to keep 0.7.2 above
0.7.1.
- No ADRs or decision-log entries are closed by this PR.

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts:
#	plugins/discovery/.claude-plugin/plugin.json
#	plugins/discovery/CHANGELOG.md
@claude

claude Bot commented Jul 19, 2026

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1m 55s —— View job


PR Review — fix(discovery): keep absolute project root out of persisted EXPLORE.md

  • Gather context
  • Read diff against origin/main (HEAD: 87149a6)
  • Verify merge didn't introduce regressions
  • Post findings

Review of updated HEAD (87149a6)

This review covers the merge commit 87149a6 ("Merge remote-tracking branch 'origin/main' into HEAD") that synced the PR branch with a main branch that had moved (gaining ecd6e4a, 0.7.2). The two prior Claude reviews approved the substantive changes at ce1fa00 and d76e8f1. This pass verifies the merge is clean.


What the merge changed — version housekeeping only

The diff against origin/main is identical in every functional respect to what the prior reviews approved. The only delta introduced by the merge itself is the version bump adjustment:

Field Before merge After merge
plugin.json version 0.7.1 0.7.3
CHANGELOG heading 0.7.1 0.7.3

Why the jump to 0.7.3? Another PR (ecd6e4a) landed a 0.7.2 entry on origin/main while this branch was under review (a setup-skill change in the same plugin). The merge correctly picked up that 0.7.2 CHANGELOG entry and bumped this PR's version to 0.7.3 to avoid a collision. The semver choice remains correct: this is a bug fix → patch increment on top of the now-current 0.7.2 baseline. No version entry is missing, duplicated, or out of order.


Substantive changes — verified unchanged

All three touch-points reviewed and approved at d76e8f1 are byte-identical to the current HEAD:

Location Content
explore/SKILL.md L15 Session-only annotation; bars absolute machine path from artifact
explore/SKILL.md L154 Outcome gate: "Paths are machine-agnostic" + CWD fallback for no-repo-root case
explore-deep/SKILL.md L17 Fork annotation; delegates gate enforcement to Step 3

The Codex P2 concern (gate unsatisfiable in no-repo-root runs) remains correctly resolved by the CWD fallback phrase. No drift between the two skills.


No regressions

The merge touched no logic, no schema, and no structural content in either SKILL.md file. The CHANGELOG 0.7.2 entry (from origin/main) and the new 0.7.3 entry are both present and consistent.


Verdict

Approve. The merge is clean. Version handling is correct. All prior-reviewed fixes are intact and unmodified. Ready to merge.

@kyle-sexton
kyle-sexton merged commit 49b74a4 into main Jul 19, 2026
15 checks passed
@kyle-sexton
kyle-sexton deleted the fix/409-explore-md-relative-paths branch July 19, 2026 18:15
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.

discovery: live absolute project-root injected into skill context can bleed into EXPLORE.md artifacts

1 participant