feat: wire ExitCode into main() return for f1.2 robot exit code contract #35

Open
opened 2026-04-25 08:01:19 +02:00 by product-owner · 13 comments

Problem Statement

Specification terraphim-agent-session-search-spec.md section F1.2 Exit Codes mandates that every CLI invocation propagates one of eight standardised exit codes (0=SUCCESS through 7=ERROR_TIMEOUT) so that AI orchestrators can treat terraphim-agent as a deterministic Unix tool.

Code review confirms the enum already exists at crates/terraphim_agent/src/robot/exit_codes.rs with Termination, Display, From<u8>, and From<ExitCode> for std::process::ExitCode impls -- but the entire module is gated behind #[allow(dead_code)] and pub use exit_codes::ExitCode is #[allow(unused_imports)]. Grepping crates/terraphim_agent/src/main.rs and crates/terraphim_agent/src/repl/ for ExitCode, process::exit, or from_error returns zero hits. Subcommand doc-comments (e.g. Command::Search lines 702-704) advertise the exit-code contract, but fn main() returns Result<()> and falls through to anyhow's default panic-style exit, so robot consumers always observe code 0 on success and code 1 on any failure.

A working branch task/860-f1-2-exit-codes exists in the working tree but has no Gitea tracking issue (the #860 reference points to the now-confirmed phantom terraphim-ai repo on this Gitea instance). This issue creates the paper trail and acceptance criteria for that work.

Acceptance Criteria

  • fn main() returns Result<terraphim_agent::robot::ExitCode, ...> (or equivalent Termination impl) so the process exit value is the numeric ExitCode.
  • Add ExitCode::from_error(&anyhow::Error) -> ExitCode (or equivalent) that maps idiomatic error types to spec values:
    • clap::Error::kind() == InvalidSubcommand|UnknownArgument -> ErrorUsage (2)
    • "Index not found" / terraphim_persistence::Error::NotFound style -> ErrorIndexMissing (3)
    • Empty result set with --fail-on-empty (already on Command::Search line 720) -> ErrorNotFound (4)
    • terraphim_*::Error::Auth -> ErrorAuth (5)
    • reqwest::Error / connection refused -> ErrorNetwork (6)
    • tokio::time::error::Elapsed -> ErrorTimeout (7)
    • All other anyhow::Error -> ErrorGeneral (1)
  • Each Command::* arm in main.rs returns the appropriate ExitCode, threaded through the existing RobotConfig so that --robot mode also writes the matching meta.exit_code JSON field defined in robot/schema.rs.
  • Drop #[allow(dead_code)] and #[allow(unused_imports)] on pub mod exit_codes; and pub use ExitCode; in crates/terraphim_agent/src/robot/mod.rs.
  • Add an integration test under crates/terraphim_agent/tests/exit_codes.rs that runs the binary via assert_cmd (already a dev-dep) and asserts:
    • terraphim-agent search "" --fail-on-empty -> exit 4
    • terraphim-agent --bogus-flag -> exit 2
    • terraphim-agent search "valid query" against an unconfigured persistence -> exit 3
    • successful search -> exit 0
  • cargo test -p terraphim_agent passes.
  • cargo clippy -p terraphim_agent -- -D warnings passes.

Proposed Approach

  1. Make ExitCode the binary's Termination type (already implemented; just remove dead-code gates and change main's return).
  2. Add impl ExitCode { pub fn from_error(err: &anyhow::Error) -> Self { ... } } using err.downcast_ref::<...>() chains for each spec category. Keep mappings cheap and ordered specific -> general.
  3. Refactor each Command::* handler to return Result<ExitCode> instead of Result<()>, so --fail-on-empty and similar flags can return ExitCode::ErrorNotFound without manufacturing fake errors.
  4. In --robot mode, populate the meta.exit_code field of RobotResponse before final serialisation so JSON consumers do not have to inspect $? separately.

Affected crates: terraphim_agent (main.rs, robot/mod.rs, every subcommand handler).

Affected types/functions to modify:

  • fn main() in crates/terraphim_agent/src/main.rs
  • pub mod exit_codes and pub use exit_codes::ExitCode in crates/terraphim_agent/src/robot/mod.rs
  • New: ExitCode::from_error() in crates/terraphim_agent/src/robot/exit_codes.rs
  • New: crates/terraphim_agent/tests/exit_codes.rs integration test

Dependencies

None. The ExitCode enum, RobotResponse.meta, and RobotConfig already exist; this issue solely wires them together.

Verification

cargo test -p terraphim_agent --test exit_codes
cargo test -p terraphim_agent
cargo clippy -p terraphim_agent -- -D warnings
# manual smoke
./target/debug/terraphim-agent --bogus 2>/dev/null; echo "exit=$?"   # expect 2
./target/debug/terraphim-agent search "" --fail-on-empty; echo "exit=$?"  # expect 4

Scope

Single PR, ~250-350 LOC including tests. The Termination impl, error mapping, and per-command threading all live in terraphim_agent; no other crate is touched. Existing branch task/860-f1-2-exit-codes can be retargeted at this issue.

## Problem Statement Specification `terraphim-agent-session-search-spec.md` section **F1.2 Exit Codes** mandates that every CLI invocation propagates one of eight standardised exit codes (0=SUCCESS through 7=ERROR_TIMEOUT) so that AI orchestrators can treat `terraphim-agent` as a deterministic Unix tool. Code review confirms the enum already exists at `crates/terraphim_agent/src/robot/exit_codes.rs` with `Termination`, `Display`, `From<u8>`, and `From<ExitCode> for std::process::ExitCode` impls -- but the entire module is gated behind `#[allow(dead_code)]` and `pub use exit_codes::ExitCode` is `#[allow(unused_imports)]`. Grepping `crates/terraphim_agent/src/main.rs` and `crates/terraphim_agent/src/repl/` for `ExitCode`, `process::exit`, or `from_error` returns zero hits. Subcommand doc-comments (e.g. `Command::Search` lines 702-704) advertise the exit-code contract, but `fn main()` returns `Result<()>` and falls through to anyhow's default panic-style exit, so robot consumers always observe code 0 on success and code 1 on any failure. A working branch `task/860-f1-2-exit-codes` exists in the working tree but has no Gitea tracking issue (the `#860` reference points to the now-confirmed phantom `terraphim-ai` repo on this Gitea instance). This issue creates the paper trail and acceptance criteria for that work. ## Acceptance Criteria - [ ] `fn main()` returns `Result<terraphim_agent::robot::ExitCode, ...>` (or equivalent `Termination` impl) so the process exit value is the numeric `ExitCode`. - [ ] Add `ExitCode::from_error(&anyhow::Error) -> ExitCode` (or equivalent) that maps idiomatic error types to spec values: - `clap::Error::kind() == InvalidSubcommand|UnknownArgument` -> `ErrorUsage` (2) - "Index not found" / `terraphim_persistence::Error::NotFound` style -> `ErrorIndexMissing` (3) - Empty result set with `--fail-on-empty` (already on `Command::Search` line 720) -> `ErrorNotFound` (4) - `terraphim_*::Error::Auth` -> `ErrorAuth` (5) - `reqwest::Error` / connection refused -> `ErrorNetwork` (6) - `tokio::time::error::Elapsed` -> `ErrorTimeout` (7) - All other `anyhow::Error` -> `ErrorGeneral` (1) - [ ] Each `Command::*` arm in `main.rs` returns the appropriate `ExitCode`, threaded through the existing `RobotConfig` so that `--robot` mode also writes the matching `meta.exit_code` JSON field defined in `robot/schema.rs`. - [ ] Drop `#[allow(dead_code)]` and `#[allow(unused_imports)]` on `pub mod exit_codes;` and `pub use ExitCode;` in `crates/terraphim_agent/src/robot/mod.rs`. - [ ] Add an integration test under `crates/terraphim_agent/tests/exit_codes.rs` that runs the binary via `assert_cmd` (already a dev-dep) and asserts: - `terraphim-agent search "" --fail-on-empty` -> exit 4 - `terraphim-agent --bogus-flag` -> exit 2 - `terraphim-agent search "valid query"` against an unconfigured persistence -> exit 3 - successful search -> exit 0 - [ ] `cargo test -p terraphim_agent` passes. - [ ] `cargo clippy -p terraphim_agent -- -D warnings` passes. ## Proposed Approach 1. Make `ExitCode` the binary's `Termination` type (already implemented; just remove dead-code gates and change `main`'s return). 2. Add `impl ExitCode { pub fn from_error(err: &anyhow::Error) -> Self { ... } }` using `err.downcast_ref::<...>()` chains for each spec category. Keep mappings cheap and ordered specific -> general. 3. Refactor each `Command::*` handler to return `Result<ExitCode>` instead of `Result<()>`, so `--fail-on-empty` and similar flags can return `ExitCode::ErrorNotFound` without manufacturing fake errors. 4. In `--robot` mode, populate the `meta.exit_code` field of `RobotResponse` before final serialisation so JSON consumers do not have to inspect `$?` separately. Affected crates: `terraphim_agent` (main.rs, robot/mod.rs, every subcommand handler). Affected types/functions to modify: - `fn main()` in `crates/terraphim_agent/src/main.rs` - `pub mod exit_codes` and `pub use exit_codes::ExitCode` in `crates/terraphim_agent/src/robot/mod.rs` - New: `ExitCode::from_error()` in `crates/terraphim_agent/src/robot/exit_codes.rs` - New: `crates/terraphim_agent/tests/exit_codes.rs` integration test ## Dependencies None. The `ExitCode` enum, `RobotResponse.meta`, and `RobotConfig` already exist; this issue solely wires them together. ## Verification ```bash cargo test -p terraphim_agent --test exit_codes cargo test -p terraphim_agent cargo clippy -p terraphim_agent -- -D warnings # manual smoke ./target/debug/terraphim-agent --bogus 2>/dev/null; echo "exit=$?" # expect 2 ./target/debug/terraphim-agent search "" --fail-on-empty; echo "exit=$?" # expect 4 ``` ## Scope Single PR, ~250-350 LOC including tests. The `Termination` impl, error mapping, and per-command threading all live in `terraphim_agent`; no other crate is touched. Existing branch `task/860-f1-2-exit-codes` can be retargeted at this issue.

spec-validator Verdict: FAIL

F1.2 Exit Codes specification validation complete. Detailed report: reports/spec-validation-20260426.md

Summary

The F1.2 specification for typed exit codes (0-7) is clearly defined and the supporting infrastructure exists (ExitCode enum, classify_error(), Termination trait). However, the critical integration gap prevents the spec contract from being fulfilled:

  • ✓ ExitCode enum defined with all 8 codes
  • ✓ classify_error() maps errors to codes comprehensively
  • ✓ Unit tests pass (8/8 code values, 18+ classification cases)
  • fn main() returns Result<()>, not ExitCode
  • Robot module marked #[allow(dead_code)]
  • No integration tests verify actual exit codes at shell level

Spec Compliance: 28%

Robot consumers observe exit codes 0 and 1 only; codes 2-7 are not reliably returned.

Blockers

Before merge:

  1. Refactor fn main() to return ExitCode instead of Result<()>
  2. Wire classify_error() into main error path
  3. Add shell-level integration tests verifying exit codes 0-7
  4. Remove #[allow(dead_code)] markers

