@openrig/cli 0.6.8 → 0.6.9

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 (178) hide show
  1. package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +41 -2
  2. package/daemon/assets/plugins/openrig-core/skills/messaging-the-human/SKILL.md +12 -4
  3. package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +218 -7
  4. package/daemon/context-packs/help/manifest.yaml +1 -1
  5. package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
  6. package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +17 -7
  7. package/daemon/context-packs/reference/manifest.yaml +1 -1
  8. package/daemon/context-packs/reference/whats-new.md +69 -74
  9. package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
  10. package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
  11. package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
  12. package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
  13. package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
  14. package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
  15. package/daemon/context-packs/skills/core/cross-host-rig-commands/SKILL.md +1 -0
  16. package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
  17. package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
  18. package/daemon/context-packs/skills/core/messaging-the-human/SKILL.md +12 -4
  19. package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
  20. package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
  21. package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
  22. package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
  23. package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
  24. package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
  25. package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
  26. package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
  27. package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
  28. package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
  29. package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
  30. package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
  31. package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
  32. package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
  33. package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
  34. package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
  35. package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
  36. package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
  37. package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
  38. package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
  39. package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
  40. package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
  41. package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
  42. package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
  43. package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
  44. package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
  45. package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
  46. package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
  47. package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
  48. package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
  49. package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
  50. package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
  51. package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
  52. package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
  53. package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
  54. package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
  55. package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
  56. package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
  57. package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
  58. package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
  59. package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +218 -7
  60. package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
  61. package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
  62. package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
  63. package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
  64. package/daemon/context-packs/world-example/manifest.yaml +1 -1
  65. package/daemon/context-packs/world-public/manifest.yaml +1 -1
  66. package/daemon/dist/build-info.js +3 -3
  67. package/daemon/dist/db/all-migrations.d.ts.map +1 -1
  68. package/daemon/dist/db/all-migrations.js +2 -0
  69. package/daemon/dist/db/all-migrations.js.map +1 -1
  70. package/daemon/dist/db/migrations/098_queue_transitions_qitem_id_order.d.ts +3 -0
  71. package/daemon/dist/db/migrations/098_queue_transitions_qitem_id_order.d.ts.map +1 -0
  72. package/daemon/dist/db/migrations/098_queue_transitions_qitem_id_order.js +12 -0
  73. package/daemon/dist/db/migrations/098_queue_transitions_qitem_id_order.js.map +1 -0
  74. package/daemon/dist/domain/current-work.d.ts +74 -0
  75. package/daemon/dist/domain/current-work.d.ts.map +1 -1
  76. package/daemon/dist/domain/current-work.js +165 -0
  77. package/daemon/dist/domain/current-work.js.map +1 -1
  78. package/daemon/dist/domain/gateway/connections-projection.d.ts +2 -0
  79. package/daemon/dist/domain/gateway/connections-projection.d.ts.map +1 -1
  80. package/daemon/dist/domain/gateway/connections-projection.js +3 -1
  81. package/daemon/dist/domain/gateway/connections-projection.js.map +1 -1
  82. package/daemon/dist/domain/gateway/gateway-subsystem.d.ts +3 -1
  83. package/daemon/dist/domain/gateway/gateway-subsystem.d.ts.map +1 -1
  84. package/daemon/dist/domain/gateway/gateway-subsystem.js +3 -1
  85. package/daemon/dist/domain/gateway/gateway-subsystem.js.map +1 -1
  86. package/daemon/dist/domain/gateway/slack/queue-access.d.ts +3 -0
  87. package/daemon/dist/domain/gateway/slack/queue-access.d.ts.map +1 -1
  88. package/daemon/dist/domain/gateway/slack/queue-access.js +5 -1
  89. package/daemon/dist/domain/gateway/slack/queue-access.js.map +1 -1
  90. package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
  91. package/daemon/dist/domain/gateway/slack/slack-subsystem.js +74 -19
  92. package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
  93. package/daemon/dist/domain/gateway/slack/socket-inbound.d.ts +37 -0
  94. package/daemon/dist/domain/gateway/slack/socket-inbound.d.ts.map +1 -1
  95. package/daemon/dist/domain/gateway/slack/socket-inbound.js +281 -38
  96. package/daemon/dist/domain/gateway/slack/socket-inbound.js.map +1 -1
  97. package/daemon/dist/domain/gateway/slack/state-store.d.ts +14 -1
  98. package/daemon/dist/domain/gateway/slack/state-store.d.ts.map +1 -1
  99. package/daemon/dist/domain/gateway/slack/state-store.js +16 -0
  100. package/daemon/dist/domain/gateway/slack/state-store.js.map +1 -1
  101. package/daemon/dist/domain/human-questions.d.ts +12 -3
  102. package/daemon/dist/domain/human-questions.d.ts.map +1 -1
  103. package/daemon/dist/domain/human-questions.js +10 -5
  104. package/daemon/dist/domain/human-questions.js.map +1 -1
  105. package/daemon/dist/domain/kernel-boot-tracker.d.ts +20 -1
  106. package/daemon/dist/domain/kernel-boot-tracker.d.ts.map +1 -1
  107. package/daemon/dist/domain/kernel-boot-tracker.js +66 -14
  108. package/daemon/dist/domain/kernel-boot-tracker.js.map +1 -1
  109. package/daemon/dist/domain/kernel-boot.d.ts +4 -0
  110. package/daemon/dist/domain/kernel-boot.d.ts.map +1 -1
  111. package/daemon/dist/domain/kernel-boot.js +26 -1
  112. package/daemon/dist/domain/kernel-boot.js.map +1 -1
  113. package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
  114. package/daemon/dist/domain/native-process-lineage.js +30 -7
  115. package/daemon/dist/domain/native-process-lineage.js.map +1 -1
  116. package/daemon/dist/domain/queue-repository.d.ts +12 -0
  117. package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
  118. package/daemon/dist/domain/queue-repository.js +47 -1
  119. package/daemon/dist/domain/queue-repository.js.map +1 -1
  120. package/daemon/dist/domain/queue-transition-log.d.ts +12 -4
  121. package/daemon/dist/domain/queue-transition-log.d.ts.map +1 -1
  122. package/daemon/dist/domain/queue-transition-log.js +24 -0
  123. package/daemon/dist/domain/queue-transition-log.js.map +1 -1
  124. package/daemon/dist/domain/scope/scope-approve.d.ts +21 -0
  125. package/daemon/dist/domain/scope/scope-approve.d.ts.map +1 -1
  126. package/daemon/dist/domain/scope/scope-approve.js +48 -4
  127. package/daemon/dist/domain/scope/scope-approve.js.map +1 -1
  128. package/daemon/dist/routes/gateway.d.ts.map +1 -1
  129. package/daemon/dist/routes/gateway.js +2 -0
  130. package/daemon/dist/routes/gateway.js.map +1 -1
  131. package/daemon/dist/routes/kernel-status.js +3 -1
  132. package/daemon/dist/routes/kernel-status.js.map +1 -1
  133. package/daemon/dist/routes/queue.d.ts.map +1 -1
  134. package/daemon/dist/routes/queue.js +17 -2
  135. package/daemon/dist/routes/queue.js.map +1 -1
  136. package/daemon/dist/routes/scope-approve.d.ts.map +1 -1
  137. package/daemon/dist/routes/scope-approve.js +3 -0
  138. package/daemon/dist/routes/scope-approve.js.map +1 -1
  139. package/daemon/docs/reference/refocus-channel.md +33 -0
  140. package/daemon/docs/reference/slack-app-setup.md +13 -0
  141. package/daemon/docs/reference/whats-new.md +69 -74
  142. package/daemon/specs/agents/shared/skills/core/cross-host-rig-commands/SKILL.md +1 -0
  143. package/daemon/specs/agents/shared/skills/core/messaging-the-human/SKILL.md +12 -4
  144. package/dist/build-info.js +3 -3
  145. package/dist/commands/chatroom.d.ts.map +1 -1
  146. package/dist/commands/chatroom.js +25 -5
  147. package/dist/commands/chatroom.js.map +1 -1
  148. package/dist/commands/queue.d.ts.map +1 -1
  149. package/dist/commands/queue.js +3 -0
  150. package/dist/commands/queue.js.map +1 -1
  151. package/dist/commands/scope.d.ts.map +1 -1
  152. package/dist/commands/scope.js +10 -1
  153. package/dist/commands/scope.js.map +1 -1
  154. package/dist/commands/send.d.ts.map +1 -1
  155. package/dist/commands/send.js +23 -5
  156. package/dist/commands/send.js.map +1 -1
  157. package/dist/commands/slack.d.ts +17 -0
  158. package/dist/commands/slack.d.ts.map +1 -1
  159. package/dist/commands/slack.js +41 -0
  160. package/dist/commands/slack.js.map +1 -1
  161. package/dist/commands/status.d.ts.map +1 -1
  162. package/dist/commands/status.js +5 -0
  163. package/dist/commands/status.js.map +1 -1
  164. package/dist/cross-host-types.d.ts +1 -1
  165. package/dist/cross-host-types.d.ts.map +1 -1
  166. package/dist/lib/scope/scope-fs.d.ts +13 -0
  167. package/dist/lib/scope/scope-fs.d.ts.map +1 -1
  168. package/dist/lib/scope/scope-fs.js +28 -4
  169. package/dist/lib/scope/scope-fs.js.map +1 -1
  170. package/dist/remote-host-ops.d.ts +4 -0
  171. package/dist/remote-host-ops.d.ts.map +1 -1
  172. package/dist/remote-host-ops.js +20 -2
  173. package/dist/remote-host-ops.js.map +1 -1
  174. package/package.json +1 -1
  175. package/tui/dist/connections/connections-model.d.ts +5 -0
  176. package/tui/dist/connections/connections-model.d.ts.map +1 -1
  177. package/tui/dist/connections/connections-model.js +16 -1
  178. package/tui/dist/connections/connections-model.js.map +1 -1
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "review-team"
4
- version: "0.6.8"
4
+ version: "0.6.9"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when assigned a review or when an authored review boundary is reached."
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "agent-browser"
4
- version: "0.6.8"
4
+ version: "0.6.9"
5
5
  taxonomy: "skills"
