Skip to content

Promote Prompt-Only Questions, SessionEnd Matcher Fix, and Prose Gate Fixes to Main - #1839

Merged
ptr727 merged 5 commits into
mainfrom
develop
Sep 26, 2026
Merged

ptr727 merged 5 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Promotes develop to main.

Carried

Closes #1646
Closes #1647
Closes #1638

🤖 Generated with Claude Code

ptr727 and others added 4 commits September 25, 2026 13:29
…1830)

`extracted_comments` in the prose gate read the `#` inside a bash
parameter expansion such as `${#items[@]}` as a comment opener, so a
`run:` line counting an array was judged as prose, and an `echo` string
holding one failed `comment-wrap`.

A `#` right after `$` or `${` is now skipped as a line comment marker,
read off the raw line so an escaped `$` still counts. A real leading or
trailing comment on the same line is still extracted. The wider parser
carry work for string and heredoc content stays with #1664.

A regression test covers both spellings from the issue, `$#`, the gate's
own verdict on the `echo` line, and the still-extracted leading and
trailing comments. It fails with the fix reverted.

Closes on promotion: #1646

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Fixes the comment `pr_review.py`'s refusal reader carries, per #1647.

## What changes

The inline comment above the refusal reader said a quota refusal is
cleared by waiting, which
contradicted the module docstring's own exit-code contract for `46`: a
quota refusal is
account-level state that no re-request or wait clears, so the caller
proceeds on the other
reviewers' coverage instead. The comment now says that. Behavior and
exit codes are unchanged,
this is a comment-only fix.

## Verification

`ruff check` passes on the changed file. The local strict review pass
found no issues, recorded
against develop. The prose gate's `comment-added` rule fires on this
edit as expected, since it
rewords an existing comment line, and this PR carries the `comments`
label to stand it down.

Closes on promotion: #1647

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 5 <[email protected]>
## Summary
- `registration_problems` rejected any SessionEnd group carrying a
`matcher` key at all, so an empty matcher or `*` was reported as running
on one exit reason when it actually runs on every one. Add
`matcher_covers_every_exit_reason`, the SessionEnd counterpart of
`matcher_sees_bash`, and use it in place of the bare `"matcher" in
group` check, so only a matcher naming specific reasons is reported.
- A local strict review pass over that fix found the installer's own
group-selection logic (`main`'s reinstall path) still looked only for a
matcherless group when deciding which SessionEnd group to reuse,
disagreeing with what the report now calls sound. Route that selection
through the same `matcher_covers_every_exit_reason` check so
reinstalling onto an already-sound `*`/`""` group reuses it instead of
leaving it emptied and adding a duplicate.
- Tests in `test_install.py` cover all four matcher shapes (absent,
empty, `*`, reason-specific) on the report side, and reinstall-reuse on
the `*`/`""` shapes.

Closes on promotion: #1638

## Test plan
- [x] `python3 -m unittest host-setup.agent-safety.claude.test_install`
(65 tests, all pass)
- [x] Local strict review pass recorded

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 5 <[email protected]>
…1838)

## Summary

A non-blocking question, or a closing offer of more work, was allowed as
inline prose ("A single inline question is fine"), so it landed at the
end of long reports where it was lost, and it carried no recommendation.
The rule only reached a session through `agent-conduct`, whose triggers
covered blocking questions but not offers, and the `unattended-handoff`
orchestrator had no statement about asking at all.

- `GOVERNANCE.md` "Communicating with the User": every question that is
asked goes through the interface's prompt mechanism, blocking or not, an
offer included. The numbered list is the fallback where no prompt
exists, and it opens the message rather than closing it. Whether a
question is asked now or parked as an issue stays with the parking
bullet.
- `agent-conduct`: fires whenever about to ask the user anything or
offer more work. The description's leading sentence, which duplicated
the trigger list and carried a stale count, is removed, taking the
description from 1426 to 1266 characters.
- `session-handoff`: "The Parked Decision Queue" intro names the
reordered form bullets by their current openings.
- `unattended-handoff`: the orchestrator's final message "writes nothing
else and asks nothing".
- Generated includes and distributions regenerated.

## Review

Six local strict review passes recorded. Findings fixed: a stale bullet
reference in `session-handoff`, a conflict between the new bullet and
the parking bullet, and three defects in an orchestrator closing-prompt
design that was then removed on the maintainer's call.

