Skip to content

Commit 202a44c

Browse files
roodboiclaude
andcommitted
fix(agents): keep feedback commands open to the end of their line
A review found four bypasses in the free-text command scan. A code span ended a command, so a name quoted after it survived. A command now stays open to the next line break, across code spans and the prose between them. Prose keeps registered error codes, punctuation and an HTML comment end; code keeps none of them, and a comment end no longer stops matching. Only the raw line closes a fence, and an indented line after a blank line reads as code. The Unicode format-character class replaces the zero-width list, both as a separator and inside the word hack. The hack-dance/ prefix no longer exempts a command. A bare repository reference with no words after it does not match, and launcher and version spellings such as hack-local and hack@latest are commands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent edb65b3 commit 202a44c

6 files changed

Lines changed: 445 additions & 128 deletions

File tree

‎docs/agent-guidance.md‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,17 @@ single-label machine name, a bare username, a relative project path or a project
142142
service, branch, repository or organization name in prose can still pass, so the
143143
user's review of the exact payload still matters.
144144

145-
Command matching fails closed. Inside code spans and fences, `hack` in any case and
146-
every word after it read as a command. In prose, so does a lowercase `hack`, even
147-
when the next word is not a command; a capitalized `Hack` in prose is the product
148-
name and is not matched. Prose is redacted to the end of its line, keeping only
149-
registered error codes, so drafts should keep commands in code spans. Flag values
150-
are always replaced, including enum and number values the spec could validate.
145+
Command matching fails closed. Inside code spans, fences and indented code, `hack`
146+
in any case starts a command. In prose, so does a lowercase `hack`, even when the
147+
next word is not a command; a capitalized `Hack` in prose is the product name and is
148+
not matched. Launcher and version spellings such as `hack-local` and `hack@latest`,
149+
and a repository prefix such as `hack-dance/hack up`, count too; a bare repository
150+
reference with no words after it does not. A command stays open to the end of its
151+
line, across code spans and the prose between them. Every later word on that line is
152+
an argument: prose keeps registered error codes, sentence punctuation and an HTML
153+
comment end, and code keeps none of them. So a draft should end each line with its
154+
command and put any error code before it. Flag values are always replaced, including
155+
enum and number values the spec could validate.
151156

152157
Skill candidates and where their patterns live now:
153158

‎plugins/hack/skills/hack-feedback/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ uses the user's existing tooling, once, after that approval.
2424
## Gather facts
2525

2626
1. Record the installed version with `hack version`, the OS and architecture, and the channel (stable or next) only when you observed it.
27-
2. Write the command shape that showed the problem, with every value replaced by a placeholder, for example `hack up --branch <name> --json`. Keep only the command path and flag names, and put every command in a code span. In prose, write `Hack` for the product: a lowercase `hack` followed by other words reads as a command, and those words are replaced. If the original arguments were not kept, or it was not a `hack` command, write `unknown`; never reconstruct them.
27+
2. Write the command shape that showed the problem, with every value replaced by a placeholder, for example `hack up --branch <name> --json`. Keep only the command path and flag names, put every command in a code span, and end the line with it: every later word on that line, in prose or in another code span, is replaced, except registered error codes in prose. So give each command its own line and put an error code before it. In prose, write `Hack` for the product: a lowercase `hack` followed by other words reads as a command. If the original arguments were not kept, or it was not a `hack` command, write `unknown`; never reconstruct them.
2828
3. Describe observed behavior in words, with the error code from a `--json` envelope, and expected behavior with the doc, help text or earlier behavior that supports it.
2929
4. Pick one reproduction status. Call a problem reproduced only after repeating it:
3030

‎plugins/hack/skills/hack-feedback/references/examples.md‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ the mistakes that make a report misleading or unsafe to post.
55

66
## A useful report
77

8-
Title: `hack up --branch` times out with E_STARTUP_TIMEOUT while the primary instance runs
8+
Title: E_STARTUP_TIMEOUT while the primary instance runs: `hack up --branch`
99

1010
````markdown
1111
## Observed behavior
1212

13-
`hack up --branch <name> --json` exited 1 with `E_STARTUP_TIMEOUT` after about two minutes. `hack ps --json` then listed the branch instance's `<service>` as starting, not healthy.
13+
After about two minutes, `E_STARTUP_TIMEOUT` and exit 1 came from `hack up --branch <name> --json`.
14+
15+
The branch instance's `<service>` was listed as starting, not healthy, by `hack ps --json`.
1416

1517
## Expected behavior
1618

@@ -22,7 +24,7 @@ Status: partially-reproduced. Only some steps or some runs show the problem; say
2224

2325
1. Start the primary instance with `hack up`.
2426
2. Run `hack up --branch <name> --json`.
25-
3. Stop it with `hack down --branch <name>` and repeat step 2.
27+
3. Repeat step 2 after stopping it with `hack down --branch <name>`.
2628

2729
Two of three attempts timed out; the third started normally.
2830

@@ -35,7 +37,7 @@ Two of three attempts timed out; the third started normally.
3537
## Evidence
3638

3739
- [observed] The JSON envelope had `ok: false` and code `E_STARTUP_TIMEOUT`.
38-
- [observed] `hack ps --json` showed `<service>` as starting for the branch instance only.
40+
- [observed] Only the branch instance's `<service>` showed as starting in `hack ps --json`.
3941
- [source] The hack-branches skill says branch instances run side by side.
4042
- [inferred] Both instances may wait on the same dependency cache; not verified.
4143

@@ -94,4 +96,4 @@ None.
9496

9597
---
9698

97-
Content revision: `1d4cae64214a`. Generated by Hack; edit the canonical source and regenerate the plugin.
99+
Content revision: `36a361121195`. Generated by Hack; edit the canonical source and regenerate the plugin.

0 commit comments

Comments
 (0)