- **AuthorAgent Tier-4 feature port (8 features, #10–#17) [owner ask 2026-07-11].** Ported the eight Tier-4 items from `docs/AUTHORAGENT-PORT-ANALYSIS-2026-07-11.md`, each grounded in the `Ckokoski/AuthorAgent` fork's actual code and adapted to BookClaw, via spec → plan → 7 parallel disjoint-file TDD implementers → 2 parallel Wave-2 wiring clusters → Opus whole-branch code review (1 Important + Minors, Important fixed) → smoke → Mercury deploy. Three items were honestly **scoped down** where the fork's feature was redundant against a stronger BookClaw implementation. **(#10) Vault key-format validation** (`_shared.ts` `validateKeyFormat`, `settings.routes.ts`): non-blocking `warning` on the `/api/vault` response when a saved key doesn't match its provider slot (never blocks the save). **(#11) Onboarding status** (`onboarding-status.ts`, `core.routes.ts`): read-only `GET /api/onboarding/status` first-run checklist (provider/voice/soul/project/telegram/discord), each signal fail-soft, `firstRun` gated on provider+project. **(#12) Character motivation critique** (`character-motivation.ts`, `POST /api/projects/:id/motivation-critique`, MCP `motivation_critique`): AI check for lines that contradict a character's established motivation/arc — **scoped to motivation only** (knowledge-horizon dropped as redundant vs `continuity-check.ts` `evaluateKnowledge`; off-voice dropped vs `character-voices.ts`). **(#13) Translation execution** (`translation-pipeline.ts` `executeTranslation`, `POST /api/translation/execute`): completes the half-built feature (planning already shipped) — paragraph-boundary chunking with one-retry-then-error-marker fail-soft, gated at the route via `requireApprovedConfirmation`/`recordOutcome` (fork's in-service gate dropped for BookClaw's route convention), per-chunk cost recorded model-aware. **(#14) Model-aware pricing** (`ai/pricing.ts`, `costs.ts`): per-model `LLM_PRICING` table + `getLLMPrice`; `CostTracker.record()` now **overrides** the router's flat estimate for known non-OpenRouter models (fixes the acknowledged `#35b` Opus underpricing — Opus was billed ~40% cheap), threaded through 11 `record()` call sites. **(#15) Path-safety consolidation** (`security/paths.ts`, `sandbox.ts`, `memory.ts`, `_shared.ts`): one hardened `resolveWithin`/`safeResolveWithin`/`sanitizeSegment` module (null-byte, Windows-reserved, `..`); the 28 `safePath` sites collapse to a one-line alias; **`SandboxGuard`'s `realpathSync` symlink-escape defense preserved** (the fork's port dropped it — a regression we avoided), guarded by a symlink regression test. **(#16) Dialogue-parser deduplication** (`dialogue-parser.ts`, `character-voices.ts`, `audiobook-prep.ts`): one shared parser fixes a confirmed untrimmed-name bug (`buildNameLookup` trims key+value) that silently dropped dialogue lines / mis-voiced TTS; `dialogue-auditor.ts` left untouched (architecturally distinct); code review caught and fixed a reverse-tag quote-anchor regression in `character-voices`. **(#17) Revision-orchestrator** (`revision-orchestrator.ts`, `POST /api/projects/:id/revision-report`, MCP `revision_report`): thin aggregator over craft/dialogue/continuity/voice/mechanical detectors into one severity-ranked report (no new detection; continuity reads persisted per-step flags — zero extra AI; route resolves character names from the entity DB). **Verified:** 8 feature unit-test files + 2 reverse-tag regression tests all green, full suite 2137/2137, `tsc --noEmit` clean (root + mcp), mcp builds; new `tests/tier4-features-smoke.sh` passes 7/7 against Mercury; Tier-1/2 smokes non-regressed. Spec: `docs/superpowers/specs/2026-07-11-authoragent-tier4-features-design.md`; plan: `docs/superpowers/plans/2026-07-11-authoragent-tier4-features-plan.md`. Deployed to Mercury. _(Owner ask 2026-07-11.)_
0 commit comments