Skip to content

test: validate documentation against the skill catalog - #56

Merged
fullerzz merged 5 commits into
mainfrom
cdx/pstack-portable-doc-checks
Oct 18, 2026
Merged

fullerzz merged 5 commits into
mainfrom
cdx/pstack-portable-doc-checks

Conversation

@fullerzz

@fullerzz fullerzz commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Upstream #702 | Upstream #705 | Upstream #704

Why the change

Documentation totals and source links can drift from the installed skill tree, so the existing validator now checks them against the checkout.

Special things to note

  • Selectively adapts #704; #702's naming enforcement and #705's applicable native-host behavior already exist, while Cursor-specific rules are omitted.
  • Checks use the CommonMark parser already installed through Rich for current-source file targets; historical records, remote availability, and heading fragments are excluded, and plugin version remains 0.13.0.
  • Passed: 137 Python tests, 15 Node tests including the docs build, structural validation, Ruff, and project-wide mypy; live host behavior was not rerun.

Change outline

 validate(checkout)
   check skill names, policies, local links, and manifests
+  compare numeric and spelled-out overview totals with the skill tree
+  parse rendered CommonMark links/images and require source targets inside the checkout

 regression fixtures
+  stale totals and deleted source targets fail
+  backtick/tilde examples, historical records, and duplicate host roles remain valid
+  query/fragment URLs pass; absolute, traversal, and symlink escapes fail
+  angle-bracket destinations and titles preserve URL checks; malformed paths fail without aborting
+  balanced parentheses and reference links work; unused definitions/code examples are ignored
+  nonportable skill names fail

 docs/
+  provenance.md  — upstream decisions and deliberate omissions
+  validation.md  — local evidence and check limits

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T03:23:00.192423Z 20fea1f New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 9c1940accb

ℹ️ 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 scripts/validate.py Outdated
Comment thread scripts/validate.py Outdated
Comment thread scripts/validate.py Outdated

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 4 files

Architecture diagram
sequenceDiagram
    participant CLI as validate.py CLI
    participant V as validate()
    participant VC as validate_catalog()
    participant FS as Checkout Filesystem
    participant MD as Markdown Prose Extractor
    participant F as Failure Collector

    Note over CLI,F: Tool validation flow

    CLI->>V: Run validation
    V->>V: Validate structure (names, policies, links, manifests)

    V->>VC: NEW: Call validate_catalog()
    
    Note over VC,FS: Catalog Count Verification
    
    VC->>FS: Count skills/*/SKILL.md
    VC->>FS: Count principle-*/SKILL.md  
    VC->>FS: Count playbooks/*.md
    VC->>FS: Count unique agent roles (codex/*.toml + claude/*.md)
    FS-->>VC: Tree counts

    VC->>MD: Extract prose from README.md and docs/index.md
    MD-->>VC: Prose content
    
    VC->>VC: Parse advertised counts (e.g., "53 skills")
    
    alt Count mismatch
        VC->>F: Record "Catalog says X, but tree has Y"
    end

    Note over VC,FS: Current-Source Link Verification
    
    VC->>FS: Gather README.md, docs/guide/*.md, docs/reference/*.md
    VC->>MD: Strip fenced code blocks
    MD-->>VC: Prose with links
    
    VC->>VC: Match fullerzz/agent-skills/blob/main/ links
    VC->>FS: Check target file exists in checkout
    FS-->>VC: File exists or missing
    
    alt Broken source link
        VC->>F: Record "Broken current-source link"
    end

    V-->>CLI: Validation result (failures)
Loading

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread scripts/validate.py Outdated
Comment thread scripts/validate.py Outdated
Comment thread scripts/validate.py Outdated
Comment thread scripts/validate.py Outdated

@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: 15756f50ea

ℹ️ 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 scripts/validate.py Outdated
Comment thread scripts/validate.py Outdated

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread scripts/validate.py Outdated
Comment thread scripts/validate.py Outdated

@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: 275b192576

ℹ️ 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 scripts/validate.py Outdated

@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: fbf8f1cbf3

ℹ️ 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 scripts/validate.py Outdated
Comment thread scripts/validate.py Outdated
@fullerzz
fullerzz merged commit 5e13a91 into main Oct 18, 2026
1 check passed
@fullerzz
fullerzz deleted the cdx/pstack-portable-doc-checks branch October 18, 2026 03:22

@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: 20fea1fd44

ℹ️ 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 scripts/validate.py
for file in files:
if not file.is_file():
continue
text = file.read_text(encoding="utf-8")

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 Catch catalog file decoding errors

When any guide or reference Markdown file contains invalid UTF-8, the main walk records the UnicodeDecodeError as a structural failure, but this unconditional second read_text() raises the same error outside the per-file handler and terminates validation with a traceback. Catch read/parse errors here and report them through fail so one malformed documentation file does not prevent the remaining checks from running.

Useful? React with 👍 / 👎.

Comment thread scripts/validate.py
Comment on lines +160 to +161
opening = re.match(r"^ {0,3}(`{3,}|~{3,})(.*)$", line)
if opening and (opening[1][0] == "~" or "`" not in opening[2]):

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 Exclude fenced examples nested in Markdown containers

When README or docs/index.md contains a fenced example nested in a block quote or list, such as an opening line prefixed by > or -, this expression does not recognize the CommonMark fence and the catalog scanner interprets sample text like 99 skills as a real advertised total. Fresh evidence beyond the earlier top-level tilde-fence report is that container-prefixed fences remain in markdown_prose; account for Markdown container prefixes or derive prose from parser tokens.

Useful? React with 👍 / 👎.

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.

1 participant