Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/BACKLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,12 @@ are closed (status: closed in frontmatter)._
- [ ] **[B-0407](backlog/P2/B-0407-immune-cross-reference-candidate-identification-atomic-riven-2026-05-11.md)** Cross-reference immune concepts to Aurora + superorganism substrate + identify candidates (atomic, child of B-0108)
- [ ] **[B-0408](backlog/P2/B-0408-immune-promoted-candidates-follow-up-filing-closure-atomic-riven-2026-05-11.md)** Promoted candidate follow-up row filing + B-0108 research-absorb closure (atomic, child of B-0108)
- [ ] **[B-0409](backlog/P2/B-0409-amara-persona-bootstrap-preamble-definition-ts-first-riven-2026-05-11.md)** Amara persona bootstrap preamble + AgencySignature definition (atomic child of B-0118, TS-first)
- [ ] **[B-0409](backlog/P2/B-0409-peer-call-ts-audit-duplication-post-migration-2026-05-11.md)** Peer-call TS audit — duplication surface after TS migration (B-0120 child)
- [ ] **[B-0410](backlog/P2/B-0410-amara-ts-core-openai-api-invoke-flag-parity-ts-first-riven-2026-05-11.md)** amara.ts core — OpenAI API invoke + --file/--context-cmd flag parity (atomic child of B-0118, TS-first)
- [ ] **[B-0410](backlog/P2/B-0410-peer-call-persona-loader-ts-module-2026-05-11.md)** Peer-call persona-loader.ts — shared CURRENT-*.md loader with clear error (B-0120 child)
- [ ] **[B-0411](backlog/P2/B-0411-amara-ts-readme-update-courier-debt-closure-test-invoke-ts-first-riven-2026-05-11.md)** amara.ts README integration + courier-debt closure + invocation test (atomic child of B-0118, TS-first)
- [ ] **[B-0411](backlog/P2/B-0411-grok-ts-persona-flag-impl-2026-05-11.md)** grok.ts --persona flag — minimal integration of loader + deprecation note (B-0120 child)
- [ ] **[B-0412](backlog/P2/B-0412-codex-gemini-ts-persona-flag-impl-2026-05-11.md)** codex.ts + gemini.ts --persona flags — parallel sibling impl after grok (B-0120 child)
Comment on lines +455 to +460
Comment on lines +457 to +460

