Skip to content

[skills] Share general skills and lock provenance - #3986

Open
joshlf wants to merge 1 commit into
mainfrom
joshlf-share-vendored-skills
Open

joshlf wants to merge 1 commit into
mainfrom
joshlf-share-vendored-skills

Conversation

@joshlf

@joshlf joshlf commented Nov 20, 2026

Copy link
Copy Markdown
Member

Human review surface

  • anneal/AGENTS.md, anneal/docs/review-policy-design.md, and
    anneal/skills/ (README.md, change-review/SKILL.md,
    source-control/SKILL.md) update relative links to shared skills moved to
    repository-root skills/ and tighten non-normative wording outside
    Code Review Rules (anneal/AGENTS.md: 31,675 -> 31,560 bytes, keeping
    Code Review Rules and anneal/.gemini/styleguide.md byte-identical).
  • anneal/.agents/skills.json adds "../../skills" alongside "../skills" so
    Anneal skill discovery resolves both anneal/skills/ and repository-root
    skills/.
  • skills/ (README.md, vendor-lock.json, architectural-design/, and the
    ten vendored joshlf/skills packages) hoists shared general-purpose skills
    from anneal/skills/ via pure renames, indexes shared and vendored skills in
    skills/README.md, and pins upstream revisions, file modes, byte counts, and
    SHA-256 digests in skills/vendor-lock.json.
  • ci/check_skills.py, ci/test_check_skills.py, githooks/pre-push, and
    .github/workflows/ci.yml (check-skills, required by all-jobs-succeed)
    enforce vendored lockfile integrity, SKILL.md frontmatter, relative
    Markdown links and heading anchors, anneal/.agents/skills.json resolution,
    and Anneal Pass 1 script containment inside anneal/skills/.
  • Intentional policy relaxation · None.

Summary

Move the ten vendored joshlf/skills packages and architectural-design from
anneal/skills/ to repository-root skills/ alongside unsafe-rust,
zerocopy-development, and zerocopy-review so subtrees across the repository
can share them without duplicating vendored files. Keep the three Anneal-only
policy skills (change-review, source-control, and trust-review) in
anneal/skills/, configure anneal/.agents/skills.json to load both roots,
and update relative links across anneal/.

Add skills/vendor-lock.json and stdlib-only ci/check_skills.py (plus unit
tests in ci/test_check_skills.py) to verify vendored file modes
(100644/100755), byte sizes, and SHA-256 digests, SKILL.md frontmatter,
relative Markdown links and #anchor slugs, skill discovery paths, and the
absence of executable or script files under anneal/skills/.

Validation

  • Ran python3 -I -B ci/check_skills.py and
    python3 -I -B -m unittest discover -s ci -p 'test_*.py' -v (all 14 test
    cases passing).
  • Ran ./ci/check_todo.sh, ./ci/check_job_dependencies.sh,
    ./ci/check_actions.sh, and zizmor --persona=pedantic --min-severity=medium .github.
  • Ran anneal static and unit checks (./ci/check_todo.sh,
    ./ci/check_job_dependencies.sh, ./ci/check_actions.sh, and all 67 tests in
    python3 -B -m unittest discover -s ci -p 'test_*.py' -v), plus the
    Code Review Rules / styleguide.md parity and anneal/AGENTS.md byte-budget
    checks (31,560 + 1,024 = 32,584 < 32,768 bytes).

Authored by an AI agent acting on joshlf's behalf.

Move the ten vendored `joshlf/skills` packages and
`architectural-design` from `anneal/skills/` to repository-root
`skills/` so both `zerocopy/` and `anneal/` can load them without
duplicating vendored packages. Keep the three Anneal-specific policy
skills (`change-review`, `source-control`, and `trust-review`) in
`anneal/skills/`, expose both skill roots in
`anneal/.agents/skills.json`, and update moved-skill links across
`anneal/` while keeping `anneal/AGENTS.md` within its 32 KiB
cumulative budget.