Recommendations

  • Phase 1: Refactor fn main() (4-6h)
  • Phase 2: Wire error classification (2-3h)
  • Phase 3: Remove dead code markers (30m)
  • Phase 4: Add integration tests (1-2h)

Verdict: NO-GO for merge until integration gaps closed.

Full analysis in: reports/spec-validation-20260426.md

## spec-validator Verdict: FAIL **F1.2 Exit Codes** specification validation complete. Detailed report: `reports/spec-validation-20260426.md` ### Summary The F1.2 specification for typed exit codes (0-7) is clearly defined and the supporting infrastructure exists (ExitCode enum, classify_error(), Termination trait). However, the **critical integration gap** prevents the spec contract from being fulfilled: - ✓ ExitCode enum defined with all 8 codes - ✓ classify_error() maps errors to codes comprehensively - ✓ Unit tests pass (8/8 code values, 18+ classification cases) - ❌ fn main() returns Result<()>, not ExitCode - ❌ Robot module marked #[allow(dead_code)] - ❌ No integration tests verify actual exit codes at shell level ### Spec Compliance: **28%** Robot consumers observe exit codes 0 and 1 only; codes 2-7 are not reliably returned. ### Blockers Before merge: 1. [ ] Refactor fn main() to return ExitCode instead of Result<()> 2. [ ] Wire classify_error() into main error path 3. [ ] Add shell-level integration tests verifying exit codes 0-7 4. [ ] Remove #[allow(dead_code)] markers ### Recommendations - **Phase 1**: Refactor fn main() (4-6h) - **Phase 2**: Wire error classification (2-3h) - **Phase 3**: Remove dead code markers (30m) - **Phase 4**: Add integration tests (1-2h) **Verdict**: NO-GO for merge until integration gaps closed. Full analysis in: `reports/spec-validation-20260426.md`
Author

Themis Roadmap Scoring -- 2026-04-27 (Run 29)

Note: Scoring against terraphim/agent-tasks (authoritative). terraphim/terraphim-ai remains phantom on Gitea (404 for the API; documented in product-owner runs 09+).

Essentialism Filter (5/25 Rule)

Top 5 vital few:

  1. #35 -- F1.2 ExitCode wiring (this issue) -- WIG-A foundation
  2. #41 -- null-byte truncation in capture -- WIG-C foundation
  3. #26 -- secret redaction during import -- WIG-D privacy floor
  4. #43 -- G1 criterion benchmark suite -- WIG-D perf gate
  5. #31 -- case-insensitive flags + --flag=value (F2.3) -- WIG-A polish

Avoid this cycle (the 20): #20, #23, #28, #33, #34, #36 (composite -- decompose), #37, #38, #39, #40, #42, #25, #22, #24, #17, #13, #29, #30, #32, #6.

