Skip to content

/commit stops at the commit; new issues always pass a duplicate check; #155 review fixes and doc re-sync - #163

Merged
pedrohcgs merged 3 commits into
mainfrom
fix/v2.6.0-figures-and-doc-sync
Sep 27, 2026
Merged

pedrohcgs merged 3 commits into
mainfrom
fix/v2.6.0-figures-and-doc-sync

Conversation

@pedrohcgs

@pedrohcgs pedrohcgs commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

Changed defaults

  • /commit commits only. Pushing and opening a PR need --pr (or asking); it never merges.
  • A new PreToolUse hook, issue-guard.py, denies gh issue create / gh issue new / REST and GraphQL issue creates run by Claude, and points to python3 scripts/file-issue.py. Uses the hooks if field (Claude Code ≥ 2.1.85); on older versions it runs on every Bash call, still correctly.
  • A new SessionStart hook, open-issues.py, is wired but off unless CLAUDE_ISSUES_AT_START=1.
  • Hook count 9 → 11; hook battery 253 → 312 cases.
  • /deep-audit is user-invoked again (disable-model-invocation: true, lost in the v2.5 merge).

Type

  • Bug fix (fix/...)
  • New feature: skill / agent / rule / hook (feat/...)
  • Docs / guide / README (docs/...)
  • Chore / cleanup (chore/...)

Test plan

Generality (for new skills/agents/rules)

  • Works for ≥2 academic domains — issues for papers, code, and slides
  • No hardcoded paths, machine-specific config, or institutional branding
  • No project-specific examples in shared infrastructure

Notes for reviewer

… duplicate check

/commit ran the gates, committed, pushed, opened a pull request and merged it in
one go, so PR #155 merged before Codex or Copilot had commented. It now commits
only; --pr pushes and opens a pull request; merging is never a step of the skill
and happens only when the owner says to merge that pull request.

Issues as the project's memory:
- /issues files findings as issues, lists what is open, and closes an issue with
  a comment on what was tried and how it was fixed. It shows every draft first.
- scripts/file-issue.py is the one route for a new issue: several searches over
  open and closed issues, exit 3 until each candidate is reviewed (--checked),
  fails closed when a search cannot run, and records the check in the body.
- issue-guard.py (PreToolUse, "if": "Bash(gh *)") denies a raw gh issue create,
  or a REST/GraphQL create, and points to the script; it costs nothing on other
  commands.
- open-issues.py (SessionStart, opt-in with CLAUDE_ISSUES_AT_START=1) lists open
  issues' titles by the owner and collaborators at startup.
- Battery 253 -> 296 cases; each piece qualified on a seeded fault; LEDGER rows.

Fixes from the PR #155 review (Refs #156, #157, #158, #159, #160, #161):
05_figures.R checks the PDF device by opening it and stops if a figure was not
written; /replication-package writes sessionInfo_stata.txt; "forked context"
corrected where a fresh context is required; slide-qa exits 2 when math never
typeset and reports every defect on a slide; quarto-critic cannot approve with
major issues open.

