Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions skills/ce-compound-refresh/scripts/validate-doc-claims.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,13 @@ def head_has_path(path: str) -> bool:
f"{upstream}: stale checkout? Annotate or verify against upstream."
)
else:
where = (
f"working tree or {upstream}" if upstream else "working tree"
)
flags.append(
f"FLAG path `{token}`{loc} — not found in {where}. Fix the "
"citation, or annotate it as historical (e.g. removed by this fix)."
f"FLAG path `{token}`{loc} — not found under {base}"
+ (f" or {upstream}" if upstream else "")
+ ". This check only looks in this repository; verify other "
"repos or stores before treating the citation as wrong. Fix "
"the citation, or annotate it as historical (e.g. removed "
"by this fix)."
)

# --- 2. Cited commit SHAs ----------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion skills/ce-compound/references/grounding-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The script reports flags; you decide each one. Three resolutions — **fix**, **

| Flag | Likely meaning | Resolution |
|------|----------------|------------|
| path not found anywhere | Typo, or drafted from memory | Fix the citation or remove the claim |
| path not found under the search base | Typo, or a real path this repo-scoped check cannot see — another store, or a target the citing sentence itself says is gone | Read that sentence and check stores outside this repository before treating the citation as wrong; then fix it, or annotate it as historical |
| path missing here, exists at upstream | Stale checkout | Verify the claim against upstream; annotate if the doc implies the file is present locally |
| path deliberately gone (doc says removed/renamed) | Historical citation | Confirm the surrounding prose marks it as historical ("removed by this fix", "pre-fix state"); add that marker if absent |
| SHA does not resolve | Fabricated or from another repo | Replace with the PR number, or drop |
Expand Down
11 changes: 6 additions & 5 deletions skills/ce-compound/scripts/validate-doc-claims.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,13 @@ def head_has_path(path: str) -> bool:
f"{upstream}: stale checkout? Annotate or verify against upstream."
)
else:
where = (
f"working tree or {upstream}" if upstream else "working tree"
)
flags.append(
f"FLAG path `{token}`{loc} — not found in {where}. Fix the "
"citation, or annotate it as historical (e.g. removed by this fix)."
f"FLAG path `{token}`{loc} — not found under {base}"
+ (f" or {upstream}" if upstream else "")
+ ". This check only looks in this repository; verify other "
"repos or stores before treating the citation as wrong. Fix "
Comment on lines +278 to +279

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Describe non-git search bases without calling them repositories

When the document and current directory are outside Git, base is merely os.getcwd(), but this new sentence still calls it “this repository.” Reproducing from a temporary non-git directory yields both INFO: not a git repository and This check only looks in this repository in the same report, undermining the clarification this change intends to provide. Make the scope description conditional on in_git, referring to the named directory rather than a repository in this supported fallback mode.

Useful? React with 👍 / 👎.

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.

@Amanjyot-P take a look at this

"the citation, or annotate it as historical (e.g. removed "
"by this fix)."
)

# --- 2. Cited commit SHAs ----------------------------------------------
Expand Down
8 changes: 6 additions & 2 deletions tests/doc-claims-validator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,18 @@ describe("validate-doc-claims script", () => {
expect(result.stdout).not.toContain("FLAG")
})

test("flags a cited path that exists nowhere", () => {
test("flags a cited path that exists nowhere, naming the search base as repo-scoped", () => {
const docPath = writeRepoDoc(
"The handler is `src/does-not-exist.ts` in the tree.\n",
)
const result = runValidator(skillDir, docPath)
expect(result.code).toBe(1)
expect(result.stdout).toContain("FLAG path `src/does-not-exist.ts`")
expect(result.stdout).toContain("not found")
expect(result.stdout).toContain("not found under ")
expect(result.stdout).toContain(path.basename(repo))
expect(result.stdout).toContain(
"This check only looks in this repository",
)
})

test("classifies a path that only exists upstream as stale-checkout", () => {
Expand Down