6
6
  purpose: "Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to \"open a website\", \"fill out a form\", \"click a button\", \"take a screenshot\", \"scrape data from a page\", \"test this web app\", \"login to a site\", \"automate browser actions\", or any task requiring programmatic web interaction."
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "context-engineering"
4
- version: "0.6.8"
4
+ version: "0.6.9"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when designing, reviewing, or debugging how an agent's context window gets filled, pruned, or shared — choosing what loads at boot versus on demand, sizing an install or an always-loaded file, fixing an agent that drifts, repeats itself, or forgets constraints mid-task, planning compaction or summarization, deciding single-agent versus subagents, engineering handoffs between agents, or picking a tool loadout. NOT for rewording a prompt's tone, choosing which model to pin, or debugging busine"
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "dogfood"
4
- version: "0.6.8"
4
+ version: "0.6.9"
5
5
  taxonomy: "skills"
6
6
  purpose: "Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to \"dogfood\", \"QA\", \"exploratory test\", \"find issues\", \"bug hunt\", \"test this app/site/platform\", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams."
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "frontend-design"
4
- version: "0.6.8"
4
+ version: "0.6.9"
5
5
  taxonomy: "skills"
6
6
  purpose: "Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics."
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "systematic-debugging"
4
- version: "0.6.8"
4
+ version: "0.6.9"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes"
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "test-driven-development"
4
- version: "0.6.8"
4
+ version: "0.6.9"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when implementing any feature or bugfix, before writing implementation code"
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "verification-before-completion"
4
- version: "0.6.8"
4
+ version: "0.6.9"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always"
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "queue-handoff"
4
- version: "0.6.8"
4
+ version: "0.6.9"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when ending a turn, finishing a slice, blocked on another agent's work, or escalating to a human — durable work handoff via queue items so the system keeps moving across compactions, missed messages, and interruptions. Covers the hot-potato terminal-turn-rule (active work ends by passing the ball, not by going idle), default-nudge semantics, and when `--no-nudge` is appropriate for intentional cold park or human gate."
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "refocusing"
4
- version: "0.6.8"
4
+ version: "0.6.9"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when a long-running agent may have lost the product outcome, when context was compacted, when work has crossed a major boundary, or when a fresh path-based trace is needed before the next consequential action. Not for fresh-session orientation, waking an idle seat, or checkpoints."
7
7
  files:
