feat: science projects inherit the PyAuto* API code-gate via refer-back#48
Merged
Conversation
…ck (#47) The Create scaffold now generates a thin .claude/settings.json whose PreToolUse(Bash) hook resolves the assistant at runtime ($AUTOLENS_ASSISTANT -> sibling -> sources/ clone) and execs the assistant's validate_pyauto_code.py — nothing vendored, no absolute paths, on by default and fail-open when no assistant clone resolves. The generated AGENTS.md gains a Code gate section with the cross-tool caveat (hooks are Claude Code-only; other harnesses self-enforce via audit_skill_apis.py --code/--file). Validated end-to-end: deny on dead symbol via env-var and sibling resolution, allow on valid symbol, silent fail-open with no assistant. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #47.
Summary
Generated science projects now ship the assistant's PyAuto* API code-gate via refer-back:
start-new-projectscaffolds a thin.claude/settings.jsonwhose PreToolUse(Bash) hook resolves the assistant at runtime ($AUTOLENS_ASSISTANT→ sibling../autolens_assistant→sources/autolens_assistant) andexecs the assistant'svalidate_pyauto_code.py. The validator stays in one place (validate_pyauto_code.pyresolvesaudit_skill_apis.pyrelative to itself) — the project vendors nothing and bakes in no absolute paths. On by default, fail-open: no assistant clone → silent allow. The generatedAGENTS.mdtemplate gains a "Code gate" section with the cross-tool caveat (only Claude Code runs.claude/hooks; Codex/Gemini/chat self-enforce withaudit_skill_apis.py --code/--file).Strengthens the fork-and-continue story from #45: a collaborator who clones a project inherits the same code-grounding protection.
Scripts Changed
None — documentation/scaffold-template only (
skills/start-new-project.md).Validation
Scratch project with the exact generated
settings.json, fake PreToolUse payloads:al.FitImagingPlotter) + assistant via$AUTOLENS_ASSISTANT→ deny with the gate reportal.Tracer) → allow (no output)--check-citations: 90 files, 388 citations, 0 missing, 0 warningsReadiness
Heart YELLOW on the standing 6-reason set only (human-acked repeatedly 2026-07-10); docs-only, not on the library release train.
🤖 Generated with Claude Code