Documentation (Refs #162): 131 statements corrected, then a second independent
pass over README, guide, CLAUDE.md and the landing page checked 865 statements
and corrected 44 more; a third pass checked those corrections. /preregister now
reads the paper type /interview-me actually writes; check-derived-counts counts
translate-to-quarto's Phase 6.5. Guide re-rendered and stamped.

Gates: ./scripts/backtest.sh exits 0 (10 gates, 296 battery cases); guide and
05_figures.R score 100/100.
Copilot AI lite review requested due to automatic review settings September 27, 2026 03:39
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 27, 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-09-27T03:56:49.734937Z baef832 Manual request
ℹ️ 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.

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

unresolved critical and moderate findings affect issue-creation safety, data disclosure, cleanup, and runtime behavior.

Review effort: Lite
Findings: 2 High severity · 1 Medium severity

Open (3)
What changed in this PR

This PR separates /commit from PR creation and merging, adds duplicate-checked issue workflows and hooks, and synchronizes related documentation and tooling.

Changes:

  • /commit now stops after committing; --pr enables pushing and opening a PR.
  • Adds /issues, duplicate checking, issue guards, and opt-in startup issue listing.
  • Updates slide QA, R figure validation, repository conventions, and documentation.
File Summary Final review notes
TROUBLESHOOTING.md Updated troubleshooting guidance. —
templates/​skill-template.md Updated persistence and skill-count guidance. —
templates/​PROVENANCE.md Moves provenance output under quality_reports/. —
templates/​preregistration-template.md Corrects repository wording. —
scripts/​slide-qa.py Reports multiple defects and fails on unrendered math. —
scripts/​R/​README.md Clarifies pipeline execution and verification. —
scripts/​R/​05_figures.R Adds graphics-device probing and artifact validation. —
scripts/​hook-battery.sh Adds issue-workflow qualification cases. —
scripts/​file-issue.py Adds duplicate-checked issue creation. Critical (1 vote): raw search queries can leak restricted paths. Moderate (3 votes): temporary issue-body files are not cleaned up.
scripts/​check-repo-hygiene.py Allows replication-package output. —
scripts/​check-derived-counts.py Corrects fractional phase counting. —
README.md Synchronizes counts, defaults, and workflow descriptions. Nit (1 vote): the guide does not reflect the newly advertised Phase 6.5.
Preambles/​README.md Clarifies palette and TikZ conventions. —
docs/​index.html Synchronizes landing-page counts and gate wording. —
CLAUDE.md Updates commands, issue workflow, and file-size guidance. —
CHANGELOG.md Records commit, issue, QA, and documentation changes. —
.render-stamp Updates rendered-guide fingerprints. —
.github/​CONTRIBUTING.md Updates surface-sync instructions. —
.claude/​skills/​syllabus/​SKILL.md Moves default syllabus output. —
.claude/​skills/​stata-replication/​SKILL.md Updates monitoring instructions. Moderate (1 vote): the required Monitor tool is absent from allowed-tools.
.claude/​skills/​simulation-study/​SKILL.md Documents log-based monitoring. —
.claude/​skills/​seven-pass-review/​SKILL.md Adds issue-tracking guidance. —
.claude/​skills/​scaffold-exercises/​SKILL.md Moves default outputs under quality reports. —
.claude/​skills/​review-paper/​SKILL.md Adds issue-tracking guidance. —
.claude/​skills/​respond-to-referees/​SKILL.md Standardizes report output paths. —
.claude/​skills/​respond-to-eval/​SKILL.md Updates verifier terminology. —
.claude/​skills/​replication-package/​SKILL.md Corrects the Stata environment filename. Nit (1 vote): published guide copies still document the stale filename.
.claude/​skills/​r-package-check/​SKILL.md Updates long-running check guidance. —
.claude/​skills/​qa-quarto/​SKILL.md Requires no major or critical findings for approval. —
.claude/​skills/​promote-memory/​SKILL.md Clarifies native-memory inputs. —
.claude/​skills/​preregister/​SKILL.md Corrects paper-type and verifier wording. —
.claude/​skills/​new-skill/​SKILL.md Updates integrity and surface-sync guidance. —
.claude/​skills/​issues/​SKILL.md Adds issue filing, listing, and closure workflow. —
.claude/​skills/​grant-proposal/​SKILL.md Corrects paper-type extraction. —
.claude/​skills/​deep-audit/​SKILL.md Updates orchestration and model guidance. —
.claude/​skills/​deep-audit/​references/​repo-infrastructure-audit.md Expands mechanical audit guidance. —
.claude/​skills/​data-management-plan/​SKILL.md Clarifies delegated skill usage. —
.claude/​skills/​data-analysis/​SKILL.md Documents log-based monitoring. —
.claude/​skills/​compress-session/​SKILL.md Clarifies memory and hook behavior. —
.claude/​skills/​commit/​SKILL.md Separates commit, PR, and merge operations. —
.claude/​skills/​coauthor-brief/​SKILL.md Updates commit and pipeline guidance. —
.claude/​skills/​adjudicate-review/​SKILL.md Adds issue-tracking guidance. —
.claude/​settings.json Wires issue guard and optional issue listing. —
.claude/​rules/​verification-protocol.md Integrates browser-based slide QA. —
.claude/​rules/​tikz-prevention.md Uses the shared TikZ checker. —
.claude/​rules/​tikz-measurement.md References the shared checker. —
.claude/​rules/​review-fencing.md Expands fenced answer-key files. —
.claude/​rules/​repo-hygiene.md Refines draft-name detection. —
.claude/​rules/​replication-protocol.md Updates passport integration. —
.claude/​rules/​r-code-conventions.md Corrects palette and scoring wording. —
.claude/​rules/​proofreading-protocol.md Clarifies report ownership. —
.claude/​rules/​progress-reports.md Documents ignored quality-report paths. Nit (1 vote): two phrases describing git add -f are grammatically malformed.
.claude/​rules/​post-flight-verification.md Updates verifier and opt-out guidance. Nit (1 vote): the named skill list is incomplete.
.claude/​rules/​orchestrator-protocol.md Updates deep-audit terminology. —
.claude/​rules/​model-routing.md Corrects current agent responsibilities. —
.claude/​rules/​meta-governance.md Clarifies auto-memory limits. —
.claude/​rules/​issue-ledger.md Defines issue and closure requirements. —
.claude/​references/​verification-ladder.md Corrects independence terminology. —
.claude/​references/​theory-proving.md Updates convergence wording. —
.claude/​references/​scheduled-routines.md Updates routine count. —
.claude/​references/​research-agent-laws.md Defines two-strikes identity. Nit (1 vote): the documented stable locus identity does not match the implemented line-based ID.
.claude/​references/​provenance-and-ground-truth.md Moves provenance location. —
.claude/​references/​orchestration-schemas.md Clarifies fresh-agent contexts. —
.claude/​references/​discipline-cards.md Corrects consumer documentation. —
.claude/​references/​audit-pet-peeves.md Updates checker references. —
.claude/​hooks/​open-issues.py Adds opt-in startup issue listing. —
.claude/​hooks/​issue-guard.py Blocks unchecked issue creation. Critical (1 vote): shell control constructs can bypass the guard despite its documented coverage. Nit (1 vote): the documented /path/to/gh limitation is inaccurate.
.claude/​hooks/​git-guardrails.py Updates commit workflow documentation. —
.claude/​agents/​verifier.md Clarifies R pipeline verification. —
.claude/​agents/​quarto-critic.md Corrects approval criteria. —
.claude/​agents/​promote-memory-council.md Corrects context terminology. —
.claude/​agents/​humanize-auditor.md Clarifies voice-profile location. —
.claude/​agents/​claim-verifier.md Clarifies fresh-context terminology. —

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .claude/hooks/issue-guard.py Resolved
Comment thread scripts/file-issue.py Resolved
Comment thread scripts/file-issue.py Resolved

@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: 0425fd64dc

ℹ️ 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 .claude/hooks/issue-guard.py Outdated
Comment on lines +203 to +205
joined = " ".join(args)
if len(pos) >= 2 and pos[1] == "graphql":
return "createIssue" in joined

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 Deny GraphQL mutations loaded from files

A GraphQL issue mutation is allowed whenever the mutation text is outside the command line, for example gh api graphql --input payload.json or gh api graphql -F query=@mutation.graphql, because this branch only searches the argument string for createIssue. The checked gh api --help confirms that --input reads a pre-constructed request body and that a field value beginning with @ is read from a file, so either form can create an issue without running scripts/file-issue.py; conservatively deny file-backed GraphQL payloads unless they can be proven not to contain createIssue.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Confirmed and fixed in baef832 (#164). For gh api graphql the guard now reads the query file named by --input FILE or -F key=@file and denies when it holds createIssue; stdin (@-) and a file it cannot read are denied, since they cannot be checked. A read query from a file stays allowed. Pinned by g27–g29, control g32.

Comment thread .claude/hooks/issue-guard.py Outdated
Comment on lines +82 to +86
for m in HEREDOC.finditer(line):
delim = m.group(2)
while i < len(lines) and lines[i].strip() != delim:
i += 1
i += 1 # the closing delimiter line

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 Recognize heredocs only in executable shell syntax

The heredoc scan treats <<WORD inside quoted strings and comments as a real opener and removes subsequent commands from inspection. For example, gh --version # use <<EOF\ngh issue create -t x -b y\nEOF executes the issue creation in Bash, but this function strips that line and the hook emits no denial; this bypasses the duplicate check in an ordinary compound command that is guaranteed to trigger the gh hook filter. Make heredoc recognition quote- and comment-aware before discarding bodies.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Confirmed and fixed in baef832 (#164). Heredoc detection is now a quote- and comment-aware scan: a <<EOF inside a comment or a quoted string no longer starts a heredoc, so the create on the next line is seen and denied. Pinned by g30–g31; the earlier heredoc cases (g10, g17) still pass.

…L query files; issue bodies no longer record search text

PR #163 review (Copilot, Codex), Refs #164. Each finding was reproduced first.
- issue-guard: skips if/then/else/while/until/do/{/! before gh; reads a GraphQL
  query file (--input FILE, -F key=@file) and denies stdin or an unreadable
  file; honours a heredoc opener only outside quotes and comments.
- file-issue.py: the issue body records how many searches of each kind ran,
  not their text; the temp file holding the body is removed after a create.
- Battery 296 -> 308 cases; the pre-fix versions turn red exactly g23-g31, i9,
  i10. Backtest exits 0.
@pedrohcgs

Copy link
Copy Markdown
Owner Author

@codex review — please review baef832 (fixes for the five findings on 0425fd6, tracked in #164).

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

ℹ️ 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 .claude/hooks/issue-guard.py Outdated
Comment on lines +121 to +123
if c == "#" and (i == 0 or command[i - 1] in " \t;&|()"):
in_comment = True
i += 1

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 Treat hashes at the start of every line as comments

When a comment begins at column zero after the first line, command[i - 1] is "\n", so this condition does not enter comment mode. Fresh evidence beyond the earlier heredoc thread is gh --version\n# <<EOF\ngh issue create -t x\nEOF: the scanner treats the commented <<EOF as an opener, removes the real create line as heredoc data, and allows the issue creation. Include a preceding newline among the valid comment boundaries.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Confirmed and fixed in 7650048 (#164): a newline now counts as a comment boundary, so '# <<EOF' at the start of a later line is a comment and the create after it is denied. Pinned by battery case g33.

Comment on lines +152 to +155
elif a in GQL_FILE_FLAGS and i + 1 < len(args) and "=@" in args[i + 1]:
paths.append(args[i + 1].split("=@", 1)[1])
elif a.startswith("--field=") and "=@" in a[len("--field="):]:
paths.append(a[len("--field="):].split("=@", 1)[1])

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 attached -F values before allowing GraphQL

The new file scan recognizes -F query=@file but not the equivalent attached short-option form -Fquery=@file. Fresh evidence beyond the prior GraphQL thread is that local gh 2.96.0 accepts gh api graphql -Fquery=@mutation.graphql and proceeds to the HTTP request; gh api --help identifies this option as -F, --field key=value. Because the argument does not itself contain createIssue, a mutation loaded through this accepted form bypasses the guard.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Confirmed and fixed in 7650048 (#164): the attached form -Fquery=@file is parsed like -F query=@file, and the file is read. Pinned by g34.

Comment on lines +64 to +66
# Shell reserved words that can stand before a command in the same segment
# (`if true; then gh issue create; fi` splits into `then gh issue create`).
RESERVED = {"if", "then", "else", "elif", "while", "until", "do", "{", "!"}

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 Inspect creates inside invoked Bash function declarations

When a compound command declares and invokes a function, such as function f { gh issue create -t x; }; f, the issue is created but the first segment starts with the unrecognized function reserved word, so strip_prefix never reaches gh; the later invocation segment contains only f. This leaves a normal inline Bash control construct uncovered by the new control-word handling.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Confirmed and fixed in 7650048 (#164): 'function NAME' is skipped before looking for gh, so a create inside a function declared on the line is denied (the NAME() { ...; } form was already covered by the { handling). Pinned by g35.

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Critical and moderate findings remain unresolved in issue guarding, duplicate checking, privacy handling, and related documentation.

Review effort: Lite
Findings: 2 High severity · 1 Medium severity · 1 Low severity

Open (4)
Resolved since last review (3)

Comment thread .claude/hooks/issue-guard.py Outdated
Comment on lines +248 to +251
elif w in WRAPPERS:
i += 1
while i < len(words) and words[i].startswith("-"):
i += 1 # env -i, sudo -E, ...

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Confirmed and fixed in 7650048 (#164): wrapper options that take a value (sudo -u/-g/-h/-C/..., env -u/-C/-S) now consume it, so 'sudo -u analyst gh issue create' is denied. Pinned by g36.

Comment thread scripts/file-issue.py
Comment on lines +73 to +74
for p in list(dict.fromkeys(PATH.findall(title + "\n" + body)))[:3]:
qs.append(("file paths", f'"{p}"'))

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Declining, with reasons. A search request is sent to the GitHub API but is not published; what is published is the issue body, and the path queries are drawn from that same body the author is about to post. The rule that matters sits one step earlier: restricted paths must not be in the draft at all (issue-ledger.md, confidential-data.md, and the /issues skill's constraints). Moving the protection to the search step would still leave the body carrying the path.

Comment thread templates/skill-template.md Outdated
- Create new persistent source files (`/create-lecture` → new `.tex`, `/new-diagram` → new TikZ source).
- Write a self-modifying artifact (`/learn` → new SKILL.md, `/checkpoint` → state snapshot, `/preregister` → preregistration document).
- Run a destructive cycle (`/deep-audit` → repo-wide fix loop).
- Run a long, file-writing cycle (`/simulation-study` → seeded Monte Carlo run and results, `/vaccinate` → qualification-ledger row).

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Confirmed and fixed in 7650048: /deep-audit had lost disable-model-invocation: true when the v2.5 verification skills were merged. The flag is restored, so a vague 'audit this' cannot start its fix loop, and the skill template lists it again.

Comment thread CHANGELOG.md Outdated
Comment on lines +270 to +271
- **Gates:** `./scripts/backtest.sh` passes all 10 gates, including the hook battery
(253 cases, seconds to run; the new case fails against the hook's old watch pattern).
(308 cases, seconds to run; the new case fails against the hook's old watch pattern).

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Confirmed: the PR description is updated to the current count (312 cases after the second-round fixes).

… function bodies and sudo -u; /deep-audit is user-invoked again

Second PR #163 review (Codex, Copilot), Refs #164. Each finding reproduced first.
- issue-guard: a # at the start of a later line starts a comment; the attached
  -Fquery=@file form is read; 'function NAME' is skipped; wrapper options that
  take a value (sudo -u USER, env -u VAR) are skipped.
- /deep-audit regains disable-model-invocation: true (lost in the v2.5 merge),
  so a vague 'audit this' cannot start its repo-wide fix loop; the skill
  template lists it again.
- Battery 308 -> 312 cases; the previous guard turns red exactly g33-g36.
  Backtest exits 0.
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