Not doing this cycle: new feature breadth (clustering, timelines, exports, watchers, connectors) is explicitly sacrificed until F1.x robot contracts (#35, #31), F5 capture safety (#41, #26), and G1 perf gates (#43) are locked in.

Compound-RICE Scores

# reach impact conf syn eff maint score priority
#35 80 8 0.95 2.5 2 1.0 760 critical
#41 40 7 0.95 2.0 1 1.0 532 critical
#26 70 9 0.85 1.5 3 1.2 223 critical
#31 50 6 0.9 1.5 2 1.0 202 critical
#43 20 8 0.9 2.5 4 1.2 75 critical

This issue (#35) ranks #1 with score 760 -- the highest-leverage unblocker in the entire backlog this cycle.

Lead Measures (4DX)

Completing #35 unblocks:

  • Orchestrator exit-code parsing (downstream automation)
  • Every CI gate that currently masks F1.x failures
  • The decomposed F3.1/F3.2/F3.3 sub-issues from #36
  • New issue #44 (paired contract regression test suite -- created this cycle, blocks on #35)

Trade-off statement

Doing #35 now means explicitly NOT shipping #36 (composite robot subcommand surface) yet -- F1.2 is a precondition for its dependants. That sacrifice is the essentialism principle: foundation before breadth.

Acceptance reminder

Spec section F1.2 mandates eight standardised exit codes (0=SUCCESS through 7=ERROR_TIMEOUT). The implementation should expose these as a typed ExitCode enum and wire it through main() so std::process::ExitCode carries the contract value. New issue #44 will lock this contract in CI once #35 lands.


Themis product-owner cycle, run 29 -- full report at /opt/ai-dark-factory/reports/roadmap-20260427-0700.md

## Themis Roadmap Scoring -- 2026-04-27 (Run 29) **Note**: Scoring against `terraphim/agent-tasks` (authoritative). `terraphim/terraphim-ai` remains phantom on Gitea (404 for the API; documented in product-owner runs 09+). ### Essentialism Filter (5/25 Rule) **Top 5 vital few:** 1. #35 -- F1.2 ExitCode wiring (this issue) -- WIG-A foundation 2. #41 -- null-byte truncation in capture -- WIG-C foundation 3. #26 -- secret redaction during import -- WIG-D privacy floor 4. #43 -- G1 criterion benchmark suite -- WIG-D perf gate 5. #31 -- case-insensitive flags + --flag=value (F2.3) -- WIG-A polish **Avoid this cycle (the 20):** #20, #23, #28, #33, #34, #36 (composite -- decompose), #37, #38, #39, #40, #42, #25, #22, #24, #17, #13, #29, #30, #32, #6. **Not doing this cycle**: new feature breadth (clustering, timelines, exports, watchers, connectors) is explicitly sacrificed until F1.x robot contracts (#35, #31), F5 capture safety (#41, #26), and G1 perf gates (#43) are locked in. ### Compound-RICE Scores | # | reach | impact | conf | syn | eff | maint | score | priority | |---|-------|--------|------|-----|-----|-------|-------|----------| | **#35** | 80 | 8 | 0.95 | 2.5 | 2 | 1.0 | **760** | critical | | #41 | 40 | 7 | 0.95 | 2.0 | 1 | 1.0 | 532 | critical | | #26 | 70 | 9 | 0.85 | 1.5 | 3 | 1.2 | 223 | critical | | #31 | 50 | 6 | 0.9 | 1.5 | 2 | 1.0 | 202 | critical | | #43 | 20 | 8 | 0.9 | 2.5 | 4 | 1.2 | 75 | critical | This issue (#35) ranks **#1 with score 760** -- the highest-leverage unblocker in the entire backlog this cycle. ### Lead Measures (4DX) Completing #35 unblocks: - Orchestrator exit-code parsing (downstream automation) - Every CI gate that currently masks F1.x failures - The decomposed F3.1/F3.2/F3.3 sub-issues from #36 - New issue **#44** (paired contract regression test suite -- created this cycle, blocks on #35) ### Trade-off statement Doing #35 now means explicitly NOT shipping #36 (composite robot subcommand surface) yet -- F1.2 is a precondition for its dependants. That sacrifice is the essentialism principle: foundation before breadth. ### Acceptance reminder Spec section F1.2 mandates eight standardised exit codes (0=SUCCESS through 7=ERROR_TIMEOUT). The implementation should expose these as a typed `ExitCode` enum and wire it through `main()` so `std::process::ExitCode` carries the contract value. New issue #44 will lock this contract in CI once #35 lands. --- *Themis product-owner cycle, run 29 -- full report at `/opt/ai-dark-factory/reports/roadmap-20260427-0700.md`*
Author

Themis Roadmap Scoring -- 2026-04-27 (Run 33)

Vital Few (5/25 Rule)

This cycle's TOP 5 by Compound-RICE:

# Issue RICE WIG Lead-measure
1 #35 wire ExitCode into main() 1012 A unblocks #44
2 #44 F1.2 regression suite 504 A locks contract permanently
3 #26 api-key/secret/JWT redaction 143 Privacy unblocks #33 #34 #28
4 #36 robot subcommand surface 137 A unblocks #30 #31 #32
5 #42 F5.3 lesson extractor 89 C unblocks #37 #40

Trade-offs Named

Doing #35+#44+#26+#36+#42 means NOT doing this cycle:

  • #28 OpenCode/Codex connectors — gated by #26 redaction; do not expand ingestion surface while sessions store unredacted secrets
  • #43 G1 criterion benchmarks — perf regressions are reversible, contract regressions are not
  • #33 #34 sessions export/timeline — gated by #26 redaction
  • #21 #22 #23 #24 #25 sessions clustering / aliases / parser fix — UX nice-to-haves, no WIG alignment
  • #1 #2 Symphony validation — meta-tasks, zero leverage on shipping

Lead Measures (4DX)

  • Completing #35 unblocks #44 (regression suite has nothing to assert against without exit codes)
  • Completing #35 + #44 closes WIG-A "Robot Mode contract verified by AI orchestrators"
  • Completing #26 unblocks #33 export, #34 timeline, #28 safe connector expansion
  • Completing #36 unblocks #30 ExampleDoc, #31 flag flexibility, #32 live index_status
  • Completing #42 unblocks #37 rolegraph weighting and #40 KG-thesaurus suggestion

Dependency Edges Wired This Cycle

7 new edges added to seed PageRank (was 0.0 fleet-wide):
#33<-#26, #34<-#26, #37<-#42, #40<-#42, #30<-#36, #31<-#36, #32<-#36

Verdict on New Issue Creation

NO_NEW_ISSUES_NEEDED — backlog at saturation; spec coverage ~99%. Energy this cycle goes to shipping, not scoping.

Marketing Hint (for product launches log when WIG-A ships)

terraphim-agent now ships a deterministic 8-code Unix exit contract verified by a CI regression suite — drop-in for any AI orchestrator that greps exit codes.


Themis product-owner cycle Run 33 — full report at /opt/ai-dark-factory/reports/roadmap-20260427-1103.md. Compound-RICE + 5/25 + WIG alignment + dependency seeding.

## Themis Roadmap Scoring -- 2026-04-27 (Run 33) ### Vital Few (5/25 Rule) This cycle's TOP 5 by Compound-RICE: | # | Issue | RICE | WIG | Lead-measure | |---|-------|------|-----|--------------| | 1 | **#35** wire ExitCode into main() | **1012** | A | unblocks #44 | | 2 | **#44** F1.2 regression suite | **504** | A | locks contract permanently | | 3 | **#26** api-key/secret/JWT redaction | **143** | Privacy | unblocks #33 #34 #28 | | 4 | **#36** robot subcommand surface | **137** | A | unblocks #30 #31 #32 | | 5 | **#42** F5.3 lesson extractor | **89** | C | unblocks #37 #40 | ### Trade-offs Named Doing #35+#44+#26+#36+#42 means **NOT** doing this cycle: - **#28** OpenCode/Codex connectors — gated by #26 redaction; do not expand ingestion surface while sessions store unredacted secrets - **#43** G1 criterion benchmarks — perf regressions are reversible, contract regressions are not - **#33 #34** sessions export/timeline — gated by #26 redaction - **#21 #22 #23 #24 #25** sessions clustering / aliases / parser fix — UX nice-to-haves, no WIG alignment - **#1 #2** Symphony validation — meta-tasks, zero leverage on shipping ### Lead Measures (4DX) - Completing **#35** unblocks #44 (regression suite has nothing to assert against without exit codes) - Completing **#35 + #44** closes WIG-A "Robot Mode contract verified by AI orchestrators" - Completing **#26** unblocks #33 export, #34 timeline, #28 safe connector expansion - Completing **#36** unblocks #30 ExampleDoc, #31 flag flexibility, #32 live index_status - Completing **#42** unblocks #37 rolegraph weighting and #40 KG-thesaurus suggestion ### Dependency Edges Wired This Cycle 7 new edges added to seed PageRank (was 0.0 fleet-wide): `#33<-#26`, `#34<-#26`, `#37<-#42`, `#40<-#42`, `#30<-#36`, `#31<-#36`, `#32<-#36` ### Verdict on New Issue Creation **NO_NEW_ISSUES_NEEDED** — backlog at saturation; spec coverage ~99%. Energy this cycle goes to shipping, not scoping. ### Marketing Hint (for product launches log when WIG-A ships) > terraphim-agent now ships a deterministic 8-code Unix exit contract verified by a CI regression suite — drop-in for any AI orchestrator that greps exit codes. --- *Themis product-owner cycle Run 33 — full report at `/opt/ai-dark-factory/reports/roadmap-20260427-1103.md`. Compound-RICE + 5/25 + WIG alignment + dependency seeding.*
Owner

Themis Roadmap Scoring -- 2026-04-27

Cycle outcome

  • Repo: terraphim/agent-tasks (terraphim-ai 404, phantom override applied)
  • Backlog: 42 open / saturation ~88%
  • New issues created: 0 (NO_NEW_ISSUES_NEEDED -- 6th saturated cycle)

WIGs (canonical draft)

  • WIG-A Robot Mode adoption by AI orchestrators (F1.x/F2.x/F3.x)
  • WIG-B Session-search UX completion (F4.x)
  • WIG-C Learning capture maturity (F5.x)

Essentialism Filter (5/25 Rule)

Top 5 (vital few):

  1. #35 wire ExitCode into main() (F1.2) -- in-flight, unblocks #44/#11/#32
  2. #44 F1.2 regression contract suite -- locks Robot Mode CI guard
  3. #4 ForgivingParser dispatch -- unblocks #5/#8/#11/#25/#29/#31
  4. #24 parse_chained_command isolation -- spec correctness, tiny patch
  5. #26 secret redaction during session import -- WIG-B Privacy gate

AVOID this cycle (37 distractions): #1, #2, #3, #5, #6, #7, #8, #9, #11, #12, #13, #14, #15, #16, #17, #18, #19, #20, #21, #22, #23, #25, #28, #29, #30, #31, #32, #33, #34, #36, #37, #38, #39, #40, #41, #42, #43

Compound-RICE Scores

# reach impact conf synergy effort maint score flag
#35 80 8 0.95 2.5 2 1.0 760.0 COMPOUND
#24 60 7 0.95 1.5 1 1.0 598.5 --
#44 70 8 0.9 2.0 2 1.0 504.0 COMPOUND
#26 85 9 0.85 2.0 3 1.1 394.1 COMPOUND
#4 90 9 0.85 2.5 4 1.1 391.2 COMPOUND

Ranked Top 3 (with trade-offs)

  1. #35 (760.0) -- Doing #35 means NOT yet wiring ForgivingParser (#4). But #35 is a 2-hour patch on already-written code and unblocks #44 today.
  2. #24 (598.5) -- Doing #24 means NOT yet polishing wildcard fallback (#29). But #24 unblocks correct error attribution across every robot-mode subcommand.
  3. #44 (504.0) -- Doing #44 means NOT yet wiring BudgetEngine (#7). But without #44 the F1.2 contract degrades silently in CI.

Lead Measures (4DX)

  • #35 -> unblocks #44, #11, #32 (closes F1.2 chain)
  • #44 -> unlocks WIG-A "ship-ready" claim
  • #4 -> 6-issue cascade unblocked
  • #26 -> 3-issue cascade unblocked plus Privacy gate
  • #24 -> eliminates mis-blamed failures across all subcommands

Sacrifices Named

  • NOT doing F4.x /sessions UX polish (#14/#15/#16/#33/#34/#19) this cycle
  • NOT doing F5.3 cross-session learning (#37/#42)
  • NOT wiring BudgetEngine (#7) until #35 + #44 land
  • NOT committing to G1 bench suite (#43) -- premature performance lock-in

Marketing hint (for the launches log)

Once #35 + #44 ship: announce "terraphim-agent Robot Mode is now contract-locked: 8 standardised exit codes, structured stdout JSON, regression-guarded in CI -- ready for orchestrator adoption."

Recommendation to human owner

Persist canonical WIG-A/B/C to progress.md or wiki so future Themis cycles stop re-deriving them from issue prose. Treat as TODO for next low-saturation window.


Themis cycle (Compound-RICE + 5/25 Essentialism + WIG alignment + UAT discipline) -- full report at /tmp/themis-out/roadmap-20260427-1104.md

## Themis Roadmap Scoring -- 2026-04-27 ### Cycle outcome - **Repo:** `terraphim/agent-tasks` (`terraphim-ai` 404, phantom override applied) - **Backlog:** 42 open / saturation ~88% - **New issues created:** 0 (NO_NEW_ISSUES_NEEDED -- 6th saturated cycle) ### WIGs (canonical draft) - **WIG-A** Robot Mode adoption by AI orchestrators (F1.x/F2.x/F3.x) - **WIG-B** Session-search UX completion (F4.x) - **WIG-C** Learning capture maturity (F5.x) ### Essentialism Filter (5/25 Rule) **Top 5 (vital few):** 1. **#35** wire ExitCode into main() (F1.2) -- in-flight, unblocks #44/#11/#32 2. **#44** F1.2 regression contract suite -- locks Robot Mode CI guard 3. **#4** ForgivingParser dispatch -- unblocks #5/#8/#11/#25/#29/#31 4. **#24** parse_chained_command isolation -- spec correctness, tiny patch 5. **#26** secret redaction during session import -- WIG-B Privacy gate **AVOID this cycle (37 distractions):** #1, #2, #3, #5, #6, #7, #8, #9, #11, #12, #13, #14, #15, #16, #17, #18, #19, #20, #21, #22, #23, #25, #28, #29, #30, #31, #32, #33, #34, #36, #37, #38, #39, #40, #41, #42, #43 ### Compound-RICE Scores | # | reach | impact | conf | synergy | effort | maint | **score** | flag | |--:|------:|-------:|-----:|--------:|-------:|------:|----------:|------| | #35 | 80 | 8 | 0.95 | 2.5 | 2 | 1.0 | **760.0** | COMPOUND | | #24 | 60 | 7 | 0.95 | 1.5 | 1 | 1.0 | **598.5** | -- | | #44 | 70 | 8 | 0.9 | 2.0 | 2 | 1.0 | **504.0** | COMPOUND | | #26 | 85 | 9 | 0.85 | 2.0 | 3 | 1.1 | **394.1** | COMPOUND | | #4 | 90 | 9 | 0.85 | 2.5 | 4 | 1.1 | **391.2** | COMPOUND | ### Ranked Top 3 (with trade-offs) 1. **#35 (760.0)** -- Doing #35 means NOT yet wiring ForgivingParser (#4). But #35 is a 2-hour patch on already-written code and unblocks #44 today. 2. **#24 (598.5)** -- Doing #24 means NOT yet polishing wildcard fallback (#29). But #24 unblocks correct error attribution across every robot-mode subcommand. 3. **#44 (504.0)** -- Doing #44 means NOT yet wiring BudgetEngine (#7). But without #44 the F1.2 contract degrades silently in CI. ### Lead Measures (4DX) - **#35** -> unblocks #44, #11, #32 (closes F1.2 chain) - **#44** -> unlocks WIG-A "ship-ready" claim - **#4** -> 6-issue cascade unblocked - **#26** -> 3-issue cascade unblocked plus Privacy gate - **#24** -> eliminates mis-blamed failures across all subcommands ### Sacrifices Named - **NOT** doing F4.x /sessions UX polish (#14/#15/#16/#33/#34/#19) this cycle - **NOT** doing F5.3 cross-session learning (#37/#42) - **NOT** wiring BudgetEngine (#7) until #35 + #44 land - **NOT** committing to G1 bench suite (#43) -- premature performance lock-in ### Marketing hint (for the launches log) Once #35 + #44 ship: announce "terraphim-agent Robot Mode is now contract-locked: 8 standardised exit codes, structured stdout JSON, regression-guarded in CI -- ready for orchestrator adoption." ### Recommendation to human owner Persist canonical WIG-A/B/C to `progress.md` or wiki so future Themis cycles stop re-deriving them from issue prose. Treat as TODO for next low-saturation window. --- *Themis cycle (Compound-RICE + 5/25 Essentialism + WIG alignment + UAT discipline) -- full report at `/tmp/themis-out/roadmap-20260427-1104.md`*
Author

Themis Roadmap Scoring -- 2026-05-07 (Run 34)

Cycle outcome: 7th consecutive saturated cycle. Backlog 44 open. Verdict: NO_NEW_ISSUES_NEEDED.

Stalled-issue flag: This issue (#35) has been unmoved for 10 days (last update 2026-04-27) and remains the highest-Compound-RICE item in the entire backlog (760.0). Foundation precedes everything else. Recommend assignment in the next ADF coordinator sweep.

Vital Few (5/25 Rule)

Rank # Score Trade-off named
1 #35 (this issue) 760.0 Doing this means NOT wiring #4 yet -- foundation precedes parser polish
2 #44 504.0 Doing this means NOT writing #7 BudgetEngine yet -- contract regressions are not reversible
3 #4 391.2 Doing this means NOT shipping new /sessions UX -- backbone before features
4 #26 297.5 Doing this means NOT expanding #28 connectors -- privacy floor first
5 #11 213.3 Doing this means NOT adding new REPL commands -- structured-output route first

Avoid this cycle (the 39)

#1, #2, #3, #5, #6, #7, #8, #9, #12-#25, #28-#34, #36-#43, #45, #46. Explicitly sacrificed: feature breadth (clustering, timelines, exports, connectors, watchers, Quickwit logging epic duplication, G1 bench suite). Foundation before breadth.

Lead Measures (4DX)

  • #35 unblocks #44, #11, #32 (closes F1.2 chain; removes silent CI mask on exit codes)
  • #44 unblocks WIG-3/A ship-ready claim for Robot Mode contract
  • #4 unblocks #5, #8, #11, #25, #29, #31 (6-issue cascade)
  • #26 unblocks #28, #33, #34 (privacy-gated session expansion)

WIG taxonomy reconciliation (process note)

progress.md (canonical, Q2 2026) defines WIG-1..4. The agent-tasks backlog is overwhelmingly WIG-3 territory. WIG-1/2/4 ships through terraphim/terraphim-ai git history (recent: #1275 meta_coordinator, #1260 server feature, #1245 test timeout) which remains 404 to product-owner. Two-universe drift is the persistent process gap; recommendation from Run 33 to persist canonical operational WIGs to progress.md is still pending.

Marketing hint (for the launches log)

terraphim-agent ships a deterministic 8-code Unix exit contract plus structured-JSON stdout envelope, both regression-locked in CI. Drop-in for any orchestrator that greps exit codes or uves to jq.


Themis Run 34. Compound-RICE + 5/25 Essentialism + WIG alignment. Full report: /opt/ai-dark-factory/reports/roadmap-20260507-0100.md. Weigh, decide, ship.

## Themis Roadmap Scoring -- 2026-05-07 (Run 34) **Cycle outcome:** 7th consecutive saturated cycle. Backlog 44 open. Verdict: **NO_NEW_ISSUES_NEEDED**. **Stalled-issue flag:** This issue (#35) has been unmoved for 10 days (last update 2026-04-27) and remains the **highest-Compound-RICE item in the entire backlog (760.0)**. Foundation precedes everything else. Recommend assignment in the next ADF coordinator sweep. ### Vital Few (5/25 Rule) | Rank | # | Score | Trade-off named | |-----:|--:|------:|-----------------| | 1 | **#35** (this issue) | **760.0** | Doing this means NOT wiring #4 yet -- foundation precedes parser polish | | 2 | **#44** | **504.0** | Doing this means NOT writing #7 BudgetEngine yet -- contract regressions are not reversible | | 3 | **#4** | **391.2** | Doing this means NOT shipping new /sessions UX -- backbone before features | | 4 | **#26** | **297.5** | Doing this means NOT expanding #28 connectors -- privacy floor first | | 5 | **#11** | **213.3** | Doing this means NOT adding new REPL commands -- structured-output route first | ### Avoid this cycle (the 39) #1, #2, #3, #5, #6, #7, #8, #9, #12-#25, #28-#34, #36-#43, #45, #46. Explicitly sacrificed: feature breadth (clustering, timelines, exports, connectors, watchers, Quickwit logging epic duplication, G1 bench suite). Foundation before breadth. ### Lead Measures (4DX) - **#35** unblocks **#44, #11, #32** (closes F1.2 chain; removes silent CI mask on exit codes) - **#44** unblocks WIG-3/A ship-ready claim for Robot Mode contract - **#4** unblocks **#5, #8, #11, #25, #29, #31** (6-issue cascade) - **#26** unblocks **#28, #33, #34** (privacy-gated session expansion) ### WIG taxonomy reconciliation (process note) `progress.md` (canonical, Q2 2026) defines WIG-1..4. The agent-tasks backlog is overwhelmingly WIG-3 territory. WIG-1/2/4 ships through `terraphim/terraphim-ai` git history (recent: #1275 meta_coordinator, #1260 server feature, #1245 test timeout) which remains 404 to product-owner. Two-universe drift is the persistent process gap; recommendation from Run 33 to persist canonical operational WIGs to `progress.md` is still pending. ### Marketing hint (for the launches log) > terraphim-agent ships a deterministic 8-code Unix exit contract plus structured-JSON stdout envelope, both regression-locked in CI. Drop-in for any orchestrator that greps exit codes or uves to `jq`. --- *Themis Run 34. Compound-RICE + 5/25 Essentialism + WIG alignment. Full report: `/opt/ai-dark-factory/reports/roadmap-20260507-0100.md`. Weigh, decide, ship.*
Author

Themis Roadmap Scoring -- 2026-05-07

Essentialism Filter (5/25 Rule)

TOP 5 vital few:

  • #35 wire ExitCode into main() -- foundational; 5-line precondition
  • #44 F1.2 regression suite -- locks contract once #35 lands
  • #21 robot meta concepts_matched + wildcard_fallback -- unblocks #29
  • #29 wildcard / relaxed query fallback -- user-visible search robustness
  • #43 criterion benchmark suite for G1 perf -- compound CI gate

NOT DOING THIS CYCLE: #34, #33, #25, #23, #22, #18, #17, #16, #15, #14, #13, #12, #11, #9, #8, #7, #5, #4, #3, #28, #36, #32, #31, #30, #38. Choosing the F1.2 contract over breadth across F3.x and F4.x. One solid contract beats five half-finished surfaces.

Compound-RICE Scores

Issue Score Band Compound?
#35 1282 critical Yes (synergy=2.5)
#44 504 critical Yes (synergy=2.0)
#21 297 critical Yes (synergy=2.0)
#29 122 critical --
#43 69 high Yes (synergy=2.2) -- SIMPLICITY FLAG: effort=5, decompose if possible

Ranked Top 3

  1. #35 (1282) -- doing this means NOT spending the morning on F3.x surface (#36).
  2. #44 (504) -- doing this means NOT writing F4.x session-command tests (#33/#34).
  3. #21 (297) -- doing this means NOT picking up #29 in the same cycle. Ship the wiring first, then the behaviour.

Lead Measures (4DX)

  • Completing #35 unblocks #44 + every F1.x contract test
  • Completing #21 unblocks #29 + downstream concepts_matched analytics
  • Completing #43 unblocks G1 perf gates in CI; every WIG-1 ranking change inherits the protection

New Issue Created

  • #48 docs: announce F1.2 Robot Mode contract v1 (CHANGELOG + ADR + marketing) -- score 551 (critical). Closes the loop: a feature is not done until announced.

Gap Flagged

WIG-2 (Tauri/server parity from progress.md) has zero overlap with the agent-tasks backlog. If desktop/server parity is genuinely a Q2 WIG, issues need to land in the desktop tracker -- not here.


Themis product-owner cycle -- full report at /opt/ai-dark-factory/reports/roadmap-20260507-0404.md

## Themis Roadmap Scoring -- 2026-05-07 ### Essentialism Filter (5/25 Rule) **TOP 5 vital few**: - #35 wire ExitCode into main() -- foundational; 5-line precondition - #44 F1.2 regression suite -- locks contract once #35 lands - #21 robot meta concepts_matched + wildcard_fallback -- unblocks #29 - #29 wildcard / relaxed query fallback -- user-visible search robustness - #43 criterion benchmark suite for G1 perf -- compound CI gate **NOT DOING THIS CYCLE**: #34, #33, #25, #23, #22, #18, #17, #16, #15, #14, #13, #12, #11, #9, #8, #7, #5, #4, #3, #28, #36, #32, #31, #30, #38. Choosing the F1.2 contract over breadth across F3.x and F4.x. One solid contract beats five half-finished surfaces. ### Compound-RICE Scores | Issue | Score | Band | Compound? | |-------|-------|------|-----------| | #35 | 1282 | critical | Yes (synergy=2.5) | | #44 | 504 | critical | Yes (synergy=2.0) | | #21 | 297 | critical | Yes (synergy=2.0) | | #29 | 122 | critical | -- | | #43 | 69 | high | Yes (synergy=2.2) -- SIMPLICITY FLAG: effort=5, decompose if possible | ### Ranked Top 3 1. **#35 (1282)** -- doing this means NOT spending the morning on F3.x surface (#36). 2. **#44 (504)** -- doing this means NOT writing F4.x session-command tests (#33/#34). 3. **#21 (297)** -- doing this means NOT picking up #29 in the same cycle. Ship the wiring first, then the behaviour. ### Lead Measures (4DX) - Completing **#35** unblocks #44 + every F1.x contract test - Completing **#21** unblocks #29 + downstream concepts_matched analytics - Completing **#43** unblocks G1 perf gates in CI; every WIG-1 ranking change inherits the protection ### New Issue Created - **#48** docs: announce F1.2 Robot Mode contract v1 (CHANGELOG + ADR + marketing) -- score 551 (critical). Closes the loop: a feature is not done until announced. ### Gap Flagged WIG-2 (Tauri/server parity from progress.md) has zero overlap with the agent-tasks backlog. If desktop/server parity is genuinely a Q2 WIG, issues need to land in the desktop tracker -- not here. --- *Themis product-owner cycle -- full report at `/opt/ai-dark-factory/reports/roadmap-20260507-0404.md`*
Author

Themis Roadmap Scoring -- 2026-05-07

This issue is rank #1 in this cycle's Compound-RICE analysis. Scoring summary below.

Ranked Top 3 (Compound-RICE)

  1. #35 (score=468) -- doing this means NOT doing #4 ForgivingParser wiring; the exit-code contract is the load-bearing prerequisite for the entire robot-mode surface
  2. #44 (score=504) -- doing this means NOT doing #8 broader Phase 1 suite; locks the F1.2 contract immediately after #35 lands
  3. #4 (score=191) -- doing this means NOT doing #8 Phase 1 test suite; wiring the parser before tests ensures coverage of integrated dispatch

Compound-RICE breakdown for #35

reach=65 Bug Reporting=8 confidence=0.9 synergy=2.0 effort=2 maintenance=1.0
compound_rice = 468  priority = critical  [COMPOUND OPPORTUNITY -- synergy >= 2.0]
WIG: WIG-3 (agent Middleware -- deterministic Unix tool contract)

Lead Measures (4DX)

  • Completing #35 unblocks #44 (regression suite needs wired contract to be meaningful)
  • Closes the last gap in WIG-3 deterministic Middleware contract
  • Enables new issue #49 (CI guard rail) and #50 (JSON error envelope) to attach to a stable foundation

Cycle Trade-off

Doing #35 this cycle means explicitly NOT doing F4/F5 session intelligence (clustering #23, cross-session learning #42, concept traversal #12, roleTerraphim-graph weighting #37) -- those are speculative analytics built on an unstable foundation.

New Issues Created This Cycle

  • #49: ci: enforce F1.2 robot-contract regression job on every PR (WIG-4)
  • #50: feat: emit JSON error envelope on robot-mode failures (WIG-3)

Both compound with #35 -- #49 protects the contract in CI, #50 closes the structured-error gap that blocks the v1 announcement (#47/#48).


Themis product-owner cycle 2026-05-07 -- full report: /opt/ai-dark-factory/reports/roadmap-20260507-0506.md

## Themis Roadmap Scoring -- 2026-05-07 This issue is **rank #1** in this cycle's Compound-RICE analysis. Scoring summary below. ### Ranked Top 3 (Compound-RICE) 1. **#35** (score=468) -- doing this means NOT doing #4 ForgivingParser wiring; the exit-code contract is the load-bearing prerequisite for the entire robot-mode surface 2. **#44** (score=504) -- doing this means NOT doing #8 broader Phase 1 suite; locks the F1.2 contract immediately after #35 lands 3. **#4** (score=191) -- doing this means NOT doing #8 Phase 1 test suite; wiring the parser before tests ensures coverage of integrated dispatch ### Compound-RICE breakdown for #35 ``` reach=65 Bug Reporting=8 confidence=0.9 synergy=2.0 effort=2 maintenance=1.0 compound_rice = 468 priority = critical [COMPOUND OPPORTUNITY -- synergy >= 2.0] WIG: WIG-3 (agent Middleware -- deterministic Unix tool contract) ``` ### Lead Measures (4DX) - Completing #35 unblocks #44 (regression suite needs wired contract to be meaningful) - Closes the last gap in WIG-3 deterministic Middleware contract - Enables new issue #49 (CI guard rail) and #50 (JSON error envelope) to attach to a stable foundation ### Cycle Trade-off Doing #35 this cycle means explicitly NOT doing F4/F5 session intelligence (clustering #23, cross-session learning #42, concept traversal #12, roleTerraphim-graph weighting #37) -- those are speculative analytics built on an unstable foundation. ### New Issues Created This Cycle - **#49**: ci: enforce F1.2 robot-contract regression job on every PR (WIG-4) - **#50**: feat: emit JSON error envelope on robot-mode failures (WIG-3) Both compound with #35 -- #49 protects the contract in CI, #50 closes the structured-error gap that blocks the v1 announcement (#47/#48). --- _Themis product-owner cycle 2026-05-07 -- full report: `/opt/ai-dark-factory/reports/roadmap-20260507-0506.md`_
Author

Themis Roadmap Scoring -- 2026-05-17

This issue scored as the rate-limiting keystone of the F1.2 robot-mode contract cluster.

Essentialism Filter (5/25 Rule)

Warning: no stdin data received in 3s, proceeding without it. If piping from a slow command, redirect stdin explicitly: < /dev/null to skip, or wait longer.

Themis / 5-25 Rule -- 2026-05-17 12:58 CEST


TOP 5 (vital few)

#35 feat: wire ExitCode into main() return for F1.2 robot exit code contract
Foundational. Without correct exit codes, every downstream CI gate, wrapper script, and orchestrator that calls terraphim-agent is flying blind. Blocks #44 and #49. Serves WIG-3 + WIG-4.

#50 feat: emit JSON error envelope on robot-mode failures
Completes the robot mode surface contract. A robot mode that returns unstructured stderr on failure is not a robot mode -- it is a broken CLI. Direct dependency of the regression suite. Serves WIG-3.

#51 feat: install SIGTERM/SIGPIPE signal handlers in robot mode
Production reliability gate. Unhandled signals produce corrupted JSON streams and orphaned processes in CI and orchestrator contexts. Cannot ship robot mode to WIG-4 release pipeline without this. Serves WIG-3 + WIG-4.

#44 test: F1.2 robot exit-code + JSON envelope contract regression suite
The test harness that validates #35, #50, #51 actually hold under regression. Without this, any future change silently breaks the contract. Prerequisite for #49. Serves WIG-4.

#29 feat: wildcard/relaxed query fallback when primary search returns zero results
The only WIG-1 issue with immediate user-visible impact. Zero-result searches are the primary trust-breaker for local-first search. All ranking work is irrelevant if queries return nothing. Serves WIG-1.


AVOID AT ALL COST (dangerous distractions this cycle)

#5 Tantivy session index -- full index replacement mid-cycle; high blast radius, zero WIG alignment now
#7 Wire BudgetEngine -- token economy is premature; no budget model agreed

Compound-RICE Scores

Warning: no stdin data received in 3s, proceeding without it. If piping from a slow command, redirect stdin explicitly: < /dev/null to skip, or wait longer.

Themis Scoring — Compound-RICE

Note on #50: the issue body states confidence=8 and synergy=9, which violates the defined scales (confidence 0.1–1.0; synergy 1.0–2.0+). I have re-normalised to confidence=0.85 and synergy=1.8 based on the problem description. The author should update the issue body.


SCORES

#35: reach=25 impact=9 confidence=0.92 synergy=2.5 effort=2 maintenance=1.0
  compound_rice=258.8  priority=critical  [COMPOUND OPPORTUNITY synergy=2.5]
  WIG: WIG-3 (agent orchestration / robot-mode contract)

#44: reach=70 impact=8 confidence=0.9 synergy=2.0 effort=2 maintenance=1.0
  compound_rice=504.0  priority=critical  [COMPOUND OPPORTUNITY synergy=2.0]
  WIG: WIG-3 (robot-mode contract regression coverage)
  NOTE: scores highly but is BLOCKED by #35 — cannot pass without exit codes wired

#50: reach=15 impact=9 confidence=0.85 synergy=1.8 effort=2 maintenance=1.1
  compound_rice=93.9  priority=critical
  WIG: WIG-3 (structured error output for AI orchestrators)
  NOTE: stated params used wrong scales — corrected above

#29: reach=30 impact=8 confidence=0.85 synergy=1.5 effort=3 maintenance=1.2
  compound_rice=85.0  priority=critical
  WIG: WIG-1 (core search pipeline robustness — zero-result fallback)

#51: reach=7 impact=8 confidence=0.88 synergy=1.3 effort=2 maintenance=1.0
  compound_rice=32.0  priority=critical (marginal)
  WIG: WIG-3 (signal handling completes F1.2 exit-code contract)
  NOTE: reach=7 is conservative — every robot-mode deployment is affected by
        unhandled SIGPIPE; consider raising to 20+

RANKED TOP 3

1. #35 (score=258.8) — trade-off: doing this first delays #29 (UX improvement
   visible to end users); but it is the prerequisite keystone — without it
   #44 cannot pass, #50 has no canonical codes to wrap, and #51 has nothing
   to intercept cleanly.

2. #44 (score=504.0) — trade-off: high paper score, but zero value until #35
   lands; scheduling it before #35 means CI will stay red. Doing #44
   immediately after #35 means deferring #50 (user-visible error UX) and
   #29 (zero-result fallback). The regression suite is an investment in
   future velocity, not an immediate user win.

### Execution Order

`#35 -> #44 -> #50 -> #51 -> #29`

Nothing in the F1.2 cluster ships until #35 lands. #44 (regression suite, paper score 504) is gated on #35. #50/#51 reference the canonical exit codes #35 wires. #29 (WIG-1) can run in parallel.

### Trade-off Named

Doing #35 first means deferring #29 (user-visible zero-result fallback). Justified: AI-orchestrator contract correctness is the WIG-3 active focus, and #29 has no dependents.

---
*Themis product-owner cycle -- full report at `/opt/ai-dark-factory/reports/roadmap-20260517-1301.md`*
## Themis Roadmap Scoring -- 2026-05-17 This issue scored as the **rate-limiting keystone** of the F1.2 robot-mode contract cluster. ### Essentialism Filter (5/25 Rule) Warning: no stdin data received in 3s, proceeding without it. If piping from a slow command, redirect stdin explicitly: < /dev/null to skip, or wait longer. --- **Themis / 5-25 Rule -- 2026-05-17 12:58 CEST** --- **TOP 5 (vital few)** **#35 feat: wire ExitCode into main() return for F1.2 robot exit code contract** Foundational. Without correct exit codes, every downstream CI gate, wrapper script, and orchestrator that calls `terraphim-agent` is flying blind. Blocks #44 and #49. Serves WIG-3 + WIG-4. **#50 feat: emit JSON error envelope on robot-mode failures** Completes the robot mode surface contract. A robot mode that returns unstructured stderr on failure is not a robot mode -- it is a broken CLI. Direct dependency of the regression suite. Serves WIG-3. **#51 feat: install SIGTERM/SIGPIPE signal handlers in robot mode** Production reliability gate. Unhandled signals produce corrupted JSON streams and orphaned processes in CI and orchestrator contexts. Cannot ship robot mode to WIG-4 release pipeline without this. Serves WIG-3 + WIG-4. **#44 test: F1.2 robot exit-code + JSON envelope contract regression suite** The test harness that validates #35, #50, #51 actually hold under regression. Without this, any future change silently breaks the contract. Prerequisite for #49. Serves WIG-4. **#29 feat: wildcard/relaxed query fallback when primary search returns zero results** The only WIG-1 issue with immediate user-visible impact. Zero-result searches are the primary trust-breaker for local-first search. All ranking work is irrelevant if queries return nothing. Serves WIG-1. --- **AVOID AT ALL COST (dangerous distractions this cycle)** #5 Tantivy session index -- full index replacement mid-cycle; high blast radius, zero WIG alignment now #7 Wire BudgetEngine -- token economy is premature; no budget model agreed ### Compound-RICE Scores Warning: no stdin data received in 3s, proceeding without it. If piping from a slow command, redirect stdin explicitly: < /dev/null to skip, or wait longer. ## Themis Scoring — Compound-RICE **Note on #50**: the issue body states `confidence=8` and `synergy=9`, which violates the defined scales (confidence 0.1–1.0; synergy 1.0–2.0+). I have re-normalised to `confidence=0.85` and `synergy=1.8` based on the problem description. The author should update the issue body. --- ### SCORES ``` #35: reach=25 impact=9 confidence=0.92 synergy=2.5 effort=2 maintenance=1.0 compound_rice=258.8 priority=critical [COMPOUND OPPORTUNITY synergy=2.5] WIG: WIG-3 (agent orchestration / robot-mode contract) #44: reach=70 impact=8 confidence=0.9 synergy=2.0 effort=2 maintenance=1.0 compound_rice=504.0 priority=critical [COMPOUND OPPORTUNITY synergy=2.0] WIG: WIG-3 (robot-mode contract regression coverage) NOTE: scores highly but is BLOCKED by #35 — cannot pass without exit codes wired #50: reach=15 impact=9 confidence=0.85 synergy=1.8 effort=2 maintenance=1.1 compound_rice=93.9 priority=critical WIG: WIG-3 (structured error output for AI orchestrators) NOTE: stated params used wrong scales — corrected above #29: reach=30 impact=8 confidence=0.85 synergy=1.5 effort=3 maintenance=1.2 compound_rice=85.0 priority=critical WIG: WIG-1 (core search pipeline robustness — zero-result fallback) #51: reach=7 impact=8 confidence=0.88 synergy=1.3 effort=2 maintenance=1.0 compound_rice=32.0 priority=critical (marginal) WIG: WIG-3 (signal handling completes F1.2 exit-code contract) NOTE: reach=7 is conservative — every robot-mode deployment is affected by unhandled SIGPIPE; consider raising to 20+ ``` --- ### RANKED TOP 3 ``` 1. #35 (score=258.8) — trade-off: doing this first delays #29 (UX improvement visible to end users); but it is the prerequisite keystone — without it #44 cannot pass, #50 has no canonical codes to wrap, and #51 has nothing to intercept cleanly. 2. #44 (score=504.0) — trade-off: high paper score, but zero value until #35 lands; scheduling it before #35 means CI will stay red. Doing #44 immediately after #35 means deferring #50 (user-visible error UX) and #29 (zero-result fallback). The regression suite is an investment in future velocity, not an immediate user win. ### Execution Order `#35 -> #44 -> #50 -> #51 -> #29` Nothing in the F1.2 cluster ships until #35 lands. #44 (regression suite, paper score 504) is gated on #35. #50/#51 reference the canonical exit codes #35 wires. #29 (WIG-1) can run in parallel. ### Trade-off Named Doing #35 first means deferring #29 (user-visible zero-result fallback). Justified: AI-orchestrator contract correctness is the WIG-3 active focus, and #29 has no dependents. --- *Themis product-owner cycle -- full report at `/opt/ai-dark-factory/reports/roadmap-20260517-1301.md`*
Author

Themis Roadmap Scoring -- 2026-05-18

Essentialism Filter (5/25 Rule)

TOP 5 (vital few) -- the F1.2 robot-contract cluster:

  • #35 (this issue): wire ExitCode into main() -- foundation prerequisite
  • #50: JSON error envelope on robot-mode failures
  • #51: SIGTERM/SIGPIPE handlers + envelope before exit
  • #44: F1.2 regression suite locks contract in amber
  • #49: CI enforces contract on every PR

Compound-RICE Scores

Issue Score Priority Notes
#44 504.0 critical COMPOUND (synergy=2.0) -- locks contract for all future PRs
#35 342.0 critical COMPOUND (synergy=3.0) -- unlocks 4 downstream issues
#49 129.6 critical COMPOUND (synergy=2.0) -- converts suite into hard gate
#51 32.0 critical depends on #35 + #50
#50 25.2 high JSON envelope surface

Ranked Top 3

  1. #44 (504) -- doing the regression suite means not landing incremental WIG-1/2 features this sprint; cannot merge until #35 + #50/#51 land first
  2. #35 (342) -- 1-effort fix with synergy=3.0; opportunity cost negligible
  3. #49 (129.6) -- hard CI gate; trade-off is short-term PR friction for permanent regression guard

Lead Measures (4DX)

  • Completing #35 unblocks: #50, #51, #44, #49 -- entire F1.2 cluster
  • Completing #44 unblocks: #49 enforcement + all future robot-mode features under WIG-3
  • Completing #49 unblocks: perpetual automated regression guard, closing WIG-4 quality-gate loop

Dependency chain: #35 -> #50 -> #51 -> #44 -> #49
Recommended sequencing: #35 today (effort=1), #50 + #51 in parallel (effort=2 each), then #44, then #49.

Not Doing This Cycle (Essentialism)

Sacrificed: #47 (announcement -- premature until CI-enforced), #46 (Quickwit logging epic), #43 (benchmarks -- measures wrong thing before contract stable), #42/#40/#39/#37 (F4/F5 features), #38/#34/#33/#32/#31/#30 (ergonomics + capabilities surface -- premature without F1.2 floor).

Issue Creation

NO_NEW_ISSUES_NEEDED -- backlog is sufficient. The 2 candidate gaps (envelope schema, exit-code table) overlap with #36 + #47 and would fragment the vital chain.


Themis product-owner cycle -- full report at /opt/ai-dark-factory/reports/roadmap-20260518-0702.md

## Themis Roadmap Scoring -- 2026-05-18 ### Essentialism Filter (5/25 Rule) **TOP 5 (vital few)** -- the F1.2 robot-contract cluster: - **#35** (this issue): wire ExitCode into main() -- foundation prerequisite - **#50**: JSON error envelope on robot-mode failures - **#51**: SIGTERM/SIGPIPE handlers + envelope before exit - **#44**: F1.2 regression suite locks contract in amber - **#49**: CI enforces contract on every PR ### Compound-RICE Scores | Issue | Score | Priority | Notes | |------:|------:|----------|-------| | #44 | 504.0 | critical | COMPOUND (synergy=2.0) -- locks contract for all future PRs | | #35 | 342.0 | critical | COMPOUND (synergy=3.0) -- unlocks 4 downstream issues | | #49 | 129.6 | critical | COMPOUND (synergy=2.0) -- converts suite into hard gate | | #51 | 32.0 | critical | depends on #35 + #50 | | #50 | 25.2 | high | JSON envelope surface | ### Ranked Top 3 1. **#44** (504) -- doing the regression suite means not landing incremental WIG-1/2 features this sprint; cannot merge until #35 + #50/#51 land first 2. **#35** (342) -- 1-effort fix with synergy=3.0; opportunity cost negligible 3. **#49** (129.6) -- hard CI gate; trade-off is short-term PR friction for permanent regression guard ### Lead Measures (4DX) - Completing **#35** unblocks: #50, #51, #44, #49 -- entire F1.2 cluster - Completing **#44** unblocks: #49 enforcement + all future robot-mode features under WIG-3 - Completing **#49** unblocks: perpetual automated regression guard, closing WIG-4 quality-gate loop **Dependency chain**: #35 -> #50 -> #51 -> #44 -> #49 **Recommended sequencing**: #35 today (effort=1), #50 + #51 in parallel (effort=2 each), then #44, then #49. ### Not Doing This Cycle (Essentialism) Sacrificed: #47 (announcement -- premature until CI-enforced), #46 (Quickwit logging epic), #43 (benchmarks -- measures wrong thing before contract stable), #42/#40/#39/#37 (F4/F5 features), #38/#34/#33/#32/#31/#30 (ergonomics + capabilities surface -- premature without F1.2 floor). ### Issue Creation NO_NEW_ISSUES_NEEDED -- backlog is sufficient. The 2 candidate gaps (envelope schema, exit-code table) overlap with #36 + #47 and would fragment the vital chain. --- *Themis product-owner cycle -- full report at `/opt/ai-dark-factory/reports/roadmap-20260518-0702.md`*
Author

Themis Roadmap Scoring -- 2026-05-18

Repo Pivot Note

Configured repo terraphim/terraphim-ai returns HTTP 404 on git.terraphim.cloud. Cycle executed against terraphim/agent-tasks (43 open issues). Per Themis essentialism: literal-env-var literalism that produces an empty cycle was rejected in favour of real product-strategy value against the visible active repo.

Essentialism Filter (5/25 Rule)

TOP 5 (F1.2 Robot Mode contract chain) — all serve WIG-3/WIG-4:

# Title Reason essential
#35 wire ExitCode into main() return Structural root: enum exists at exit_codes.rs but is #[allow(dead_code)]; main() returns Result<()>, so orchestrators see only 0/1. Everything else in F1.2 depends on this.
#50 emit JSON error envelope on robot-mode failures Defines the machine-readable error contract; without it, clients parse stderr strings.
#51 install SIGTERM/SIGPIPE handlers + envelope Closes signal-path gap; today SIGTERM/SIGPIPE bypass ? and emit nothing.
#44 F1.2 contract regression suite Locks the contract in CI; turns one-time implementations into durable guarantees.
#49 CI enforce robot-contract regression on every PR Tiny effort (~5min yaml). Without it, #44's investment yields near-zero regression protection.

Avoid at all cost this cycle (38 issues): all session-search Phase 2/3 expansion (#28/#29/#30/#32/#33/#34/#36), F5.3 learning extraction (#37/#42), criterion benches (#43), session/import polish (#38/#39/#40/#41/#26/#25/#24/#31), and the ADF Quickwit logging epic (#46). These are real, valuable items — but every one of them ships on top of an un-versioned, un-regression-tested CLI contract until F1.2 lands.

NOT DOING THIS CYCLE: Phase 2/3 session-search expansion, F5.3 learning extraction, benchmarks, and the logging epic are explicitly sacrificed to hold the line on F1.2 contract closure. Robot Mode is the structural foundation — downstream features gain durable testability only once F1.2 is CI-locked.

Compound-RICE Scores

Formula (R × I × C × S) / (E × M) — critical band ≥30.

#49: R=100 I=8 C=0.95 S=2.5 E=1 M=1.0  ->  1900.0  [COMPOUND]  WIG-4
#35: R=80  I=10 C=0.90 S=3.0 E=2 M=1.0  ->  1080.0  [COMPOUND]  WIG-3
#44: R=80  I=9  C=0.90 S=2.5 E=2 M=1.0  ->   810.0  [COMPOUND]  WIG-3+WIG-4
#50: R=70  I=9  C=0.85 S=2.0 E=2 M=1.0  ->   535.5  [COMPOUND]  WIG-3
#51: R=70  I=8  C=0.88 S=1.8 E=2 M=1.0  ->   443.5  [COMPOUND]  WIG-3

All five carry Synergy ≥ 1.8 — the chain is genuinely compound, not just adjacent.

Ranked Top 3

  1. #49 (1900) — trade-off: gate briefly tests nothing until #44 lands, but yaml is ~5min and pre-positions the guardrail. Doing #49 means NOT adding new robot subcommands (#36) this cycle.
  2. #35 (1080) — trade-off: 9 comments of accumulated discussion to close. Once landed, the entire F1.2 chain compounds. Doing #35 means NOT refactoring the parse_chained_command bug (#24) this cycle.
  3. #44 (810) — trade-off: requires #35 first; modest test-writing effort but durable asset. Doing #44 means NOT implementing /sessions timeline (#34) or export (#33) this cycle.

Lead Measures (4DX)

  • Completing #35 unblocks #50, #51, #44, #49, #47 — the full F1.2 contract chain.
  • Completing #44 unblocks #47 marketing announcement; gives orchestrators a stable contract.
  • Completing #49 unblocks WIG-4 quality-gate enforcement for every future Robot-Mode change.
  • Completing #50 + #51 unblocks orchestrators integrating terraphim-agent into CI pipelines and timeout-killing supervisors.
  • No simplicity flags this cycle: no vital-5 item has effort >= 7.

Marketing Hint

When #35 + #44 + #47 land together: announce Robot Mode F1.2 Contract v1 — terraphim-agent as a deterministic Unix tool with 8 standardised exit codes and a parseable JSON error envelope; orchestrators can rely on it the way they rely on grep or jq.

Issue Creation Verdict

NO_NEW_ISSUES_NEEDED. The bottleneck is delivery, not discovery. Vital 5 already exists with explicit acceptance criteria. 3rd consecutive cycle pointing at the same chain — discipline this cycle is RESTRAINT.


Themis product-owner cycle -- full report at /opt/ai-dark-factory/reports/roadmap-20260518-0957.md

## Themis Roadmap Scoring -- 2026-05-18 ### Repo Pivot Note Configured repo `terraphim/terraphim-ai` returns HTTP 404 on git.terraphim.cloud. Cycle executed against **`terraphim/agent-tasks`** (43 open issues). Per Themis essentialism: literal-env-var literalism that produces an empty cycle was rejected in favour of real product-strategy value against the visible active repo. ### Essentialism Filter (5/25 Rule) **TOP 5 (F1.2 Robot Mode contract chain) — all serve WIG-3/WIG-4:** | # | Title | Reason essential | |---|---|---| | #35 | wire ExitCode into main() return | Structural root: enum exists at `exit_codes.rs` but is `#[allow(dead_code)]`; `main()` returns `Result<()>`, so orchestrators see only 0/1. Everything else in F1.2 depends on this. | | #50 | emit JSON error envelope on robot-mode failures | Defines the machine-readable error contract; without it, clients parse stderr strings. | | #51 | install SIGTERM/SIGPIPE handlers + envelope | Closes signal-path gap; today SIGTERM/SIGPIPE bypass `?` and emit nothing. | | #44 | F1.2 contract regression suite | Locks the contract in CI; turns one-time implementations into durable guarantees. | | #49 | CI enforce robot-contract regression on every PR | Tiny effort (~5min yaml). Without it, #44's investment yields near-zero regression protection. | **Avoid at all cost this cycle** (38 issues): all session-search Phase 2/3 expansion (#28/#29/#30/#32/#33/#34/#36), F5.3 learning extraction (#37/#42), criterion benches (#43), session/import polish (#38/#39/#40/#41/#26/#25/#24/#31), and the ADF Quickwit logging epic (#46). These are real, valuable items — but every one of them ships on top of an un-versioned, un-regression-tested CLI contract until F1.2 lands. **NOT DOING THIS CYCLE**: Phase 2/3 session-search expansion, F5.3 learning extraction, benchmarks, and the logging epic are explicitly sacrificed to hold the line on F1.2 contract closure. Robot Mode is the structural foundation — downstream features gain durable testability only once F1.2 is CI-locked. ### Compound-RICE Scores Formula `(R × I × C × S) / (E × M)` — critical band ≥30. ``` #49: R=100 I=8 C=0.95 S=2.5 E=1 M=1.0 -> 1900.0 [COMPOUND] WIG-4 #35: R=80 I=10 C=0.90 S=3.0 E=2 M=1.0 -> 1080.0 [COMPOUND] WIG-3 #44: R=80 I=9 C=0.90 S=2.5 E=2 M=1.0 -> 810.0 [COMPOUND] WIG-3+WIG-4 #50: R=70 I=9 C=0.85 S=2.0 E=2 M=1.0 -> 535.5 [COMPOUND] WIG-3 #51: R=70 I=8 C=0.88 S=1.8 E=2 M=1.0 -> 443.5 [COMPOUND] WIG-3 ``` All five carry Synergy ≥ 1.8 — the chain is genuinely compound, not just adjacent. ### Ranked Top 3 1. **#49 (1900)** — trade-off: gate briefly tests nothing until #44 lands, but yaml is ~5min and pre-positions the guardrail. *Doing #49 means NOT adding new robot subcommands (#36) this cycle.* 2. **#35 (1080)** — trade-off: 9 comments of accumulated discussion to close. Once landed, the entire F1.2 chain compounds. *Doing #35 means NOT refactoring the parse_chained_command bug (#24) this cycle.* 3. **#44 (810)** — trade-off: requires #35 first; modest test-writing effort but durable asset. *Doing #44 means NOT implementing /sessions timeline (#34) or export (#33) this cycle.* ### Lead Measures (4DX) - Completing **#35** unblocks #50, #51, #44, #49, #47 — the full F1.2 contract chain. - Completing **#44** unblocks #47 marketing announcement; gives orchestrators a stable contract. - Completing **#49** unblocks WIG-4 quality-gate enforcement for every future Robot-Mode change. - Completing **#50 + #51** unblocks orchestrators integrating terraphim-agent into CI pipelines and timeout-killing supervisors. - No simplicity flags this cycle: no vital-5 item has effort >= 7. ### Marketing Hint When #35 + #44 + #47 land together: announce *Robot Mode F1.2 Contract v1* — terraphim-agent as a deterministic Unix tool with 8 standardised exit codes and a parseable JSON error envelope; orchestrators can rely on it the way they rely on `grep` or `jq`. ### Issue Creation Verdict **NO_NEW_ISSUES_NEEDED**. The bottleneck is **delivery**, not **discovery**. Vital 5 already exists with explicit acceptance criteria. 3rd consecutive cycle pointing at the same chain — discipline this cycle is RESTRAINT. --- *Themis product-owner cycle -- full report at `/opt/ai-dark-factory/reports/roadmap-20260518-0957.md`*
Author

Themis Roadmap Scoring -- 2026-05-18T09:02:27Z

Essentialism Filter (5/25 Rule)

TOP 5 (vital few -- will be scored):
#35: Wire ExitCode into main() -- foundational F1.2 contract; every downstream robot issue (#50/#51/#44/#49) is blocked until main() returns a meaningful exit code (WIG-3)
#50: Emit JSON error envelope on robot failures -- completes the error-path contract so agents can parse failures deterministically; prerequisite for the regression suite (WIG-3)
#44: Robot exit-code + JSON envelope regression suite -- turns the contract into an executable specification; without tests the contract is aspiration not fact (WIG-4)
#49: CI enforcement of robot-contract regression job on every PR -- gates the entire pipeline against contract regressions; highest PageRank in the repo (WIG-4)
#29: Wildcard/relaxed query fallback when primary search returns zero results -- zero-result search is a silent user-facing failure; no other WIG-1 item appears in this list (WIG-1)

AVOID AT ALL COST (dangerous distractions this cycle):
#47: Announce/CHANGELOG/ADR for F1.2 -- never market before the contract is gated in CI; this is a lagging artefact, not a leading one
#46: Quickwit logging epic -- large new integration surface with no WIG alignment; opens scope while core stability is unresolved
#43: Criterion benchmark suite -- performance measurement belongs after correctness is enforced; benchmarking a broken contract produces meaningless numbers
#42: Lesson extractor (F5.3) -- future-layer capability; F1 contract must close first or this learns from undefined behaviour
#37: Rolegraph session-frequency edge weighting -- advanced ML feature with no path to any current WIG
#28: OpenCode/Codex JSONL connectors -- new source integrations before existing robot contract is stable adds untested surface area
#34: /sessions timeline command -- session UX browsing; zero WIG alignment this cycle
#33: /sessions export command -- session sharing; same reasoning as #34
#38: Load LearningCaptureConfig from TOML -- configuration ergonomics that blocks nothing on the critical path
#25: Custom command aliases -- UX polish; addressed after the contract foundation is proven

NOT DOING THIS CYCLE: All session-management (F4), cross-session learning (F5), robot API surface polish (F3.1-F3.3), and UX ergonomics (F2.2-F2.3) work is explicitly sacrificed because layering new capabilities onto an unverified execution contract produces compounding technical debt, not progress.

Compound-RICE Top 3 (this is cycle 4 of the F1.2 chain)

#35: reach=40 impact=9 confidence=0.9 synergy=2.5 effort=2 maintenance=1.0
  compound_rice=405  priority=critical  [COMPOUND OPPORTUNITY: synergy=2.5, keystone for #44/#49/#50]
--
#50: reach=25 impact=8 confidence=0.85 synergy=1.8 effort=2 maintenance=1.2
  compound_rice=127.5  priority=critical
--
#44: reach=70 impact=8 confidence=0.9 synergy=2.0 effort=2 maintenance=1.0
  compound_rice=504  priority=critical  [COMPOUND OPPORTUNITY: synergy=2.0]
--
#49: reach=80 impact=8 confidence=0.9 synergy=2.0 effort=1 maintenance=1.0
  compound_rice=1152  priority=critical  [COMPOUND OPPORTUNITY: synergy=2.0]
--
#29: reach=30 impact=7 confidence=0.75 synergy=1.5 effort=4 maintenance=1.3
  compound_rice=45.4  priority=critical

Execution Order

#35 -> (#50 || #44 in parallel) -> #49 -> #29 (independent)

Decision

NO_NEW_ISSUES_NEEDED (4th consecutive cycle)

The five tracked issues (#35, #50, #44, #49, #29) form a complete sequenced chain covering WIG-1, WIG-3, WIG-4. WIG-2 (Tauri parity) produced no candidate meeting all six creation criteria. Creating issues for it now would dilute focus from the unfinished robot-contract foundation.

Not doing this cycle (essentialism): all session-management (F4), cross-session learning (F5), robot API surface polish (F3.1-F3.3), and UX ergonomics (F2.2-F2.3) work is explicitly sacrificed.


Themis product-owner cycle 4 -- full report at /opt/ai-dark-factory/reports/roadmap-20260518-1102.md

## Themis Roadmap Scoring -- 2026-05-18T09:02:27Z ### Essentialism Filter (5/25 Rule) TOP 5 (vital few -- will be scored): #35: Wire ExitCode into main() -- foundational F1.2 contract; every downstream robot issue (#50/#51/#44/#49) is blocked until main() returns a meaningful exit code (WIG-3) #50: Emit JSON error envelope on robot failures -- completes the error-path contract so agents can parse failures deterministically; prerequisite for the regression suite (WIG-3) #44: Robot exit-code + JSON envelope regression suite -- turns the contract into an executable specification; without tests the contract is aspiration not fact (WIG-4) #49: CI enforcement of robot-contract regression job on every PR -- gates the entire pipeline against contract regressions; highest PageRank in the repo (WIG-4) #29: Wildcard/relaxed query fallback when primary search returns zero results -- zero-result search is a silent user-facing failure; no other WIG-1 item appears in this list (WIG-1) AVOID AT ALL COST (dangerous distractions this cycle): #47: Announce/CHANGELOG/ADR for F1.2 -- never market before the contract is gated in CI; this is a lagging artefact, not a leading one #46: Quickwit logging epic -- large new integration surface with no WIG alignment; opens scope while core stability is unresolved #43: Criterion benchmark suite -- performance measurement belongs after correctness is enforced; benchmarking a broken contract produces meaningless numbers #42: Lesson extractor (F5.3) -- future-layer capability; F1 contract must close first or this learns from undefined behaviour #37: Rolegraph session-frequency edge weighting -- advanced ML feature with no path to any current WIG #28: OpenCode/Codex JSONL connectors -- new source integrations before existing robot contract is stable adds untested surface area #34: /sessions timeline command -- session UX browsing; zero WIG alignment this cycle #33: /sessions export command -- session sharing; same reasoning as #34 #38: Load LearningCaptureConfig from TOML -- configuration ergonomics that blocks nothing on the critical path #25: Custom command aliases -- UX polish; addressed after the contract foundation is proven NOT DOING THIS CYCLE: All session-management (F4), cross-session learning (F5), robot API surface polish (F3.1-F3.3), and UX ergonomics (F2.2-F2.3) work is explicitly sacrificed because layering new capabilities onto an unverified execution contract produces compounding technical debt, not progress. ### Compound-RICE Top 3 (this is cycle 4 of the F1.2 chain) ``` #35: reach=40 impact=9 confidence=0.9 synergy=2.5 effort=2 maintenance=1.0 compound_rice=405 priority=critical [COMPOUND OPPORTUNITY: synergy=2.5, keystone for #44/#49/#50] -- #50: reach=25 impact=8 confidence=0.85 synergy=1.8 effort=2 maintenance=1.2 compound_rice=127.5 priority=critical -- #44: reach=70 impact=8 confidence=0.9 synergy=2.0 effort=2 maintenance=1.0 compound_rice=504 priority=critical [COMPOUND OPPORTUNITY: synergy=2.0] -- #49: reach=80 impact=8 confidence=0.9 synergy=2.0 effort=1 maintenance=1.0 compound_rice=1152 priority=critical [COMPOUND OPPORTUNITY: synergy=2.0] -- #29: reach=30 impact=7 confidence=0.75 synergy=1.5 effort=4 maintenance=1.3 compound_rice=45.4 priority=critical ``` ### Execution Order `#35 -> (#50 || #44 in parallel) -> #49 -> #29 (independent)` ### Decision **NO_NEW_ISSUES_NEEDED** (4th consecutive cycle) The five tracked issues (#35, #50, #44, #49, #29) form a complete sequenced chain covering WIG-1, WIG-3, WIG-4. WIG-2 (Tauri parity) produced no candidate meeting all six creation criteria. Creating issues for it now would dilute focus from the unfinished robot-contract foundation. **Not doing this cycle (essentialism)**: all session-management (F4), cross-session learning (F5), robot API surface polish (F3.1-F3.3), and UX ergonomics (F2.2-F2.3) work is explicitly sacrificed. --- *Themis product-owner cycle 4 -- full report at `/opt/ai-dark-factory/reports/roadmap-20260518-1102.md`*
Author

Themis Roadmap Scoring -- 2026-05-30

Essentialism Filter (5/25 Rule)

TOP 5 vital few (F1.2 robot contract chain -- unchanged 7+ cycles):

  • #35 wire ExitCode into main() -- WIG-3 -- head blocker
  • #50 emit JSON error envelope on robot-mode failures -- WIG-3
  • #44 F1.2 robot exit-code + JSON envelope contract regression suite -- WIG-3/4
  • #49 ci: enforce F1.2 regression job on every PR -- WIG-4
  • #51 SIGTERM/SIGPIPE signal handlers in robot mode -- WIG-3

Compound-RICE Scores

# RICE Priority Synergy Notes
#44 504 critical 2.0 COMPOUND makes F1.2 investment permanent
#35 486 critical 2.0 COMPOUND head blocker for entire chain
#49 130 critical 2.0 COMPOUND locks regression at merge time
#50 41 critical 2.0 COMPOUND error-path coverage for #44
#51 21 high 1.3 production-readiness completion

Ranked Top 3

  1. #44 (504) -- COMPOUND -- doing this means deferring WIG-1 stability work; tests can be written first, but cannot pass until #35+#50 land
  2. #35 (486) -- COMPOUND -- this is the critical-path change; everything waits on this
  3. #49 (130) -- COMPOUND -- trivial CI effort (~1h), zero value until #44 exists; schedule immediately after

Lead Measures (4DX)

  • Completing #35 unblocks: #44, #50, #51 + WIG-3 milestone (F1.2 testable e2e)
  • Completing #50 unblocks: #44 full coverage (error-path assertions)
  • Completing #44 unblocks: #49 + all future F1.2 consumers
  • Completing #49 unblocks: WIG-4 quality gate (contract enforced at merge time)

Execution Order

Week 1:  #35 + #50  (parallel -- independent implementations)
Week 1:  #51        (follows #35, low effort)
Week 2:  #44        (needs #35 + #50 passing; TDD-first)
Week 2:  #49        (follows #44; ~1h CI job)

NOT DOING THIS CYCLE (essentialism)

All session features (F4.x: #34, #33), learning capture enhancements (F5.x: #42, #41, #40, #38, #37), KG routing (#52), and Quickwit logging epic (#46) are explicitly sacrificed. The only path that turns WIG-3 and WIG-4 from aspirations into locked-in guarantees is shipping the tested, CI-enforced robot contract chain.

Stall Watch

The F1.2 chain has been the top-5 vital few for 7+ consecutive cycles without movement. To break the loop, two new issues were created this cycle:

  • #53 Add chain-stall escalation to Themis orchestrator (WIG-3, RICE~51) -- formalises escalation when a chain stalls 3+ cycles
  • #54 Enforce AC completeness gate before issue pickup (WIG-4, RICE~38) -- prevents NO-CODE outcomes from ambiguous specs

Recommendation

Assign #35 to a developer agent now. It is a single-file change (main.rs ExitCode plumbing) with explicit spec reference (F1.2 in terraphim-agent-session-search-spec.md). Effort=2. There is no remaining ambiguity; the chain stalls because the head is unowned, not because it is hard.


Themis product-owner cycle -- full report at /opt/ai-dark-factory/reports/roadmap-20260530-1104.md

## Themis Roadmap Scoring -- 2026-05-30 ### Essentialism Filter (5/25 Rule) **TOP 5 vital few** (F1.2 robot contract chain -- unchanged 7+ cycles): - **#35** wire ExitCode into main() -- WIG-3 -- head blocker - **#50** emit JSON error envelope on robot-mode failures -- WIG-3 - **#44** F1.2 robot exit-code + JSON envelope contract regression suite -- WIG-3/4 - **#49** ci: enforce F1.2 regression job on every PR -- WIG-4 - **#51** SIGTERM/SIGPIPE signal handlers in robot mode -- WIG-3 ### Compound-RICE Scores | # | RICE | Priority | Synergy | Notes | |---|------|----------|---------|-------| | #44 | 504 | critical | 2.0 COMPOUND | makes F1.2 investment permanent | | #35 | 486 | critical | 2.0 COMPOUND | head blocker for entire chain | | #49 | 130 | critical | 2.0 COMPOUND | locks regression at merge time | | #50 | 41 | critical | 2.0 COMPOUND | error-path coverage for #44 | | #51 | 21 | high | 1.3 | production-readiness completion | ### Ranked Top 3 1. **#44** (504) -- COMPOUND -- doing this means deferring WIG-1 stability work; tests can be written first, but cannot pass until #35+#50 land 2. **#35** (486) -- COMPOUND -- this is the critical-path change; everything waits on this 3. **#49** (130) -- COMPOUND -- trivial CI effort (~1h), zero value until #44 exists; schedule immediately after ### Lead Measures (4DX) - Completing **#35** unblocks: #44, #50, #51 + WIG-3 milestone (F1.2 testable e2e) - Completing **#50** unblocks: #44 full coverage (error-path assertions) - Completing **#44** unblocks: #49 + all future F1.2 consumers - Completing **#49** unblocks: WIG-4 quality gate (contract enforced at merge time) ### Execution Order ``` Week 1: #35 + #50 (parallel -- independent implementations) Week 1: #51 (follows #35, low effort) Week 2: #44 (needs #35 + #50 passing; TDD-first) Week 2: #49 (follows #44; ~1h CI job) ``` ### NOT DOING THIS CYCLE (essentialism) All session features (F4.x: #34, #33), learning capture enhancements (F5.x: #42, #41, #40, #38, #37), KG routing (#52), and Quickwit logging epic (#46) are explicitly sacrificed. The only path that turns WIG-3 and WIG-4 from aspirations into locked-in guarantees is shipping the tested, CI-enforced robot contract chain. ### Stall Watch The F1.2 chain has been the top-5 vital few for **7+ consecutive cycles** without movement. To break the loop, two new issues were created this cycle: - **#53** Add chain-stall escalation to Themis orchestrator (WIG-3, RICE~51) -- formalises escalation when a chain stalls 3+ cycles - **#54** Enforce AC completeness gate before issue pickup (WIG-4, RICE~38) -- prevents NO-CODE outcomes from ambiguous specs ### Recommendation Assign **#35** to a developer agent **now**. It is a single-file change (`main.rs` ExitCode plumbing) with explicit spec reference (F1.2 in `terraphim-agent-session-search-spec.md`). Effort=2. There is no remaining ambiguity; the chain stalls because the head is unowned, not because it is hard. --- *Themis product-owner cycle -- full report at `/opt/ai-dark-factory/reports/roadmap-20260530-1104.md`*
Author

Themis Roadmap Scoring -- 2026-05-31 (Cycle 7+)

Essentialism Filter (5/25 Rule)

TOP 5 (vital few): #53, #54, #35, #52, #50
Avoid at all cost (sacrificed): #46 (umbrella), #42/#43 (premature), #34/#33/#31/#30/#29/#28 (polish), #17/#18 (observability NTH), #14/#15/#16 (session UX), #40/#41/#21/#36/#37/#51 (deps on F1.2 landing first).

Not doing this cycle: All session-UX polish (F4.x), all observability nice-to-haves, all forward-looking benchmarks. Choosing to fix orchestration stall over add polish on top of a stalled pipeline.

Compound-RICE Scores

# Score Band WIG
#35 504 critical WIG-3
#50 504 critical WIG-3
#53 50.7 critical WIG-3
#52 42.5 critical WIG-3
#54 38.25 critical WIG-4

Ranked Top 3 (with trade-offs)

  1. #35 (504) -- Land wire-ExitCode FIRST. Trade-off: doing this means NOT working on #44/#47 until #35 merges. The cost of waiting another cycle is 6+ cycles of orchestrator paralysis.
  2. #53 (50.7) -- Ship chain-stall escalation in parallel. Trade-off: meta-work feels less concrete than feature work; the alternative is infinite re-scoring.
  3. #52 (42.5) -- Continue pi_terraphim_router momentum (status/in-progress). Trade-off: pausing wastes context.

Lead Measures (4DX)

  • Completing #35 unblocks #44, #47, #49, #50 (entire F1.2 chain).
  • Completing #53 unblocks all future Themis cycles -- breaks the 6-cycle stall.
  • Completing #54 prevents future "NO-CODE" / missing-reviewer cycles.

Stagnation Escalation (Cycle 7+)

The F1.2 chain has remained the top-ranked unactioned cluster for 6+ consecutive Themis cycles. Per #53's own definition, this IS the chain-stall condition.

Themis recommends -- human decision required:

  1. Assign a named owner to #35 with a 48-hour budget, OR
  2. Split #35 into smaller sub-issues if scope is intractable, OR
  3. Close #35 if F1.2 contract is no longer essential to Q2 2026 WIGs (re-evaluate WIG-3 scope).

Marketing hint when #35 lands: "terraphim-agent now returns standardised exit codes -- AI orchestrators get deterministic CI/CD integration."


Themis cycle 7+ -- full report at /opt/ai-dark-factory/reports/roadmap-20260531-0758.md
Repo: terraphim/agent-tasks (pivot from terraphim-ai 404)

## Themis Roadmap Scoring -- 2026-05-31 (Cycle 7+) ### Essentialism Filter (5/25 Rule) **TOP 5 (vital few)**: #53, #54, #35, #52, #50 **Avoid at all cost (sacrificed)**: #46 (umbrella), #42/#43 (premature), #34/#33/#31/#30/#29/#28 (polish), #17/#18 (observability NTH), #14/#15/#16 (session UX), #40/#41/#21/#36/#37/#51 (deps on F1.2 landing first). **Not doing this cycle**: All session-UX polish (F4.x), all observability nice-to-haves, all forward-looking benchmarks. Choosing to **fix orchestration stall** over **add polish on top of a stalled pipeline**. ### Compound-RICE Scores | # | Score | Band | WIG | |---|-------|------|-----| | #35 | **504** | critical | WIG-3 | | #50 | **504** | critical | WIG-3 | | #53 | **50.7** | critical | WIG-3 | | #52 | **42.5** | critical | WIG-3 | | #54 | **38.25** | critical | WIG-4 | ### Ranked Top 3 (with trade-offs) 1. **#35 (504)** -- Land wire-ExitCode FIRST. Trade-off: doing this means NOT working on #44/#47 until #35 merges. The cost of waiting another cycle is 6+ cycles of orchestrator paralysis. 2. **#53 (50.7)** -- Ship chain-stall escalation in parallel. Trade-off: meta-work feels less concrete than feature work; the alternative is infinite re-scoring. 3. **#52 (42.5)** -- Continue pi_terraphim_router momentum (status/in-progress). Trade-off: pausing wastes context. ### Lead Measures (4DX) - Completing **#35** unblocks #44, #47, #49, #50 (entire F1.2 chain). - Completing **#53** unblocks all future Themis cycles -- breaks the 6-cycle stall. - Completing **#54** prevents future "NO-CODE" / missing-reviewer cycles. ### Stagnation Escalation (Cycle 7+) The F1.2 chain has remained the top-ranked unactioned cluster for **6+ consecutive Themis cycles**. Per #53's own definition, this IS the chain-stall condition. **Themis recommends -- human decision required**: 1. Assign a named owner to #35 with a 48-hour budget, OR 2. Split #35 into smaller sub-issues if scope is intractable, OR 3. Close #35 if F1.2 contract is no longer essential to Q2 2026 WIGs (re-evaluate WIG-3 scope). Marketing hint when #35 lands: *"terraphim-agent now returns standardised exit codes -- AI orchestrators get deterministic CI/CD integration."* --- *Themis cycle 7+ -- full report at `/opt/ai-dark-factory/reports/roadmap-20260531-0758.md`* *Repo: terraphim/agent-tasks (pivot from terraphim-ai 404)*
Sign in to join this conversation.