feat: agent nickname session scoping (Phase 8)#23
Merged
Conversation
Adds agent nickname (--nick / -n) as required session namespace to prevent cross-agent interference (issue #22). Includes: - ADR-030 in decisions.md (accepted) - Phase 8 implementation plan with resolved design: - Nick format: /^[a-z][a-z0-9]{5}$/ (exactly 6 chars) - Session ownership stamped at creation, immutable - ownerHash (salted SHA-256) in logs/responses, never raw nick - debug.log scoping via TraceEntry session field - Safety guards: min interval (900ms), metronome detection, error-path delay, per-nick rate cap - Configurable via BPROXY_HOME/config.json - Explicit ingress check ordering Closes design phase for #22. Ready for implementation.
All 15 subtasks verified implemented and passing: - instanceSalt generation, computeOwnerHash utility - Session ownership stamp on create/tab.open - Nick validation at ingress (400 on malformed) - SESSION_SCOPE_MISMATCH on owner mismatch - session.list, debug.status, debug.last, debug.log filtered by nick - SESSION_NOT_FOUND enriched with retry:never + suggestedAction - ownerHash in responses and logs (raw nick never persisted) - Schema requires nick field; all tests updated Tasks 1-3 fully implemented. pnpm check + pnpm test clean.
…bump 0.8.0 - CLI smoke integration tests: write config.json with relaxed safety params so rapid sequential commands don't hit 900ms minInterval floor - Skill docs: remove hardcoded nick examples, instruct agents to generate random unique nicks, add -n <nick> to all command examples - Add SESSION_SCOPE_MISMATCH, RATE_LIMITED, METRONOME_DETECTED to skill error reference; update SESSION_NOT_FOUND retry to 'never' - Bump all packages to 0.8.0
- safety.test.ts: remove empty object spreads (S7744) - nick-scoping.test.ts: add explicit comparator to .sort() (S2871) - daemon-config.test.ts: use String.raw for regex backslash (S7780) - lifecycle.ts S7763 (re-export style): not fixed — MINOR code smell conflicts with max-lines (300) limit; file is at boundary
- Move makeCmd/postCommand/postRaw to helpers/integration.ts - nick-scoping, safety-ordering, observability tests use shared helpers - safety.test.ts: extract metronomeHarness() for shared setup - screenshot-file.test.ts: extract takeScreenshot() helper - Targets SonarCloud new_duplicated_lines_density gate (5.9% → <3%)
- S7721: move metronomeHarness/takeScreenshot to outer scope - S4325: remove unnecessary type assertion in integration helper - S7763: use export type...from for PairingMetadata re-export - Extract lifecycle-state.ts (state-file utilities) from lifecycle.ts to bring it under 300-line limit while enabling direct re-exports
|
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.



Summary
Implements ADR-030: agent nickname session scoping.
What this adds
--nick/-nflag on every protocol command — sessions are scoped to the creating nickownerHash(sha256 with instance salt) in logs/responses, raw nick never persistedBPROXY_HOME/config.jsonfor pacing presets and safety parameters, fail-closed on invalid configSESSION_SCOPE_MISMATCH,RATE_LIMITED,METRONOME_DETECTED;SESSION_NOT_FOUNDupdated toretry: neverThis PR specifically
Quality gates
pnpm check✅ (typecheck + format + lint + arch + deadcode)pnpm test✅ (835 tests across 71 files)Closes #22