@@ -2,10 +2,12 @@
2
2
  """Render topology and work context by ascending directory paths only."""
3
3
 
4
4
  import argparse
5
+ import datetime
5
6
  import json
6
7
  import os
7
8
  import re
8
9
  import subprocess
10
+ import sys
9
11
  from pathlib import Path
10
12
 
11
13
  SHELVES = {"rigs", "pods", "seats", "missions", "slices"}
@@ -148,7 +150,82 @@ def light_learned(text):
148
150
  return body[:boundary if boundary > 0 else 800].rstrip() + "\n[… use --depth full for the rest]"
149
151
 
150
152
 
151
- def render_topology(start, root, depth, failures):
153
+ # OPR.0.7.0.12 — the refocus packet (--packet). Duties and notes are carried as text by
154
+ # conventional section, with an honest "not found" and a bounded excerpt otherwise; nobody is
155
+ # asked to add headings. Old files are named with their measured age as a cue, not a verdict.
156
+ DUTY_HEADINGS = ("my job here", "standing duties")
157
+ NOTES_STATE_HEADINGS = ("current state",)
158
+ HEADING = re.compile(r"^(#{1,6})\s+(.*?)\s*#*\s*$")
159
+ DEFAULT_NOTES_MAX_AGE_DAYS = 14
160
+
161
+
162
+ def heading_sections(text, wanted):
163
+ """[(title, body)] for each Markdown heading whose title starts with a wanted phrase."""
164
+ lines = re.sub(r"^---\s*\n.*?\n---\s*\n", "", text or "", count=1, flags=re.S).splitlines()
165
+ found = []
166
+ for index, line in enumerate(lines):
167
+ match = HEADING.match(line)
168
+ if not match or not match.group(2).strip().lower().startswith(wanted):
169
+ continue
170
+ level = len(match.group(1))
171
+ body = []
172
+ for later in lines[index + 1:]:
173
+ heading = HEADING.match(later)
174
+ if heading and len(heading.group(1)) <= level:
175
+ break
176
+ body.append(later)
177
+ found.append((match.group(2).strip(), "\n".join(body).strip()))
178
+ return found
179
+
180
+
181
+ def by_section(text, wanted, path):
182
+ found = heading_sections(text, wanted)
183
+ shown = "\n\n".join(f"{title}\n{body}" if body else title for title, body in found)
184
+ missing = [phrase for phrase in wanted if not any(title.lower().startswith(phrase) for title, _ in found)]
185
+ if not missing:
186
+ return shown
187
+ if not found:
188
+ names = " or ".join(f'"{phrase.upper()}"' for phrase in wanted)
189
+ return f"SECTION NOT FOUND — no {names} heading in {path}; bounded excerpt follows\n{light_learned(text)}"
190
+ # Some sections matched: name each one that did not, with the same bounded excerpt, so text
191
+ # kept under another heading is not silently dropped.
192
+ names = ", ".join(f'"{phrase.upper()}"' for phrase in missing)
193
+ return f"{shown}\n\nSECTION NOT FOUND — no {names} heading in {path}; bounded excerpt follows\n{light_learned(text)}"
194
+
195
+
196
+ def notes_max_age_days():
197
+ try:
198
+ value = float(os.environ.get("OPENRIG_REFOCUS_NOTES_MAX_AGE_DAYS", DEFAULT_NOTES_MAX_AGE_DAYS))
199
+ except ValueError:
200
+ return DEFAULT_NOTES_MAX_AGE_DAYS
201
+ return value if value > 0 else DEFAULT_NOTES_MAX_AGE_DAYS
202
+
203
+
204
+ def age_cue(path, text):
205
+ """An OLD NOTES line when the file is past the threshold, measured from `updated:` or mtime."""
206
+ threshold = notes_max_age_days()
207
+ updated, source = None, "mtime"
208
+ match = re.match(r"^---\s*\n(.*?)\n---", text or "", re.S)
209
+ if match:
210
+ found = re.search(r"^updated:\s*[\"']?(\d{4}-\d{2}-\d{2})", match.group(1), re.M)
211
+ if found:
212
+ try:
213
+ updated = datetime.datetime.strptime(found.group(1), "%Y-%m-%d").replace(tzinfo=datetime.timezone.utc)
214
+ source = "updated"
215
+ except ValueError:
216
+ updated = None
217
+ if updated is None:
218
+ try:
219
+ updated = datetime.datetime.fromtimestamp(path.stat().st_mtime, datetime.timezone.utc)
220
+ except OSError:
221
+ return None
222
+ age = (datetime.datetime.now(datetime.timezone.utc) - updated).total_seconds() / 86400
223
+ if age <= threshold:
224
+ return None
225
+ return f"OLD NOTES — {path}, {age:.0f} days old, source {source}, threshold {threshold:g} days"
226
+
227
+
228
+ def render_topology(start, root, depth, failures, packet=False):
152
229
  output = ["## TOPOLOGY TRACE", f"root: {root}", f"start: {start}"]
