triflux 10.44.0 → 10.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/README.md +1 -1
  2. package/adapters/codex/skills/tfx-harness/SKILL.md +45 -9
  3. package/bin/tfx-live.mjs +752 -77
  4. package/bin/triflux.mjs +9 -6
  5. package/hooks/codex-session-hook.mjs +67 -1
  6. package/hooks/cto-north-star-brief.mjs +3 -16
  7. package/hooks/error-context.mjs +3 -6
  8. package/hooks/hook-manager.mjs +1 -1
  9. package/hooks/hook-registry.json +0 -11
  10. package/hooks/keyword-rules.json +8 -4
  11. package/hooks/permission-safe-allow.mjs +36 -2
  12. package/hooks/session-start-fast.mjs +50 -1
  13. package/hooks/session-start-lake.mjs +3 -16
  14. package/hub/bridge.mjs +111 -5
  15. package/hub/gemini-adapter.mjs +29 -11
  16. package/hub/lib/memory-store.mjs +66 -30
  17. package/hub/lib/tfx-route-args.mjs +41 -4
  18. package/hub/pipe.mjs +10 -15
  19. package/hub/reflexion.mjs +0 -57
  20. package/hub/router.mjs +202 -24
  21. package/hub/schema.sql +1 -0
  22. package/hub/server.mjs +172 -93
  23. package/hub/store.mjs +106 -33
  24. package/hub/team/backend.mjs +4 -2
  25. package/hub/team/claude-daemon-control.mjs +2 -0
  26. package/hub/team/cli/commands/start/start-headless.mjs +2 -0
  27. package/hub/team/cli/commands/start/start-mux.mjs +24 -3
  28. package/hub/team/cli/services/runtime-mode.mjs +23 -9
  29. package/hub/team/codex-review.mjs +2 -3
  30. package/hub/team/conductor.mjs +80 -24
  31. package/hub/team/cto-auto-collect.mjs +2 -6
  32. package/hub/team/cto-pull.mjs +4 -0
  33. package/hub/team/dashboard-open.mjs +1 -0
  34. package/hub/team/execution-mode.mjs +38 -2
  35. package/hub/team/headless.mjs +493 -82
  36. package/hub/team/interactive-tui-transport.mjs +15 -1
  37. package/hub/team/launcher-template.mjs +19 -2
  38. package/hub/team/orchestrator.mjs +36 -9
  39. package/hub/team/pane.mjs +176 -14
  40. package/hub/team/psmux.mjs +79 -70
  41. package/hub/team/retry-state-machine.mjs +39 -16
  42. package/hub/team/session.mjs +57 -0
  43. package/hub/team/terminal-opener.mjs +68 -13
  44. package/hub/team/tui-viewer.mjs +65 -14
  45. package/hub/tools.mjs +6 -0
  46. package/hub/workers/codex-mcp.mjs +34 -5
  47. package/hud/cli-policy.mjs +69 -0
  48. package/hud/constants.mjs +20 -17
  49. package/hud/context-monitor.mjs +31 -21
  50. package/hud/hud-qos-status.mjs +81 -91
  51. package/hud/providers/claude.mjs +150 -84
  52. package/hud/providers/codex.mjs +10 -1
  53. package/hud/renderers.mjs +21 -59
  54. package/hud/utils.mjs +1 -15
  55. package/package.json +1 -1
  56. package/scripts/__tests__/keyword-detector.test.mjs +89 -1
  57. package/scripts/__tests__/release-governance.test.mjs +94 -1
  58. package/scripts/__tests__/skill-surface.test.mjs +6 -4
  59. package/scripts/__tests__/tfx-route-bash-node-parity.test.mjs +6 -4
  60. package/scripts/__tests__/tfx-route-node-entry.test.mjs +23 -17
  61. package/scripts/claude-login-detect.mjs +107 -25
  62. package/scripts/ensure-agy-hooks.mjs +31 -1
  63. package/scripts/keyword-detector.mjs +11 -1
  64. package/scripts/lib/agent-route-policy.mjs +29 -22
  65. package/scripts/lib/cli-agy.mjs +24 -4
  66. package/scripts/lib/codex-profile-config.mjs +26 -8
  67. package/scripts/lib/codex-recovery.sh +19 -0
  68. package/scripts/lib/gemini-profiles.mjs +113 -29
  69. package/scripts/lib/keyword-rules.mjs +12 -0
  70. package/scripts/lib/logger.mjs +60 -43
  71. package/scripts/lib/machine-profile.mjs +293 -0
  72. package/scripts/lib/mcp-health.mjs +44 -18
  73. package/scripts/notion-read.mjs +2 -1
  74. package/scripts/release/check-packages-mirror.mjs +53 -1
  75. package/scripts/release/lib.mjs +1 -2
  76. package/scripts/release/prepare.mjs +24 -9
  77. package/scripts/remote-spawn.mjs +830 -32
  78. package/scripts/session-stale-cleanup.mjs +0 -1
  79. package/scripts/setup.mjs +474 -143
  80. package/scripts/sync-hub-mcp-settings.mjs +11 -3
  81. package/scripts/test-lock.mjs +15 -1
  82. package/scripts/tfx-gate-activate.mjs +4 -4
  83. package/scripts/tfx-route-post.mjs +90 -13
  84. package/scripts/tfx-route.sh +502 -126
  85. package/skills/merge-worktree/SKILL.md +3 -3
  86. package/skills/star-prompt/skill.json +1 -1
  87. package/skills/tfx-analysis/SKILL.md +8 -9
  88. package/skills/tfx-analysis/skill.json +1 -10
  89. package/skills/tfx-auto/SKILL.md +203 -46
  90. package/skills/tfx-auto/skill.json +2 -23
  91. package/skills/tfx-doctor/skill.json +0 -3
  92. package/skills/tfx-find/skill.json +0 -7
  93. package/skills/tfx-forge/SKILL.md +2 -2
  94. package/skills/tfx-forge/skill.json +0 -7
  95. package/skills/tfx-goal-clarify/skill.json +5 -0
  96. package/skills/tfx-harness/SKILL.md +26 -3
  97. package/skills/tfx-harness/skill.json +5 -0
  98. package/skills/tfx-hooks/SKILL.md +0 -2
  99. package/skills/tfx-hooks/skill.json +0 -3
  100. package/skills/tfx-hub/SKILL.md +1 -6
  101. package/skills/tfx-hub/skill.json +0 -3
  102. package/skills/tfx-index/skill.json +0 -6
  103. package/skills/tfx-interview/SKILL.md +0 -2
  104. package/skills/tfx-live/SKILL.md +22 -1
  105. package/skills/tfx-live/skill.json +0 -5
  106. package/skills/tfx-plan/SKILL.md +7 -8
  107. package/skills/tfx-plan/skill.json +1 -12
  108. package/skills/tfx-profile/SKILL.md +6 -6
  109. package/skills/tfx-profile/skill.json +0 -3
  110. package/skills/tfx-prune/SKILL.md +4 -6
  111. package/skills/tfx-qa/SKILL.md +7 -7
  112. package/skills/tfx-qa/skill.json +1 -11
  113. package/skills/tfx-ralph/SKILL.md +8 -11
  114. package/skills/tfx-remote/SKILL.md +2 -2
  115. package/skills/tfx-remote/skill.json +0 -3
  116. package/skills/tfx-research/SKILL.md +2 -2
  117. package/skills/tfx-research/skill.json +1 -16
  118. package/skills/tfx-review/SKILL.md +11 -11
  119. package/skills/tfx-review/skill.json +1 -11
  120. package/skills/tfx-setup/SKILL.md +5 -6
  121. package/skills/tfx-setup/skill.json +0 -3
  122. package/skills/tfx-ship/skill.json +1 -9
  123. package/skills/tfx-wt/skill.json +0 -7
  124. package/tui/codex-profile.mjs +2 -1
  125. package/tui/gemini-profile.mjs +11 -24
  126. package/tui/monitor.mjs +1 -0
  127. package/tui/setup.mjs +3 -3
  128. package/scripts/headless-guard-fast.sh +0 -29
  129. package/scripts/headless-guard.mjs +0 -523
  130. package/skills/tfx-autopilot/SKILL.md +0 -51
  131. package/skills/tfx-autopilot/skill.json +0 -12
  132. package/skills/tfx-codex-swarm-workspace/iteration-1/benchmark.json +0 -75
  133. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/eval_metadata.json +0 -42
  134. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/with_skill/grading.json +0 -39
  135. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/with_skill/outputs/analysis.md +0 -87
  136. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/with_skill/outputs/classification.md +0 -35
  137. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/with_skill/outputs/commands.sh +0 -275
  138. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/with_skill/outputs/routing.md +0 -56
  139. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/with_skill/timing.json +0 -5
  140. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/without_skill/grading.json +0 -39
  141. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/without_skill/outputs/analysis.md +0 -92
  142. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/without_skill/outputs/classification.md +0 -71
  143. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/without_skill/outputs/commands.sh +0 -264
  144. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/without_skill/outputs/routing.md +0 -113
  145. package/skills/tfx-codex-swarm-workspace/iteration-1/full-swarm-all-prds/without_skill/timing.json +0 -5
  146. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/eval_metadata.json +0 -32
  147. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/with_skill/grading.json +0 -29
  148. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/with_skill/outputs/analysis.md +0 -96
  149. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/with_skill/outputs/classification.md +0 -38
  150. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/with_skill/outputs/commands.sh +0 -151
  151. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/with_skill/outputs/routing.md +0 -51
  152. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/with_skill/timing.json +0 -5
  153. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/without_skill/grading.json +0 -29
  154. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/without_skill/outputs/analysis.md +0 -127
  155. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/without_skill/outputs/classification.md +0 -57
  156. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/without_skill/outputs/commands.sh +0 -129
  157. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/without_skill/outputs/routing.md +0 -84
  158. package/skills/tfx-codex-swarm-workspace/iteration-1/implicit-swarm-no-keywords/without_skill/timing.json +0 -5
  159. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/eval_metadata.json +0 -27
  160. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/with_skill/grading.json +0 -24
  161. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/with_skill/outputs/analysis.md +0 -98
  162. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/with_skill/outputs/classification.md +0 -65
  163. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/with_skill/outputs/commands.sh +0 -123
  164. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/with_skill/outputs/routing.md +0 -66
  165. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/with_skill/timing.json +0 -5
  166. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/without_skill/grading.json +0 -20
  167. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/without_skill/outputs/analysis.md +0 -88
  168. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/without_skill/outputs/classification.md +0 -40
  169. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/without_skill/outputs/commands.sh +0 -130
  170. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/without_skill/outputs/routing.md +0 -61
  171. package/skills/tfx-codex-swarm-workspace/iteration-1/selective-spawn-with-override/without_skill/timing.json +0 -5
  172. package/skills/tfx-consensus/SKILL.md +0 -56
  173. package/skills/tfx-consensus/skill.json +0 -8
  174. package/skills/tfx-debate/SKILL.md +0 -60
  175. package/skills/tfx-debate/skill.json +0 -14
  176. package/skills/tfx-fullcycle/SKILL.md +0 -47
  177. package/skills/tfx-fullcycle/skill.json +0 -13
  178. package/skills/tfx-multi/SKILL.md +0 -45
  179. package/skills/tfx-multi/references/agent-wrapper-rules.md +0 -94
  180. package/skills/tfx-multi/references/thorough-pipeline.md +0 -105
  181. package/skills/tfx-multi/skill.json +0 -10
  182. package/skills/tfx-panel/SKILL.md +0 -60
  183. package/skills/tfx-panel/skill.json +0 -14
  184. package/skills/tfx-persist/SKILL.md +0 -63
  185. package/skills/tfx-persist/skill.json +0 -14
  186. package/skills/tfx-psmux-rules/SKILL.md +0 -41
  187. package/skills/tfx-psmux-rules/skill.json +0 -10
  188. package/skills/tfx-remote-setup/SKILL.md +0 -42
  189. package/skills/tfx-remote-setup/skill.json +0 -10
  190. package/skills/tfx-remote-spawn/SKILL.md +0 -52
  191. package/skills/tfx-remote-spawn/skill.json +0 -10
  192. package/skills/tfx-swarm/SKILL.md +0 -49
  193. package/skills/tfx-swarm/skill.json +0 -13