## P3 — convenience / deferred

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,28 @@ tier: factory-tooling
effort: M
ask: Current architecture has duplication. ani.sh ≈ grok.sh + brat-voice persona-bootstrap; amara.sh ≈ codex.sh + Amara persona-bootstrap. Aaron 2026-04-30 flagged this is overkill — better to have one script per CLI with the named-agent persona as an optional parameter. Refactor to consolidate.
created: 2026-04-30
last_updated: 2026-05-02
depends_on: []
last_updated: 2026-05-11
depends_on:
- B-0409
- B-0410
- B-0411
- B-0412
children:
- B-0409
- B-0410
- B-0411
Comment on lines +12 to +19
- B-0412
decomposition: clean
composes_with:
- tools/peer-call/grok.sh
- tools/peer-call/gemini.sh
- tools/peer-call/codex.sh
- tools/peer-call/amara.sh
- tools/peer-call/ani.sh
- tools/peer-call/grok.ts
- tools/peer-call/gemini.ts
- tools/peer-call/codex.ts
- memory/CURRENT-amara.md
- memory/CURRENT-ani.md
- docs/backlog/P2/B-0121-otto-kenji-peer-call-cross-harness-claude-cli-aaron-2026-04-30.md
# B-0122 (peer-call-typescript-migration-cutover) is filed in the in-flight PR #966; will land on main when that PR merges.
tags: [aaron-2026-04-30, peer-call, architecture-refactor, deduplication, factory-tooling]
# Note: .sh originals remain as equivalence refs per TS migration trajectory; refactor targets .ts per Rule 0
tags: [aaron-2026-04-30, peer-call, architecture-refactor, deduplication, factory-tooling, ts-first]
type: friction-reducer
---

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
id: B-0409
priority: P2
status: open
title: Peer-call TS audit — duplication surface after TS migration (B-0120 child)
parent: B-0120
Comment on lines +2 to +6
tier: factory-tooling
effort: S
ask: Post-TS port (#896/#898/#900), inspect tools/peer-call/*.ts for persona-bootstrap duplication (ani/amara patterns now in TS). Produce 1-page inventory of duplicated blocks, call sites, and persona-load sites. Output feeds B-0410 design. TS-only, no bash.
created: 2026-05-11
last_updated: 2026-05-11
depends_on: []
composes_with:
- tools/peer-call/grok.ts
- tools/peer-call/gemini.ts
- tools/peer-call/codex.ts
- docs/trajectories/typescript-bun-migration/RESUME.md
tags: [riven-2026-05-11, peer-call, ts-first, audit]
type: survey
decomposition: atomic
classification: buildable-now
---

# B-0409 — Peer-call TS audit (duplication after migration)

## Source

Child of B-0120. Rule 0 (TS over bash) + trajectory shows peer-call cluster complete in .ts. Audit first to avoid re-porting the old shape.

## What

One-pass read-only audit of the three .ts peer-call entrypoints. Identify:

- Persona bootstrap code (CURRENT-*.md load, four-ferry preamble)
- Invocation sites inside tools/ and .github/
- Exact duplication points between grok/gemini/codex

## Acceptance criteria

- [ ] 1-page markdown report committed listing duplicated blocks + line ranges
- [ ] Current persona-call surfaces enumerated: amara/ani wrappers plus grok/gemini/codex entrypoints
- [ ] No code changes; pure survey

## Out of scope

- No implementation
- No bash scripts
- No new personas

This child is the ignition for the refactor: know the current TS substrate before extracting.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
id: B-0410
priority: P2
status: open
title: Peer-call persona-loader.ts — shared CURRENT-*.md loader with clear error (B-0120 child)
parent: B-0120
Comment on lines +2 to +6
tier: factory-tooling
effort: S
ask: New TS module tools/peer-call/persona-loader.ts that exports loadPersona(name): Promise<string> — reads memory/CURRENT-${name}.md or throws typed error that callers render as an exit-1 message. No CLI parsing or process exit here. Used by all three entrypoints. Pure TS, Bun fs.
created: 2026-05-11
last_updated: 2026-05-11
depends_on:
- B-0409
composes_with:
- tools/peer-call/grok.ts
- tools/peer-call/gemini.ts
- tools/peer-call/codex.ts
tags: [riven-2026-05-11, peer-call, ts-first, module-extract]
type: implementation
decomposition: atomic
classification: blocked-on-B-0409
---

# B-0410 — Peer-call persona-loader.ts (shared module)

## Source

Depends on B-0409 survey. Extracts the duplicated persona load into single source of truth so flag impl is 3 lines.

## What

Implement `tools/peer-call/persona-loader.ts`:

- async function loadPersona(name: string): Promise<string>
- Uses Bun.file, readFile, UTF8
- On missing: throw a typed `PersonaLoadError` or return an error value; entrypoints decide console rendering and exit code
- On success: return the markdown string (for injection as Layer 1)
Comment thread
AceHack marked this conversation as resolved.

## Acceptance criteria

- [ ] Standard repo gate remains applicable: `dotnet build -c Release` and `dotnet test Zeta.sln -c Release` are not waived by this row
- [ ] Focused TS check or Bun test covers the module
- [ ] Unit test (minimal) covers missing-file error path
- [ ] Zero duplication with existing scripts

## Out of scope

- No CLI flag parsing
- No deprecation wrappers
- No docs update

This is the data-plane primitive the refactor rests on. TS-first per Rule 0.
49 changes: 49 additions & 0 deletions docs/backlog/P2/B-0411-grok-ts-persona-flag-impl-2026-05-11.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
id: B-0411
priority: P2
status: open
title: grok.ts --persona flag — minimal integration of loader + deprecation note (B-0120 child)
parent: B-0120
Comment on lines +2 to +6
tier: factory-tooling
effort: S
ask: In tools/peer-call/grok.ts add optional --persona <name> flag by extending the existing lightweight parseArgs pattern; do not add a new parser dependency. If present, call loadPersona and inject; else current bare behavior. Add comment for future amara/ani wrapper deprecation. One script only.
created: 2026-05-11
Comment thread
AceHack marked this conversation as resolved.
last_updated: 2026-05-11
depends_on:
- B-0410
composes_with:
- tools/peer-call/grok.ts
tags: [riven-2026-05-11, peer-call, ts-first, flag-impl]
type: implementation
decomposition: atomic
classification: blocked-on-B-0410
---

# B-0411 — grok.ts --persona flag (first script)

## Source

Depends on loader (B-0410). Scope-limited to grok.ts to keep atomic.

## What

Edit grok.ts (post #896):

- Parse --persona via the existing custom parser pattern (keep 4-shell compat; no new dependency)
- On flag: await loadPersona(name) then prepend to prompt
- No flag: unchanged behavior
- Add TODO comment for amara/ani wrapper retirement

## Acceptance criteria

- [ ] `bun tools/peer-call/grok.ts --persona ani "test"` succeeds (or errors clearly)
- [ ] Bare `bun ... "test"` unchanged
- [ ] Focused test in PR (manual or tsx)

## Out of scope

- No codex/gemini yet
- No wrapper scripts
- No README update

Keeps the step bounded; other scripts are siblings.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
id: B-0412
priority: P2
status: open
title: codex.ts + gemini.ts --persona flags — parallel sibling impl after grok (B-0120 child)
parent: B-0120
tier: factory-tooling
effort: S
ask: After B-0411 lands, repeat the --persona integration in codex.ts and gemini.ts using the shared loader. Same semantics, same deprecation comment. Two scripts, one row for atomicity.
created: 2026-05-11
last_updated: 2026-05-11
depends_on:
- B-0411
composes_with:
- tools/peer-call/codex.ts
- tools/peer-call/gemini.ts
tags: [riven-2026-05-11, peer-call, ts-first, flag-impl]
type: implementation
decomposition: atomic
classification: blocked-on-B-0411
---

# B-0412 — codex.ts + gemini.ts --persona (siblings)

## Source

Depends on B-0411 (grok first to validate loader). Parallel because loader is shared.
Comment on lines +9 to +27

## What

Apply identical pattern to the other two entrypoints.

## Acceptance criteria

- [ ] Both scripts accept --persona amara / --persona ani with clear error on missing
- [ ] Bare invocation unchanged
- [ ] No new deps

## Out of scope

- No amara.sh/ani.sh retirement (v2)
- No full README
- No B-0121 cross-harness yet

Completes the TS surface for the refactor.
Loading