Skip to content

docs: fix stale file path references#4

Merged
SuuBro merged 1 commit into
masterfrom
staff-technical-writer-b1c43cc7
Mar 24, 2026
Merged

docs: fix stale file path references#4
SuuBro merged 1 commit into
masterfrom
staff-technical-writer-b1c43cc7

Conversation

@SuuBro
Copy link
Copy Markdown
Owner

@SuuBro SuuBro commented Mar 24, 2026

Fixes 10 stale path references across 3 doc files:

  • README.md: workflows/.bobbit/config/workflows/
  • docs/dev-workflow.md: config/system-prompt.md.bobbit/config/system-prompt.md; tests/playwright-e2e.config.tsplaywright-e2e.config.ts (root)
  • docs/goals-workflows-tasks.md: Fixed 7 paths (extensions/, roles/, workflows/) to include correct .bobbit/ prefix

@SuuBro SuuBro merged commit 21e1556 into master Mar 24, 2026
ajonkisz added a commit that referenced this pull request Mar 29, 2026
* Add markdown rendering for web_fetch preview

- Create MarkdownWebContent custom element with preview/raw toggle
- Add isMarkdownContent() detection (URL-based + content heuristics)
- Conditionally render markdown-block for markdown content in WebFetchRenderer

Co-Authored-By: Bobbit <noreply@bobbit.dev>

* Add unit tests for isMarkdownContent detection heuristics

- tests/fixtures/markdown-web-content.html: file:// fixture with inline
  isMarkdownContent function matching the design doc spec
- tests/markdown-web-content.spec.ts: 17 Playwright tests covering:
  - URL-based detection (.md, .markdown, query params, hash, case-insensitive)
  - Content-based detection (headings+links, frontmatter, code fences, bold+lists, images)
  - False positive avoidance (plain text, single heading, HTML, JSON)
  - URL priority over content check

Co-Authored-By: Bobbit <noreply@bobbit.dev>

* Fix test fixture to match production isMarkdownContent

Co-Authored-By: Bobbit <noreply@bobbit.dev>

* Document markdown rendering in web_fetch tool previews

Co-Authored-By: Bobbit <noreply@bobbit.dev>

* Add unit tests for archived team agent filtering logic

Tests verify the fixed filtering logic from renderGoalGroup():
- Mapped members appear under live team lead
- Unmapped members (no/empty teamLeadSessionId) appear under live lead
- Members belonging to archived leads stay with their lead
- Delegates and team-lead roles are excluded
- Orphan members (pointing to non-existent lead) appear under live lead
- Unmapped fallback works when no archived leads exist
- Members from other goals are excluded

Co-Authored-By: Bobbit <noreply@bobbit.dev>

* fix: show archived team agents in sidebar when 'See Archived' toggled

Bug 1: Broaden archivedForLiveLead filter to include members with no
teamLeadSessionId or a stale one not matching any archived lead. Previously
required exact match on live lead ID, missing all unmapped members.

Bug 2: Add fallback rendering for unmapped archived members when no archived
leads exist. Previously .map() on empty archivedLeads silently dropped them.

Co-Authored-By: Bobbit <noreply@bobbit.dev>

* Fix duplicate rendering of unmapped archived members

* docs: add debugging tip for archived session sidebar rendering

Add a new entry to the Debugging tips section in AGENTS.md explaining
how archived team members are mapped to team leads in the sidebar,
including the teamLeadSessionId fallback logic in renderGoalGroup().

Co-Authored-By: Bobbit <noreply@bobbit.dev>

* feat: add Claude Code memory bridge to system prompt assembly