153
230
  nodes, error = ascent(start, root)
154
231
  if error:
@@ -161,12 +238,21 @@ def render_topology(start, root, depth, failures):
161
238
  if text is None:
162
239
  output.append(f"\n### {label}\nMISSING LINK — {chain_file}")
163
240
  continue
164
- body = text.strip() if depth == "full" else light_learned(text)
241
+ if depth == "full":
242
+ body = text.strip()
243
+ elif packet and node == nodes[-1]:
244
+ # The seat's own file: its job and standing duties as text.
245
+ body = by_section(text, DUTY_HEADINGS, chain_file)
246
+ else:
247
+ body = light_learned(text)
165
248
  output.append(f"\n### {label} · LEARNED.md\n{body}")
249
+ cue = age_cue(chain_file, text) if packet else None
250
+ if cue:
251
+ output.append(cue)
166
252
  return "\n".join(output)
167
253
 
168
254
 
169
- def render_work(start, root, depth, failures, fallback=None):
255
+ def render_work(start, root, depth, failures, fallback=None, packet=False):
170
256
  output = ["## WORK TRACE", f"root: {root}", f"start: {start}"]
171
257
  if fallback:
172
258
  output.append(f"FALLBACK — {fallback}")
@@ -201,6 +287,19 @@ def render_work(start, root, depth, failures, fallback=None):
201
287
  output.append(f"NOTES RESOLUTION GAP — resolved {notes_name} became unreadable at {notes_path}")
202
288
  else:
203
289
  output.append(f"\nNOTES · {notes_name}\n{notes_text.strip()}")
290
+ cue = age_cue(notes_path, notes_text) if packet else None
291
+ if cue:
292
+ output.append(cue)
293
+ elif packet:
294
+ notes_text = read(notes_path)
295
+ if notes_text is None:
296
+ failures.append(f"unreadable notes: {notes_path}")
297
+ output.append(f"NOTES RESOLUTION GAP — resolved {notes_name} became unreadable at {notes_path}")
298
+ else:
299
+ output.append(f"\nNOTES · {notes_name}\n{by_section(notes_text, NOTES_STATE_HEADINGS, notes_path)}")
300
+ cue = age_cue(notes_path, notes_text)
301
+ if cue:
302
+ output.append(cue)
204
303
  else:
205
304
  try:
206
305
  size = notes_path.stat().st_size
@@ -211,9 +310,107 @@ def render_work(start, root, depth, failures, fallback=None):
211
310
  output.append(f"NOTES · {notes_name} · {size} bytes · {notes_path}")
212
311
  else:
213
312
  output.append(f"NOTES GAP — no readable mission notes at {node}")
313
+
314
+ # The SDLC convention keeps a node's current delivery state in PROGRESS.md; carry it
315
+ # as text when present. Its absence is not a gap: many nodes have no PROGRESS.md.
316
+ progress_path = node / "PROGRESS.md"
317
+ progress_text = read(progress_path) if packet else None
318
+ if progress_text is not None:
319
+ progress_body = progress_text.strip() if depth == "full" else by_section(progress_text, NOTES_STATE_HEADINGS, progress_path)
320
+ output.append(f"\nPROGRESS · PROGRESS.md\n{progress_body}")
321
+ cue = age_cue(progress_path, progress_text)
322
+ if cue:
323
+ output.append(cue)
324
+ return "\n".join(output)
325
+
326
+
327
+ def candidate_line(candidate):
328
+ name = candidate.get("mission") or "?"
329
+ if candidate.get("slice"):
330
+ name += f" / {candidate['slice']}"
331
+ intent_text = candidate.get("intent") or "no readable intent"
332
+ line = f"- {name} — {intent_text} — source: {candidate.get('source') or 'unknown'}"
333
+ if candidate.get("unresolved"):
334
+ line += f" — UNRESOLVED ON THIS HOST: {candidate['unresolved']}"
335
+ return line
336
+
337
+
338
+ def render_held_and_next(evidence):
339
+ output = []
340
+ held = evidence.get("held") or []
341
+ if held:
342
+ output.append("HELD WORK (blocked; this is not next):")
343
+ for row in held:
344
+ output.append(f"- {row.get('qitemId') or 'a row'} — {row.get('summary') or 'no summary'} — "
345
+ f"blocked on {row.get('blockedOn') or 'unknown'} — "
346
+ f"continuation: {row.get('continuation') or 'none recorded'}")
347
+ following = evidence.get("next") or []
348
+ if following:
349
+ output.append("POSSIBLE NEXT WORK (pending; no order implied):")
350
+ for row in following:
351
+ missions = ", ".join(row.get("missions") or [])
352
+ output.append(f"- {row.get('qitemId') or 'a row'} — {row.get('summary') or 'no summary'}"
353
+ + (f" [mission: {missions}]" if missions else ""))
354
+ if evidence.get("heldAndNextTruncated"):
355
+ output.append("(held and next lists were cut; `rig queue list` has the rest)")
214
356
  return "\n".join(output)
215
357
 
216
358
 
359
+ def render_candidates(evidence, root, depth, failures):
360
+ """The work section from labelled queue evidence. One direct, resolved tag is shown as the
361
+ work with its source; anything less certain lists every candidate and asks the agent."""
362
+ candidates = evidence.get("candidates") or []
363
+ unknown = evidence.get("unknown") or []
364
+ if (len(candidates) == 1 and not unknown and candidates[0].get("kind") == "tag"
365
+ and candidates[0].get("workNodePath") and not candidates[0].get("unresolved")):
366
+ only = candidates[0]
367
+ notes = [f"WORK FROM QUEUE EVIDENCE — {only.get('source')}. If this is stale, say what you are actually doing."]
368
+ if not only.get("slice"):
369
+ notes.append("no slice named")
370
+ traced = render_work(Path(only["workNodePath"]), root, depth, failures, packet=True)
371
+ head, _, rest = traced.partition("\n")
372
+ return "\n".join([head, *notes, rest])
373
+
374
+ missions_root = evidence.get("missionsRoot") or str(root / "missions")
375
+ output = ["## WORK — name it"]
376
+ if not candidates and not unknown:
377
+ output.append("No in-progress queue row names your work. If you are working from messages, "
378
+ "name the mission they belong to; if you have no current work, say so.")
379
+ elif len(candidates) > 1:
380
+ output.append(f"{len(candidates)} candidates are in flight. Say which mission you are actually working on.")
381
+ else:
382
+ output.append("The queue evidence does not settle your work. Confirm a candidate or name your mission.")
383
+ if candidates:
384
+ output.append("Candidates (evidence, not a verdict; none is adopted for you):")
385
+ output.extend(candidate_line(candidate) for candidate in candidates)
386
+ if unknown:
387
+ output.append("In-progress rows the queue cannot place:")
388
+ output.extend(f"- {row.get('qitemId') or 'a row'} — {row.get('summary') or 'no summary'}: {row.get('reason')}"
389
+ for row in unknown)
390
+ if not candidates:
391
+ names = evidence.get("missionsOnHost") or []
392
+ if names:
393
+ listing = ", ".join(names) + (", …" if evidence.get("missionsOnHostTruncated") else "")
394
+ output.append(f"Missions on this host: {listing}")
395
+ output.append("Then read that mission's current intent as text:")
396
+ output.append(f" python3 {Path(__file__).resolve()} --trees work --packet --work-start {missions_root}/<mission>")
397
+ orientation = render_work(root, root, "light", failures, packet=True)
398
+ _, _, rest = orientation.partition("\n")
399
+ output.append("\n## ORIENTATION — the project-level chain, not your work\n" + rest.lstrip("\n"))
400
+ return "\n".join(output)
401
+
402
+
403
+ def read_candidates(source):
404
+ try:
405
+ raw = sys.stdin.read() if source == "-" else Path(source).read_text(encoding="utf8")
406
+ evidence = json.loads(raw)
407
+ except (OSError, json.JSONDecodeError) as error:
408
+ return None, f"work candidates unreadable: {error}"
409
+ if not isinstance(evidence, dict) or not isinstance(evidence.get("candidates", []), list):
410
+ return None, "work candidates have an invalid shape"
411
+ return evidence, None
412
+
413
+
217
414
  def canonical_seat(session):
218
415
  """(member, rig) for a canonical session name, else None so the caller asks `rig whoami`.
219
416
 
@@ -279,6 +476,8 @@ def main():
279
476
  parser.add_argument("--work-basis", help="the daemon's reason no current work node was named")
280
477
  parser.add_argument("--work-unknown", help="why the current work node could not be read")
281
478
  parser.add_argument("--check", action="store_true", help="exit nonzero on trace or notes resolution failure; rendered text is unchanged")
479
+ parser.add_argument("--packet", action="store_true", help="carry duties and notes as text by section, with old-notes cues")
480
+ parser.add_argument("--work-candidates", help="labelled work evidence as JSON (a path, or - for stdin), from `rig queue whoami --work-candidates`")
282
481
  args = parser.parse_args()
283
482
 
284
483
  sections = []
@@ -293,7 +492,7 @@ def main():
293
492
  sections.append(gap("## TOPOLOGY TRACE\nTRACE GAP — topology.root is unresolved"))
294
493
  else:
295
494
  start = Path(args.topology_start) if args.topology_start else derive_topology_start(root)
296
- sections.append(render_topology(start, root, args.depth, failures) if start else
495
+ sections.append(render_topology(start, root, args.depth, failures, packet=args.packet) if start else
297
496
  gap("## TOPOLOGY TRACE\nTRACE GAP — current topology node is unresolved; pass --topology-start with a literal absolute path (or configure OPENRIG_REFOCUS_TOPOLOGY_NODE separately)"))
298
497
 
299
498
  if args.trees in {"work", "both"}:
@@ -304,10 +503,19 @@ def main():
304
503
  # Precedence: an explicit start wins; then the hook's daemon answer (basis or unknown);
305
504
  # only a standalone run with neither falls back to inferring from the working directory.
306
505
  explicit = args.work_start or os.environ.get("OPENRIG_REFOCUS_WORK_NODE")
506
+ evidence = None
507
+ if args.work_candidates:
508
+ evidence, error = read_candidates(args.work_candidates)
509
+ if error:
510
+ sections.append(gap(f"## WORK TRACE\nTRACE GAP — {error}"))
307
511
  if explicit:
308
- sections.append(render_work(Path(explicit), root, args.depth, failures))
512
+ sections.append(render_work(Path(explicit), root, args.depth, failures, packet=args.packet))
513
+ elif evidence is not None:
514
+ sections.append(render_candidates(evidence, root, args.depth, failures))
515
+ elif args.work_candidates:
516
+ pass # the unreadable-evidence gap above is the answer; never fall back to the root
309
517
  elif args.work_basis == NO_CURRENT_BATON_BASIS:
310
- sections.append(render_work(root, root, args.depth, failures, fallback=(
518
+ sections.append(render_work(root, root, args.depth, failures, packet=args.packet, fallback=(
311
519
  f"no current typed baton ({args.work_basis}). Showing the project-level chain from the work root: "
312
520
  "a broad orientation, not evidence of a current mission")))
313
521
  elif args.work_basis:
@@ -316,8 +524,11 @@ def main():
316
524
  sections.append(gap(f"## WORK TRACE\nTRACE GAP — current work node UNKNOWN: {args.work_unknown}"))
317
525
  else:
318
526
  start = derive_work_start(root)
319
- sections.append(render_work(start, root, args.depth, failures) if start else
527
+ sections.append(render_work(start, root, args.depth, failures, packet=args.packet) if start else
320
528
  gap("## WORK TRACE\nTRACE GAP — current work node is unresolved; pass --work-start with a literal absolute path (or configure OPENRIG_REFOCUS_WORK_NODE separately)"))
529
+ held_and_next = render_held_and_next(evidence) if evidence else ""
530
+ if held_and_next:
531
+ sections.append(held_and_next)
321
532
 
322
533
  print("\n\n".join(sections))
323
534
  return 1 if args.check and failures else 0
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "retiring-and-inheriting-a-seat"
4
- version: "0.6.8"
4
+ version: "0.6.9"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when you are a sitting agent near your context threshold (~85%) and a PLANNED seat transition is due — retire deliberately and hand your seat to a fresh successor primed from a packet, rather than let compaction degrade you. Covers the handover packet, the append-only lineage ledger (one row per tenure), physical-seat continuity, the do-not-over-inherit framing, the optional warm-handoff window, and wake-v0 (consulting a retired predecessor). NOT for unplanned compaction/crash recovery (sess"
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "seat-continuity-and-handover"
4
- version: "0.6.8"
4
+ version: "0.6.9"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when replacing a seat's occupant (rebuild/handover/swap), reasoning about stable-seat-identity vs fluid-occupant-identity, choosing an old-occupant disposition (retire/advise/shadow), or recording provenance for an occupant change. Two independent outcomes (continuityOutcome + seatBindingOutcome) and the 5 failure modes that prevent silent dishonesty."
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "session-compaction-and-restore"
4
- version: "0.6.8"
4
+ version: "0.6.9"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when reasoning about what survives compaction/context-loss/restart/seat-refresh, designing a high-fidelity restore packet, or distinguishing native runtime resume vs fork vs artifact-backed mental-model rebuild. Covers the 4 failure modes that prevent honest restore (compacted seat drops hot potato; restore packet preserves details but loses product intent; runtime resume mistaken for handover or fork; rebuilt seat starts with stale instructions)."
7
7
  files:
@@ -1,7 +1,7 @@
1
1
  # GENERATED by scripts/generate-context-packs.mjs — DO NOT EDIT.
2
2
  # Package-time projection of a canonical skill; regenerated every build.
3
3
  name: "software-for-agents"
4
- version: "0.6.8"
4
+ version: "0.6.9"
5
5
  taxonomy: "skills"
6
6
  purpose: "Use when older OpenRig instructions name software-for-agents or describe agent-in-the-middle or studio software under the former skill name."
7
7
  files:
@@ -1,5 +1,5 @@
1
1
  name: world-example
2
- version: "0.6.8"
2
+ version: "0.6.9"
3
3
  taxonomy: world
4
4
  purpose: "A fill-in template showing the anatomy of an OpenRig world pack."
5
5
  files:
@@ -1,5 +1,5 @@
1
1
  name: world-public
2
- version: "0.6.8"
2
+ version: "0.6.9"
3
3
  taxonomy: world
4
4
  purpose: "A portable operating-world primer that derives volatile facts and teaches agents to author their own world."
5
5
  files:
@@ -1,9 +1,9 @@
1
1
  // GENERATED by scripts/build-package.sh — the packaged build-identity stamp.
2
2
  export const BUILD_INFO = {
3
- semver: "0.6.8",
4
- commit: "aa126c74d5d1568a6091c037450720c552e50e49",
3
+ semver: "0.6.9",
4
+ commit: "4b48ca21a9bd072aa05a08b3da6d9c0708e093c5",
5
5
  dirty: false,
6
- builtAt: "2026-10-08T22:15:13Z",
6
+ builtAt: "2026-10-09T08:59:39Z",
7
7
  };
8
8
  export function stampFields(info = BUILD_INFO) {
9
9
  if (!info.commit) return {};
@@ -1 +1 @@
1
- {"version":3,"file":"all-migrations.d.ts","sourceRoot":"","sources":["../../src/db/all-migrations.ts"],"names":[],"mappings":"AAkGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAM9C,0EAA0E;AAE1E,eAAO,MAAM,cAAc,EAAE,SAAS,EAiGrC,CAAC"}
1
+ {"version":3,"file":"all-migrations.d.ts","sourceRoot":"","sources":["../../src/db/all-migrations.ts"],"names":[],"mappings":"AAkGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAO9C,0EAA0E;AAE1E,eAAO,MAAM,cAAc,EAAE,SAAS,EAkGrC,CAAC"}
@@ -98,6 +98,7 @@ import { usageSamplesLatestIndexesSchema } from "./migrations/094_usage_samples_
98
98
  import { rigNonInterruptiveSchema } from "./migrations/095_rig_non_interruptive.js";
99
99
  import { rigInstallRootSchema } from "./migrations/096_rig_install_root.js";
100
100
  import { threadPartMapSchema } from "./migrations/097_thread_part_map.js";
101
+ import { queueTransitionsQitemIdOrderSchema } from "./migrations/098_queue_transitions_qitem_id_order.js";
101
102
  /** Ordered migrations; numbers may be reserved by independent changes. */
102
103
  export const ALL_MIGRATIONS = [
103
104
  coreSchema,
@@ -196,5 +197,6 @@ export const ALL_MIGRATIONS = [
196
197
  rigNonInterruptiveSchema,
197
198
  rigInstallRootSchema,
198
199
  threadPartMapSchema,
200
+ queueTransitionsQitemIdOrderSchema,
199
201
  ];
200
202
  //# sourceMappingURL=all-migrations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"all-migrations.js","sourceRoot":"","sources":["../../src/db/all-migrations.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,+FAA+F;AAC/F,oGAAoG;AACpG,qDAAqD;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5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0BAA0B;IAC1B,yBAAyB;IACzB,0BAA0B;IAC1B,yBAAyB;IACzB,sBAAsB;IACtB,qBAAqB;IACrB,qBAAqB;IACrB,kBAAkB;IAClB,8BAA8B;IAC9B,wBAAwB;IACxB,wBAAwB;IACxB,8BAA8B;IAC9B,0BAA0B;IAC1B,uBAAuB;IACvB,+BAA+B;IAC/B,2CAA2C;IAC3C,2BAA2B;IAC3B,mBAAmB;IACnB,0BAA0B;IAC1B,0BAA0B;IAC1B,oCAAoC;IACpC,6BAA6B;IAC7B,uBAAuB;IACvB,4BAA4B;IAC5B,+BAA+B;IAC/B,4BAA4B;IAC5B,6BAA6B;IAC7B,+BAA+B;IAC/B,uBAAuB;IACvB,2BAA2B;IAC3B,+BAA+B;IAC/B,qCAAqC;IACrC,uBAAuB;IACvB,8BAA8B;IAC9B,sCAAsC;IACtC,kBAAkB;IAClB,oBAAoB;IACpB,gBAAgB;IAChB,+BAA+B;IAC/B,wBAAwB;IACxB,oBAAoB;IACpB,mBAAmB;IACnB,kCAAkC;CACnC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Migration } from "../migrate.js";
2
+ export declare const queueTransitionsQitemIdOrderSchema: Migration;
3
+ //# sourceMappingURL=098_queue_transitions_qitem_id_order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"098_queue_transitions_qitem_id_order.d.ts","sourceRoot":"","sources":["../../../src/db/migrations/098_queue_transitions_qitem_id_order.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAM/C,eAAO,MAAM,kCAAkC,EAAE,SAMhD,CAAC"}
@@ -0,0 +1,12 @@
1
+ // A row's latest transitions are read in insertion (transition_id) order, which the wall-clock
2
+ // ts cannot stand in for when the clock moves backwards. idx_queue_transitions_qitem
3
+ // (qitem_id, ts) orders by ts, so a newest-first read by transition_id sorted the row's whole
4
+ // history. This index makes it a bounded reverse seek (OPR.0.7.0.12, the held row's park).
5
+ export const queueTransitionsQitemIdOrderSchema = {
6
+ name: "098_queue_transitions_qitem_id_order.sql",
7
+ sql: `
8
+ CREATE INDEX IF NOT EXISTS idx_queue_transitions_qitem_id_order
9
+ ON queue_transitions(qitem_id, transition_id);
10
+ `,
11
+ };
12
+ //# sourceMappingURL=098_queue_transitions_qitem_id_order.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"098_queue_transitions_qitem_id_order.js","sourceRoot":"","sources":["../../../src/db/migrations/098_queue_transitions_qitem_id_order.ts"],"names":[],"mappings":"AAEA,+FAA+F;AAC/F,qFAAqF;AACrF,8FAA8F;AAC9F,2FAA2F;AAC3F,MAAM,CAAC,MAAM,kCAAkC,GAAc;IAC3D,IAAI,EAAE,0CAA0C;IAChD,GAAG,EAAE;;;GAGJ;CACF,CAAC"}
@@ -86,5 +86,79 @@ interface Match {
86
86
  */
87
87
  export declare function resolveWorkNodeDirs(root: string, wanted: string): Match[];
88
88
  export declare function deriveCurrentWork(rows: TaggedRow[], missionsRoot: string | null): CurrentWorkDerivation;
89
+ /**
90
+ * OPR.0.7.0.12 — labelled work candidates, BESIDE the strict derivation above, never
91
+ * loosening it. deriveCurrentWork answers "which one node is this seat's work" and refuses
92
+ * anything short of certainty; this answers "what evidence does the queue hold", so the
93
+ * refocus packet can show it and let the AGENT decide. Nothing here picks a winner:
94
+ * candidates are evidence the agent may correct, and the absence of evidence is reported as
95
+ * such rather than filled with the project root.
96
+ *
97
+ * - An in-progress row's own `mission:` tag (with or without `slice:`) is a direct candidate,
98
+ * labelled with that tag as its source. A tag that does not resolve on this host is named,
99
+ * never swapped for a same-named directory found some other way.
100
+ * - An in-progress row with no mission tag offers its handoff ancestry: the nearest local
101
+ * ancestor's mission tag, as a labelled candidate. A retargeted handoff (new body, no tags)
102
+ * or an ancestor that is not on this host gives no assumed mission.
103
+ * - Pending rows are possible next work; blocked rows are held work with their blocker and
104
+ * continuation. No order is implied between them.
105
+ * - A mission named only in body text is never evidence.
106
+ */
107
+ export interface WorkCandidate {
108
+ kind: "tag" | "ancestry";
109
+ qitemId: string | null;
110
+ mission: string;
111
+ slice: string | null;
112
+ /** The slice node when the slice resolves, else the mission node; null when the mission does not. */
113
+ workNodePath: string | null;
114
+ intent: string | null;
115
+ source: string;
116
+ /** Why the tag did not fully resolve on this host, when it did not. */
117
+ unresolved: string | null;
118
+ }
119
+ export interface WorkCandidates {
120
+ missionsRoot: string | null;
121
+ candidates: WorkCandidate[];
122
+ /** In-progress rows whose work the queue cannot name. */
123
+ unknown: Array<{
124
+ qitemId: string | null;
125
+ summary: string | null;
126
+ reason: string;
127
+ }>;
128
+ next: Array<{
129
+ qitemId: string | null;
130
+ summary: string | null;
131
+ missions: string[];
132
+ }>;
133
+ held: Array<{
134
+ qitemId: string | null;
135
+ summary: string | null;
136
+ blockedOn: string | null;
137
+ continuation: string | null;
138
+ }>;
139
+ /** Mission directories on this host, bounded, so an agent can name one without guessing. */
140
+ missionsOnHost: string[];
141
+ missionsOnHostTruncated: boolean;
142
+ }
143
+ interface CandidateRow extends TaggedRow {
144
+ summary?: string | null;
145
+ body?: string | null;
146
+ blockedOn?: string | null;
147
+ handedOffFrom?: string | null;
148
+ chainOfRecord?: string[] | null;
149
+ }
150
+ export interface WorkCandidateLookups {
151
+ /** A row by id on this host, or null when it is not here (remote or removed). */
152
+ getRow: (qitemId: string) => CandidateRow | null;
153
+ /** The recorded park continuation of a blocked row, or null. */
154
+ continuationOf: (qitemId: string) => string | null;
155
+ }
156
+ /**
157
+ * The one-line `intent:` from SPEC.md frontmatter, read the way trace-to-root.py's `intent()`
158
+ * reads it: a block scalar (`>-`, `|`, …) joins its indented lines with spaces, and wrapping
159
+ * quotes are removed. parseFrontmatter is line-by-line and would return the indicator itself.
160
+ */
161
+ export declare function frontmatterIntent(raw: string): string | null;
162
+ export declare function deriveWorkCandidates(rows: CandidateRow[], missionsRoot: string | null, lookups: WorkCandidateLookups): WorkCandidates;
89
163
  export {};
90
164
  //# sourceMappingURL=current-work.d.ts.map