package/README.md CHANGED
@@ -393,7 +393,7 @@ folders. Keep it synchronized when touching mirrored runtime files.
393
393
  | Linux | tmux | Supported. |
394
394
  | Windows | psmux + Windows Terminal | Supported through managed psmux/WT paths. PowerShell is the default psmux shell. |
395
395
 
396
- See `AGENTS.md` and `.claude/rules/tfx-psmux.md` for the stricter Windows/psmux
396
+ See `.claude/rules/tfx-psmux.md` for the stricter Windows/psmux
397
397
  rules used by agents and launch scripts.
398
398
 
399
399
  ---
@@ -7,11 +7,39 @@ description: >
7
7
 
8
8
  # tfx-harness — Codex adapter
9
9
 
10
- Read `.claude/rules/tfx-routing.md` D0–D11 before routing. This adapter only
11
- translates host syntax: use `$skill` for an available owner. Do not copy the
12
- routing tree, keyword rules, or an owner matrix here.
10
+ This skill is a routing adapter, not an execution engine. Read D0–D11 from the
11
+ canonical routing SSOT, classify the user intent against available host
12
+ capability evidence, and return one immediate owner. Do not copy the routing
13
+ tree, keyword rules, or owner matrix into this file.
13
14
 
14
- Return:
15
+ ## Locate the routing SSOT
16
+
17
+ This skill is installed globally but the SSOT belongs to the Triflux project.
18
+ Try these locations in order and return blocked only when all three fail:
19
+
20
+ 1. `$TFX_ROUTING_SSOT`, when set.
21
+ 2. `.claude/rules/tfx-routing.md` below the main Git worktree, derived from
22
+ the parent of `git rev-parse --git-common-dir`.
23
+ 3. Walk upward from the current working directory looking for
24
+ `.claude/rules/tfx-routing.md`.
25
+
26
+ Do not use `git rev-parse --show-toplevel` for step 2. In a linked worktree it
27
+ returns that worktree root, whose SSOT may be a stale branch snapshot.
28
+ `--git-common-dir` still points to the main repository's `.git` directory.
29
+
30
+ When blocked, include this one-line remedy:
31
+
32
+ `export TFX_ROUTING_SSOT=<triflux clone>/.claude/rules/tfx-routing.md`
33
+
34
+ Prefer `~/.zshenv` for this variable because hooks and headless workers may not
35
+ load interactive `~/.zshrc`. Do not create a global copy or symlink under
36
+ `~/.claude/rules/`; Claude auto-loads that directory into unrelated sessions.
37
+
38
+ ## Return contract
39
+
40
+ Translate only host syntax. Hook-injected routing context is authoritative for
41
+ the current turn. Resolve the SSOT owner against the current Codex Available
42
+ Skills inventory, preserving the exact `$skill` name when it exists.
15
43
 