Declined, maintainer's call: the claim that the parking bullet does not
rule on a non-blocking, unrecorded question. That bullet already says a
question may be recorded "because the work can continue without the
answer", which leaves the agent the choice, and either way an asked
question goes as a prompt.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings September 26, 2026 00:01
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 23073ed9-434d-4d68-a789-3a9c8b740dc2


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

One updated installer diagnostic message is internally inconsistent (singular vs plural exit reasons) and should be corrected to avoid misleading reports.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Promotes develop to main, carrying fixes across the prose gate, Copilot review tooling messaging, and the Claude agent-safety installer + governance/skill text updates that tighten how user questions must be asked.

Changes:

  • Fix prose-gate comment extraction so bash parameter expansions like ${#items[@]} and $# do not start false # comments, with regression tests.
  • Update the Claude SessionEnd hook logic to treat absent/empty/* matchers as “covers every exit reason”, including reinstall reuse behavior and tests.
  • Update governance and skill text to require all questions/offers be routed through the interface prompt mechanism, not inline prose.
File Description
scripts/​tests/​test_prose_lint.py Adds regression coverage for ${#...} and $# not being misread as comments.
scripts/​pr_review.py Corrects/refines the explanatory comment for quota refusal handling.
host-setup/​agent-safety/​claude/​test_install.py Adds tests for SessionEnd matcher semantics and reinstall reuse behavior.
host-setup/​agent-safety/​claude/​install.py Implements matcher_covers_every_exit_reason and updates SessionEnd registration/reporting logic to use it.
GOVERNANCE.md Updates “Communicating with the User” to require prompts for all questions, blocking or not.
.github/​skills/​unattended-handoff/​SKILL.md Propagates the “asks nothing” requirement in unattended-handoff output text (generated copy).
.github/​skills/​session-handoff/​SKILL.md Updates handoff guidance text to reference the new “ask every question via prompt” bullet (generated copy).
.github/​skills/​agent-conduct/​SKILL.md Updates skill trigger/description to include offers of more work and prompt-only questions (generated copy).
.github/​actions/​prose-gate/​prose_lint.py Adds line_marker() to skip # immediately after $/${ during comment scanning.
.claude-plugin/​fleet-skills/​skills/​unattended-handoff/​SKILL.md Distribution copy update for unattended-handoff skill text.
.claude-plugin/​fleet-skills/​skills/​session-handoff/​SKILL.md Distribution copy update for session-handoff skill text.
.claude-plugin/​fleet-skills/​skills/​agent-conduct/​SKILL.md Distribution copy update for agent-conduct skill text.
.claude-plugin/​fleet-skills/​.source-digests/​unattended-handoff Updates source digest for unattended-handoff distribution.
.claude-plugin/​fleet-skills/​.source-digests/​session-handoff Updates source digest for session-handoff distribution.
.claude-plugin/​fleet-skills/​.source-digests/​agent-conduct Updates source digest for agent-conduct distribution.
.agents/​skills/​unattended-handoff/​SKILL.md Source skill text change for unattended-handoff.
.agents/​skills/​session-handoff/​SKILL.md Source skill text change for session-handoff.
.agents/​skills/​agent-conduct/​SKILL.md Source skill text change for agent-conduct.

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

…1841)

## Summary

The SessionEnd matcher report said the sweep "runs on that exit reason
alone", but a matcher can name several reasons, and
`matcher_covers_every_exit_reason` classifies the matcher's shape rather
than evaluating it, so a `.*` or a non-string matcher names no reason at
all. The report, the comments above it, the function's docstring
summary, and a test docstring now describe the shape (anything other
than absent, empty, or `*`) and hedge the effect ("may not run on every
exit reason").

Raised by Copilot on the promotion PR #1839.

## Review

Three local strict review passes recorded. Rounds one and two found the
replacement wording still over-claiming and two adjacent lines carrying
the same claim, all fixed. The third found no defect in the changed
lines. The match-all regex being reported at all is pre-existing
behavior, filed as #1840.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 26, 2026 00:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The changes are cohesive, align with the stated promotion goals, and include targeted tests for the new prose-gate and SessionEnd matcher behaviors.

Review effort: Lite
Findings: None

Resolved since last review (1)

@ptr727
ptr727 merged commit 4566946 into main Sep 26, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants