Skip to content

docs+ci: resolve conflicting agent instructions, make pnpm verify match CI - #269

Merged
benders merged 2 commits into
mainfrom
fix/267-agent-instruction-conflicts
Sep 3, 2026
Merged

benders merged 2 commits into
mainfrom
fix/267-agent-instruction-conflicts

Conversation

@benders

@benders benders commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Closes #267.

Five instruction conflicts, each of which could send an agent the wrong way, plus a local gate that was weaker than CI.

a. Issues close on merge

AGENTS.md told agents to close the issue "immediately after committing" while also writing closes #N and ending in a Draft PR — that closes issues while review is still pending. Now: reference closes #N, let the merge do it, never hand-close at commit time.

b. AGENTS.md no longer duplicates the architecture

Its own §Documentation rules forbid architecture in the file, but §Hub/Player boundary carried ~20 lines lifted from docs/system-architecture.md — including a second copy of the playerFiles glob list, which would have drifted. Reduced to seven rule lines; architecture referenced by path.

c. CLAUDE.md holds only Claude-unique rules

Its §Workflow was general process, duplicating the AGENTS.md checklist against its own closing rule. Removed; FROM @claude: and the Write-tool control-character gotcha stay.

d. Commit rules consolidated

New AGENTS.md §Branching and commits. Feature branch is the default. Direct-to-main needs an explicit ask, and committing or pushing there each need their own — the old wording let the checklist's unconditional "commit in phases" override CLAUDE.md's "never automatically commit on main".

e. pnpm verify matches CI

before after
pnpm verify typecheck + lint:boundary + test typecheck + lint + test + test:integration
CI unit job typecheck + lint:boundary + test + test:integration + lint

A green verify could previously still fail CI two ways: full-lint warnings (which AGENTS.md demanded separately, three bullets deep) and test:integration. Full lint subsumes the boundary rules; lint:boundary stays a separate script so CI keeps an isolated boundary signal.

Verification

Typecheck, full lint (zero output), 166 frontend + hub unit tests, and integration tests all green locally. The first run hit one integration failure — a pre-existing SSDP multicast flake, ~1 run in 3, unrelated to this change and filed as #268.

Not in this PR: the documentation-drift findings from the same review (stale /admin/activity/* paths in hub-internals.md, the merge-worker gap in system-architecture.md). Those get their own issue.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q6d5j3DE1sqf6Gm34gEAAN

…closes #267)

Five conflicts between AGENTS.md, CLAUDE.md and the code, each of which
could send an agent the wrong way:

- Issue closing: "close immediately after committing" contradicted both
  `closes #N` in the commit message and the draft-PR review flow. Issues
  now close on merge; hand-closing at commit time is called out as wrong.
- AGENTS.md violated its own "no architecture in this file" rule with ~20
  lines duplicated from docs/system-architecture.md, including a second
  copy of the playerFiles glob list. Reduced to the rule-shaped lines,
  with the architecture referenced by path.
- CLAUDE.md violated its own "nothing here unless unique to Claude Code"
  rule with a general workflow section. Only the `FROM @claude:` prefix
  and the Write-tool control-character gotcha remain.
- Commit rules were split across both files and ambiguous on `main`. Now
  consolidated in AGENTS.md under "Branching and commits": feature branch
  is the default, and committing or pushing on `main` each need their own
  explicit ask.
- `pnpm verify` was weaker than CI: it ran only lint:boundary, while CI's
  unit job also ran test:integration and AGENTS.md separately demanded a
  clean full lint. A green verify could still fail CI.

verify is now typecheck + lint + test + test:integration, and CI's unit
job gains the full lint step, so the two genuinely match. lint:boundary
stays a separate script for CI's isolated boundary signal.

Gate run locally: typecheck, full lint, 166 frontend + hub unit tests,
and integration tests all green. The one integration failure seen on the
first run is a pre-existing SSDP multicast flake, filed as #268.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q6d5j3DE1sqf6Gm34gEAAN
…267)

The note blamed the Write tool and regex character classes. Neither is
the mechanism: every tool argument arrives as a JSON string, so the
decoder turns the escape into a real control byte before any tool runs.
Write, Edit and Bash all do it — Bash is just the one that rejects the
call outright instead of writing the byte.

Adds the prevention (double the backslash) alongside the existing
repair, and states the range as U+0000-U+001F so the prose no longer
needs an inline escape that would itself decode. Hit a third time while
editing this very line.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q6d5j3DE1sqf6Gm34gEAAN
@benders
benders marked this pull request as ready for review September 3, 2026 16:00
@benders
benders merged commit 5f72f53 into main Sep 3, 2026
2 checks passed
@benders
benders deleted the fix/267-agent-instruction-conflicts branch September 3, 2026 16:05
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.

docs+tooling: resolve conflicting agent instructions and make pnpm verify match CI

2 participants