16
44
  ```text
17
45
  [tfx-harness]
@@ -22,9 +50,17 @@ fallback_notice: <optional>
22
50
  status: recommendation-only | dispatching | blocked
23
51
  ```
24
52
 
25
- - Never choose more than one branch or immediate owner.
26
- - With unknown availability, do not infer a fallback. With measured
27
- unavailability, state `owner unavailable → tfx-X fallback` before fallback.
28
- - If the SSOT cannot be read, return `blocked: routing SSOT unavailable`.
53
+ - Return exactly one branch and one immediate owner.
54
+ - With unknown availability, do not infer a fallback.
55
+ - With measured unavailability, report
56
+ `owner unavailable → tfx-X fallback` before using the fallback.
57
+ - If the SSOT cannot be read, return
58
+ `blocked: routing SSOT unavailable` and the remedy above.
29
59
  - For a “which skill/path?” question, remain recommendation-only.
30
- - Do not select downstream implementation agents or models.
60
+ - When the user clearly requests execution, read the selected downstream
61
+ `SKILL.md`, invoke or follow that exact Codex `$skill`, and then relinquish
62
+ routing ownership. Do not keep solving the downstream task inside this
63
+ adapter once its owner is available.
64
+ - If the owner is unavailable, use only the fallback explicitly allowed by the
65
+ SSOT and label the measured unavailability before dispatch.
66
+ - Do not select downstream implementation agents, models, profiles, or effort.