Add `skills/vendor-lock.json` and stdlib-only `ci/check_skills.py`
(wired into `ci.yml`'s `all-jobs-succeed` gate and `githooks/pre-push`)
to verify vendored upstream commits, file modes (`100644`/`100755`),
byte counts, and SHA-256 digests alongside `SKILL.md` frontmatter,
relative Markdown links and heading anchors,
`anneal/.agents/skills.json` resolution, and Anneal Pass 1 script
containment inside `anneal/skills/`.

Agent-authored-by: AI agent acting on joshlf's behalf
@joshlf

joshlf commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Review Receipt

  1. Comparison tuple: target_base = ec75fb464cda7b18581faa83a6a82d0dfdf422d9 (main), merge_base = ec75fb464cda7b18581faa83a6a82d0dfdf422d9, head = 0767ee061c6cc330596f6a16d82d32bf2e541d72 (dirty_tree = clean).
  2. Risk and refinement rationale: Touches Pass 2 CI surfaces (.github/workflows/ci.yml, ci/check_skills.py, ci/test_check_skills.py, githooks/pre-push) and Pass 1 policy/agent-config surfaces (anneal/AGENTS.md, anneal/docs/review-policy-design.md, anneal/.agents/skills.json, anneal/skills/*, skills/*); ran singleton per-PR verification and two rounds of independent local trust-review + change-review (omitting multi-PR stack steps).
  3. Grouped coverage:
    • Repo-wide filesystem, mode, Unicode, and ambient-config check (all 38 raw diff entries): inspected — verified modes (100644 docs/JSON/Python; 100755 preserved on githooks/pre-push), zero symlinks/gitlinks added, zero case/NFC collisions, zero bidi/control characters, and zero forbidden overrides.
    • Hoisted skills (skills/architectural-design/ + 10 vendored joshlf/skills packages), skills/README.md, and skills/vendor-lock.json: inspected — verified 100% byte-identical pure renames (R100) on all 13 moved files, accurate upstream commits/modes/bytes/SHA-256 digests in skills/vendor-lock.json, and zero .py/.sh/executable files remaining in anneal/skills/.
    • Anneal policy, routing, and discovery config (anneal/AGENTS.md, anneal/docs/review-policy-design.md, anneal/skills/*, anneal/.agents/skills.json): inspected — verified against target_base that Code Review Rules and anneal/.gemini/styleguide.md remain byte-identical, anneal/AGENTS.md is 31,560 bytes (31,560 + 1,024 = 32,584 < 32,768), zero policy rules were weakened, and anneal/.agents/skills.json resolves to anneal/skills and skills.
    • Pass 2 CI workflow and scripts (.github/workflows/ci.yml, githooks/pre-push, ci/check_skills.py, ci/test_check_skills.py): inspected — verified 40-char Action SHA pinning, permissions: contents: read, persist-credentials: false, stripped cache/runtime token env vars, membership in fail-closed all-jobs-succeed, githooks/pre-push wait propagation, and fail-closed lockfile, frontmatter, link/anchor, discovery, and Pass 1 script-containment checks.
    • Untouched TCB, theory, correspondence, and root-manifest surfaces (anneal/trusted/*, anneal/theory/*, anneal/correspondence/*): inapplicable — untouched by <merge_base>..<head>.
  4. Realized capability and isolation: Independent fresh-context local reviewer launched outside the candidate checkout (single-family fallback); holdout isolation = none (CI/policy surface without compiler or auditor semantic lowering). Reused SHA-bound preflight receipt for zizmor and anneal/ci/test_*.py during Gate 1 review while independently executing ci/check_skills.py, ci/test_check_skills.py, and isolated /tmp probes; untouched Rust/Lean crate builds were not re-executed.
  5. Checks and probes: Ran python3 -I -B ci/check_skills.py, python3 -I -B -m unittest discover -s ci -p 'test_*.py' -v (14/14 passing), ./ci/check_todo.sh, ./ci/check_job_dependencies.sh, ./ci/check_actions.sh, zizmor --persona=pedantic --min-severity=medium .github, anneal/ci/check_{todo,job_dependencies,actions}.sh, anneal/ci/test_*.py (67/67 passing), Anneal Code Review Rules parity/byte-budget checks, and isolated /tmp falsification probes (<symlink>/.. escapes, ../../../<repo_name>/... parent-directory bounces, multiline wrapped links/references, <!-- inside inline/fenced code, ENOTDIR segments, and paragraph-bounded unclosed backticks).
  6. Findings and blockers: Round 1 caught and fixed in 0767ee061c6cc330596f6a16d82d32bf2e541d72: (a) P1 lexical os.path.normpath <symlink>/.. and parent-directory bounce in ci/check_skills.py (fixed via stepwise lstat()-checked resolve_relative_within_repo + regression tests), (b) P2 multiline wrapped Markdown link scanning and <!-- vs. code-span/fence ordering in ci/check_skills.py (fixed via mask_fenced_code_blocks -> single-pass mask_comments_and_code_spans + paragraph-aware link scanning + regression tests), and (c) P3 73-column commit-body wrap. Round 2 confirmed closure with 0 open findings and 0 open trust questions; pending human approval (Gate 5) on the listed Human review surface (including anneal/.agents/skills.json), Gate 2 Codex review, and Gate 3 CI.

Authored by an AI agent acting on joshlf's behalf.

@joshlf
joshlf marked this pull request as ready for review November 20, 2026 19:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T19:52:01.403304Z 0767ee0 Draft marked ready
ℹ️ 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.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.99%. Comparing base (ec75fb4) to head (0767ee0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3986   +/-   ##
=======================================
  Coverage   92.99%   92.99%           
=======================================
  Files          16       16           
  Lines        2469     2469           
=======================================
  Hits         2296     2296           
  Misses        173      173           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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: 0767ee061c

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 83 to 86
- **Authorship disclosure and privacy:** Include the `Agent-authored-by:`
trailer per [`authorship-disclosure`](../authorship-disclosure/SKILL.md)
trailer per
[`authorship-disclosure`](../../../skills/authorship-disclosure/SKILL.md)
whenever an agent contributed (literal `AI agent acting on <user>'s behalf`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add the required agent-authorship trailer

The reviewed commit ends with a Markdown prose notice rather than the required Agent-authored-by: AI agent acting on joshlf's behalf Git trailer. Because this commit contains acknowledged agent-authored content, publishing or merging it in its current form loses the repository-mandated commit provenance; replace the prose notice with the prescribed trailer before publication.

AGENTS.md reference: anneal/AGENTS.md:L69-L72

Useful? React with 👍 / 👎.

Comment thread ci/check_skills.py
Comment on lines +1118 to +1120
allowed_top_files={"README.md", "vendor-lock.json"},
forbid_scripts=False,
git_modes=git_modes,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Apply Anneal's script ban to shared loaded skills

When a repository-root skill adds a Python/shell or executable helper, this forbid_scripts=False path accepts it—even the new test_clean_fixture_with_executable_vendored_script_passes explicitly locks in that behavior—while anneal/.agents/skills.json now loads the entire root skill directory into Anneal. This lets newly loaded skill code bypass Anneal's pre-existing Pass 1 requirement to reject scripts outside its TCB/CI areas, so either the shared tree must receive the same containment check or Anneal discovery must exclude such content.

AGENTS.md reference: anneal/AGENTS.md:L177-L183

Useful? React with 👍 / 👎.

Comment thread ci/check_skills.py
Comment on lines +1108 to +1110
validate_vendor_lock(
resolved_root, skills_dir, root_files, root_empty_dirs, git_modes
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Require every vendored directory to remain locked

When a vendored package is removed from vendor-lock.json, this return value is ignored and the subsequent tree validation silently treats its directory as an ordinary repository-owned skill. For example, deleting the authorship-disclosure package entry and then modifying its SKILL.md passes check_repository as long as another package remains in the lock, defeating the provenance and immutability check this CI job is meant to provide. Compare the locked package set with an explicit repository-owned allowlist (or otherwise require every non-owned skill directory to be locked).

AGENTS.md reference: anneal/AGENTS.md:L91-L94

Useful? React with 👍 / 👎.

Comment thread ci/check_skills.py
Comment on lines +240 to +242
display = f"{tree_rel}/{rel_posix}"
check_safe_path_string(rel_posix, display)
record_collision_check(rel_posix)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reject forbidden config paths inside skill trees

When a skill contains a forbidden governing or ambient configuration such as AGENTS.override.md, .cargo/, or .agents/, this traversal only checks that the path is ASCII and collision-free, so check_repository accepts it; for example, anneal/skills/policy-review/AGENTS.override.md passes unchanged. Because both skill roots are now exposed to Anneal, enforce the repository's forbidden config-name and directory-component rules during traversal rather than allowing these files into discovered skill packages.

AGENTS.md reference: anneal/AGENTS.md:L167-L176

Useful? React with 👍 / 👎.

Comment thread ci/check_skills.py
Comment on lines +31 to +33
INLINE_LINK_RE = re.compile(
r"!?\[(?:[^\[\]\n]|\n(?![ \t]*\n))*\]\(([^)]*)\)"
)

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 Parse balanced parentheses in inline link destinations

When an inline Markdown destination contains balanced parentheses, this regex stops at the first ) and validates only a prefix of the real target. For example, [broken](ghost(foo).md) passes if a file named ghost(foo exists even though the actual ghost(foo).md destination is absent, while a valid parenthesized filename can be rejected. Replace the flat [^)]* capture with parsing that handles balanced/escaped parentheses so the promised relative-link check validates the rendered destination.

AGENTS.md reference: anneal/AGENTS.md:L64-L68

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
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.

2 participants