- Add parseMemoryFile() to parse YAML frontmatter from memory files
- Add readClaudeMd() to read CLAUDE.md with @ref resolution and dedup
- Add readClaudeCodeMemories() to read ~/.claude/projects/{cwd}/memory/*.md
- Update assembleSystemPrompt() to inject CLAUDE.md and memories
- Update getPromptSections() to expose new sections in inspector UI

Filters memory files by type (user/feedback/project), caps at 20 files
and 16000 chars total. Skips silently if directories don't exist.

Co-Authored-By: Bobbit <noreply@bobbit.dev>

* test: add unit tests for Claude Code Memory Bridge functions

Tests for parseMemoryFile, readClaudeMd, and readClaudeCodeMemories.
All tests expect 'not a function' until implementation is merged.

Covers: valid/invalid frontmatter parsing, CLAUDE.md dedup logic,
@ reference resolution, memory type filtering, 20-file cap,
16000-char content cap, MEMORY.md skip, missing directory handling.

Co-Authored-By: Bobbit <noreply@bobbit.dev>

* docs: add Claude Code memory integration section to AGENTS.md

Co-Authored-By: Bobbit <noreply@bobbit.dev>

* docs: update system prompt assembly in features.md, improve AGENTS.md memory section

Co-Authored-By: Bobbit <noreply@bobbit.dev>

---------

Co-authored-by: Artur Jonkisz <aj@Arturs-MacBook-Pro-M5-Max.local>
Co-authored-by: Bobbit <noreply@bobbit.dev>
ajonkisz added a commit that referenced this pull request May 1, 2026
…lan_status

Live-test report from agent-memory: when an architect ran as the LLM
verify step for a `parent`-workflow plan-review gate's "DAG correctness"
check, they hit an interactive permission prompt:

  > Role "Architect" doesn't have access to goal_plan_status

The architect needs to fetch the proposed plan to assess its DAG
correctness; same for the spec-auditor's "Spec completeness" check.
Both are LLM-review verify steps on the canonical parent workflow
(see `seed-default-workflows.ts` plan-review gate).

Root cause: `Children` tool group default is `ask` (intentional, so
arbitrary roles can't silently spawn child goals); only `team-lead`
overrides at the group level. Reviewer roles inherit `ask` and get
prompted at runtime, blocking the verify step until a human clicks
through.

Fix: per-tool override `goal_plan_status: allow` on architect AND
spec-auditor. Only the read-only inspection tool is opened up. The
five mutating tools (goal_spawn_child, goal_plan_propose,
goal_merge_child, goal_pause, goal_resume) remain `ask` for these
roles \u2014 the team-lead is still the only role that can mutate plan
state without a human prompt.

Resolution priority (see `tool-activation.ts::resolveGrantPolicy`):
priority #1 (role tool-specific) beats priority #4 (group default), so
the per-tool `allow` cleanly overrides the `Children: ask` group
default for these roles only.

Tests:

  tests/builtin-roles-children-policies.test.ts (NEW, 10 cases):
    - architect.toolPolicies.goal_plan_status === "allow"
    - resolveGrantPolicy("goal_plan_status", "Children", architect, ...) === "allow"
      with `Children: ask` group default
    - mutating Children tools (5) still resolve to "ask" for architect
    - same trio for spec-auditor
    - other reviewer roles (code-reviewer, security-reviewer, qa-tester)
      do NOT silently get the override (least-privilege circuit-breaker)
    - team-lead's group-level Children: allow still intact (sanity)

  Total node tests now 1557 (was 1547, +10 new).

Verified:
  - npm run check                  → passes
  - npm run test:unit (Node)       → 1557 / 1557 pass

Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
Co-Authored-By: Bobbit (Claude Opus 4 7) <bobbit@bobbit.ai>
SuuBro added a commit that referenced this pull request May 4, 2026
Sweep documentation to match the steer-subsystem rewrite (commits f37aadd, 3d3d34c, 377f4bb, 6ed08fc):

- docs/prompt-queue.md: drop dispatched-flag tracking; document shadow ledger
  (inFlightSteerTexts) lifecycle, _dispatchSteer single site, exactly-once
  force-kill recovery via _reconcileAfterAbort + enqueueAtFront.
- docs/debugging.md: rewrite Abort/steer/queue entries — duplicate-on-Stop
  is the canonical pre-rewrite bug; new diagnostic order points at ledger
  splice / reconciliation paths.
- docs/internals.md: update Steer-interruptible bash_bg wait call-site map
  (single _dispatchSteer abort site + steerQueued unblock site = 2 total),
  and the implicit-unstick paragraph that referenced the deleted
  dispatched: true flag.
- docs/features.md: replace resetDispatched()+drainQueue() with shadow-ledger
  reconciliation in the force-abort recovery summary.
- docs/testing-strategy.md / docs/testing-tier-2-5.md: drop STEER_RECEIVED
  references; document new mock contract (handlePrompt round-trip,
  transcript-only assertions).
- AGENTS.md: add 'Modify steer / queue dispatch' recipe; rewrite the
  'Live-steer lost / duplicated after Stop' debug entry; link the design
  doc from Reference docs.
- docs/design/steer-subsystem-rewrite.md: status -> implemented; append
  '9. Implementation outcome' with commit map, what landed, verification
  greps, deviations from the original design (mitigation B used; pill
  retained; reconciliation order shifted).

All four verification greps from the spec return zero (or, for grep #4,
the expected positive count) on master.

Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
SuuBro added a commit that referenced this pull request May 4, 2026
…le (#473)

* design: steer subsystem rewrite — single source of truth via SDK clearQueue()

Co-authored-by: bobbit-ai <bobbit@bobbit.ai>

* refactor(steer): remove dispatched flag, single dispatch site

- Drop QueuedMessage.dispatched and the markDispatched/removeDispatched/
  resetDispatched/dequeueUndispatched triplet from PromptQueue.
- Add PromptQueue.enqueueAtFront() for reconciliation paths.
- Replace _dispatchSteeredMessages with a single _dispatchSteer that
  removes rows from the queue *before* awaiting rpcClient.steer(); on
  RPC failure, rows are re-enqueued at the front via enqueueAtFront.
- deliverLiveSteer happy path now routes through _dispatchSteer.
- Tool-boundary and agent_end safety-net dispatchers pre-pop via
  dequeueAllSteered() and feed _dispatchSteer.
- Drop the message_end(user) -> removeDispatched() hook and the
  resetDispatched() calls in agent_end(wasAborting) and forceAbort.

Per docs/design/steer-subsystem-rewrite.md \u00a73.

Co-authored-by: bobbit-ai <bobbit@bobbit.ai>

* test(steer): drop STEER_RECEIVED mock ACK; assert on transcript/DOM

Co-authored-by: bobbit-ai <bobbit@bobbit.ai>

* test(steer): P0 reconnect/multitab/stop-exactly-once + queue unit tests

Co-authored-by: bobbit-ai <bobbit@bobbit.ai>

* Reapply "fix(review): mobile bottom-sheet popover + RP-09 submitted-flag race"

This reverts commit 1289817.

* fix(steer): shadow-ledger reconciliation on abort + AC §3 restart test

Gap-analysis findings on the implementation gate:

1. SDK reconciliation on abort (design §6.1 mitigation B). The upstream
   pi-coding-agent RPC bridge cannot be extended to proxy
   AgentSession.clearQueue(), so we mirror the SDK's text-match splice
   logic at the Bobbit layer for the abort window only:
     - inFlightSteerTexts ledger on SessionInfo, populated AFTER
       rpcClient.steer() resolves in _dispatchSteer.
     - _consumeSteerEcho() splices the entry on the matching
       message_end(role:user), mirroring agent-session.js:265-280.
     - _reconcileAfterAbort() drains the ledger and re-enqueues at front
       as steered, called from agent_end while wasAborting and from
       forceAbort after rpcClient.stop().
   This closes the live-steer-then-abort window where the SDK accepted
   a steer but the bridge died before its message_end echoed.

2. AC §3 — gateway-restart durability test. New
   tests/e2e/steer-gateway-restart.spec.ts simulates restart in the
   in-process harness via SessionManager.restoreSessions(). Asserts
   both steered messages dispatch exactly once and ordering is
   preserved across persisted-messageQueue → restoreSession →
   drainQueue.

3. Minor nits:
     - tests/e2e/ui/bg-wait-steer-stop-flow.spec.ts wraps body in
       try/finally with deleteSession cleanup.
     - tests/e2e/steer-multitab.spec.ts uses STAY_BUSY:3000 to match
       the goal spec verbatim.

Co-authored-by: bobbit-ai <bobbit@bobbit.ai>

* docs(steer): update for shadow-ledger architecture

Sweep documentation to match the steer-subsystem rewrite (commits f37aadd, 3d3d34c, 377f4bb, 6ed08fc):

- docs/prompt-queue.md: drop dispatched-flag tracking; document shadow ledger
  (inFlightSteerTexts) lifecycle, _dispatchSteer single site, exactly-once
  force-kill recovery via _reconcileAfterAbort + enqueueAtFront.
- docs/debugging.md: rewrite Abort/steer/queue entries — duplicate-on-Stop
  is the canonical pre-rewrite bug; new diagnostic order points at ledger
  splice / reconciliation paths.
- docs/internals.md: update Steer-interruptible bash_bg wait call-site map
  (single _dispatchSteer abort site + steerQueued unblock site = 2 total),
  and the implicit-unstick paragraph that referenced the deleted
  dispatched: true flag.
- docs/features.md: replace resetDispatched()+drainQueue() with shadow-ledger
  reconciliation in the force-abort recovery summary.
- docs/testing-strategy.md / docs/testing-tier-2-5.md: drop STEER_RECEIVED
  references; document new mock contract (handlePrompt round-trip,
  transcript-only assertions).
- AGENTS.md: add 'Modify steer / queue dispatch' recipe; rewrite the
  'Live-steer lost / duplicated after Stop' debug entry; link the design
  doc from Reference docs.
- docs/design/steer-subsystem-rewrite.md: status -> implemented; append
  '9. Implementation outcome' with commit map, what landed, verification
  greps, deviations from the original design (mitigation B used; pill
  retained; reconciliation order shifted).

All four verification greps from the spec return zero (or, for grep #4,
the expected positive count) on master.

Co-authored-by: bobbit-ai <bobbit@bobbit.ai>

* docs(steer): correct _reconcileAfterAbort placement in forceAbort

It runs immediately after rpcClient.stop() (post-kill), not before.
The ledger is Bobbit-owned in-process state so the timing is correct
either way, but the docs claimed pre-kill placement which is factually
wrong and could mislead someone debugging the abort path.

Co-authored-by: bobbit-ai <bobbit@bobbit.ai>

---------

Co-authored-by: Josh S. <8768403+SuuBro@users.noreply.github.com>
Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
ajonkisz added a commit that referenced this pull request May 13, 2026
Findings addressed (all required, per review):

- #1 Wire project config keys - read pre_warm_lsp, lsp_max_servers,
  lsp_idle_ttl_ms, lsp_disabled from ProjectConfigStore at supervisor
  construction. Kill switch returns lsp_unavailable from every tool.
- #2 Cold-start progress signalling - new GET /api/lsp/state probe plus
  500ms delayed status frame from the tool extension when state is
  starting/cold.
- #3 Crash detection - typescript client invokes supervisor onClose
  callback; supervisor drops dead entries; 3 crashes / 60s trips a
  5-minute cooldown. crashState map persists across entry deletions.
- #4 acquire() wired - session-setup acquires after preWarm so refcount
  reflects attached sessions; release rearms idle timer; acquire after
  release cancels armed timer.
- #5 tsconfig/package.json file-watch - fs.watch the worktree dir with
  1500ms debounce, graceful shutdown + lazy respawn.
- #6 Sandbox bridge plumbing - MultiProjectSandboxLspBridge constructed
  once SandboxManager is wired via setSandboxBridge(). Removed the
  sandboxed gate from session-setup pre-warm sites. Full container path
  round-tripping for outbound results deferred (noted in code).
- #7 Path containment in dispatch - reject absolute and dot-dot paths
  with LspUnavailableError. Tests cover both.
- #8 Removed fixed 300ms sleeps in typescript-client.spec.ts; verified
  non-flaky across 5 runs.

Tests: +7 supervisor specs (crash x2, acquire-cancels-timer, config
watch, disabled, preWarm disabled, path containment x2). All 19 tests
under tests/lsp/ pass. Tool-description budget passes (lsp counted).

Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
SuuBro added a commit that referenced this pull request May 18, 2026
* fix(staff): persist staffId on session spawn + one-shot backfill migration

Staff sessions lost their staffId association across server restart /
in-place respawn because StaffManager set `session.staffId = id` only in
memory \u2014 SessionManager.createSession() never accepted `staffId` in its
opts, so plan.staffId stayed undefined and persistOnce wrote no staffId
to disk.

On respawn, restoreSession read ps.staffId = undefined \u2192 no
BOBBIT_STAFF_ID env \u2192 defaults/tools/inbox/extension.ts gated all three
inbox tools off \u2192 staff agent could no longer mark entries complete.

Fix:
- Thread staffId through createSession opts \u2192 plan \u2192 persistOnce, so it
  lands in PersistedSession at spawn time and survives any respawn path.
- Add a one-shot startup backfill (src/server/agent/staff-backfill.ts)
  that heals existing broken sessions by matching title + worktreePath
  against the staff registry, with a loud warn log on every match
  (spec req #4). Wired from server.ts boot via
  sessionManager.backfillStaffIds(staffManager).

Regression test: tests/staff-session-staffid-persistence.test.ts \u2014
Tests 1 and 3 fail on master, pass after fix. Source guards pin the read
side (restoreSession), the write side (persistOnce), and the new
plan-builder wiring (createSession opts \u2192 plan).

Co-authored-by: bobbit-ai <bobbit@bobbit.ai>

* docs: document staffId-persistence fix + add debugging entry

Co-authored-by: bobbit-ai <bobbit@bobbit.ai>

---------

Co-authored-by: Josh S. <8768403+SuuBro@users.noreply.github.com>
Co-authored-by: bobbit-ai <bobbit@bobbit.ai>
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.

1 participant