@azure-id/orc 2.0.2 → 2.1.1

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 (129) hide show
  1. package/CHANGELOG.md +455 -0
  2. package/README-id.md +52 -23
  3. package/README.md +36 -20
  4. package/bin/build-agents.js +205 -206
  5. package/bin/clear-logs.js +620 -0
  6. package/bin/cli.js +47417 -46420
  7. package/bin/fix.js +459 -0
  8. package/bin/gotcha.js +288 -8
  9. package/bin/habit.js +1538 -1453
  10. package/bin/mockrun-catalog.js +3 -0
  11. package/bin/onboarding-content.js +2 -1
  12. package/bin/pricing.json +28 -21
  13. package/bin/trace-write.js +869 -657
  14. package/bin/verify-contracts.js +5552 -5471
  15. package/bin/verify-package.js +716 -705
  16. package/bin/webui/api.js +125 -6
  17. package/bin/webui/css/panels/hookui.css +79 -0
  18. package/bin/webui/fixtures/behaviour.js +30 -0
  19. package/bin/webui/fixtures/extra.js +2036 -2036
  20. package/bin/webui/fixtures/flow.js +81 -81
  21. package/bin/webui/fixtures/hookui.js +506 -431
  22. package/bin/webui/fixtures/index.js +32 -3
  23. package/bin/webui/fixtures/knowledge.js +2 -2
  24. package/bin/webui/fixtures/maintenance.js +123 -42
  25. package/bin/webui/fixtures/rules.js +1007 -1002
  26. package/bin/webui/fixtures/settings.js +6 -7
  27. package/bin/webui/fixtures/stats.js +9 -6
  28. package/bin/webui/fixtures/wait.js +98 -97
  29. package/bin/webui/i18n/en/behaviour.json +13 -0
  30. package/bin/webui/i18n/en/hookui.json +290 -194
  31. package/bin/webui/i18n/en/maintenance.json +71 -52
  32. package/bin/webui/i18n/en/settings.json +60 -60
  33. package/bin/webui/i18n/id/behaviour.json +13 -0
  34. package/bin/webui/i18n/id/hookui.json +290 -194
  35. package/bin/webui/i18n/id/maintenance.json +71 -52
  36. package/bin/webui/i18n/id/settings.json +60 -60
  37. package/bin/webui/js/05-banners.js +181 -172
  38. package/bin/webui/js/06-edit.js +193 -183
  39. package/bin/webui/js/panels/behaviour.js +77 -12
  40. package/bin/webui/js/panels/hookui.js +2196 -1691
  41. package/bin/webui/js/panels/maintenance.js +336 -235
  42. package/bin/webui/js/panels/settings.js +726 -719
  43. package/mock-run/INDEX.md +1 -0
  44. package/mock-run/a-normal-day.md +2 -2
  45. package/mock-run/extra-slots.md +177 -177
  46. package/mock-run/habits.md +1 -1
  47. package/mock-run/orc-aftermath.md +392 -392
  48. package/mock-run/orc-budget.md +29 -33
  49. package/mock-run/orc-cli.md +200 -200
  50. package/mock-run/orc-explain.md +86 -86
  51. package/mock-run/orc-extra.md +389 -392
  52. package/mock-run/orc-fast.md +2 -2
  53. package/mock-run/orc-fix.md +87 -0
  54. package/mock-run/orc-pattern.md +112 -112
  55. package/mock-run/orc-quick.md +146 -146
  56. package/mock-run/orc.md +4 -4
  57. package/package.json +1 -1
  58. package/templates/agents/MODEL-MAPPING.md +176 -173
  59. package/templates/agents/orc-analyze-mini-sonnet-5-high.md +2 -2
  60. package/templates/agents/{orc-claude-writer-opus-5-med.md → orc-claude-writer-opus-5-low.md} +4 -4
  61. package/templates/agents/orc-executor-haiku-4-5.md +1 -1
  62. package/templates/agents/orc-executor-opus-5-low.md +1 -1
  63. package/templates/agents/orc-executor-sonnet-4-6-high.md +1 -1
  64. package/templates/agents/orc-executor-sonnet-4-6-med.md +1 -1
  65. package/templates/agents/orc-executor-sonnet-5-high.md +2 -2
  66. package/templates/agents/orc-executor-sonnet-5-low.md +155 -0
  67. package/templates/agents/orc-executor-sonnet-5-med.md +155 -0
  68. package/templates/agents/orc-pattern-codifier-sonnet-5-high.md +2 -2
  69. package/templates/agents/orc-planner-mini-sonnet-5-high.md +2 -2
  70. package/templates/agents/{orc-recon-sonnet-4-6-med.md → orc-recon-sonnet-5-med.md} +4 -4
  71. package/templates/agents/orc-retro-sonnet-5-high.md +2 -2
  72. package/templates/agents/{orc-reviewer-opus-5-med.md → orc-reviewer-opus-5-low.md} +4 -4
  73. package/templates/agents/{orc-wiki-scanner-opus-5-med.md → orc-wiki-scanner-opus-5-low.md} +3 -3
  74. package/templates/agents/orc-wiki-scanner-sonnet-5-high.md +2 -2
  75. package/templates/commands/orc-fast.md +10 -10
  76. package/templates/commands/orc-fix.md +18 -0
  77. package/templates/commands/orc-wiki.md +64 -64
  78. package/templates/hooks/README.md +75 -7
  79. package/templates/hooks/orc-session-hook.js +78 -3
  80. package/templates/hooks/orc-statusline-render.js +317 -23
  81. package/templates/hooks/orc-statusline.js +162 -49
  82. package/templates/hooks/orc-subagent-line.js +23 -5
  83. package/templates/hooks/orc-weather-fetch.js +123 -0
  84. package/templates/skills/_shared/extra-dispatch.md +1331 -1331
  85. package/templates/skills/_shared/gotchas.md +27 -7
  86. package/templates/skills/_shared/habits.md +2 -2
  87. package/templates/skills/_shared/opus5-only.md +137 -137
  88. package/templates/skills/_shared/phases/review.md +2 -2
  89. package/templates/skills/_shared/phases/trace-verbs.md +17 -3
  90. package/templates/skills/_shared/phases/trace.md +136 -136
  91. package/templates/skills/_shared/review-slice.md +28 -1
  92. package/templates/skills/_shared/wait.md +1 -0
  93. package/templates/skills/orc/README.md +2 -2
  94. package/templates/skills/orc/SKILL.md +227 -227
  95. package/templates/skills/orc/config.md +25 -27
  96. package/templates/skills/orc/examples/full-run-mock.md +74 -73
  97. package/templates/skills/orc/references/effort-and-mode.md +222 -222
  98. package/templates/skills/orc/references/preflight-report.md +3 -3
  99. package/templates/skills/orc/references/ultra-mode.md +1 -1
  100. package/templates/skills/orc/schemas/checkpoint.md +122 -122
  101. package/templates/skills/orc/subskills/orc-review-verify/SKILL.md +3 -3
  102. package/templates/skills/orc/subskills/orc-review-verify/core.md +1 -1
  103. package/templates/skills/orc-analyze/SKILL.md +4 -2
  104. package/templates/skills/orc-claude/SKILL.md +14 -14
  105. package/templates/skills/orc-claude/examples/claude-run-mock.md +65 -65
  106. package/templates/skills/orc-diy/SKILL.md +5 -5
  107. package/templates/skills/orc-fast/SKILL.md +210 -208
  108. package/templates/skills/orc-fix/SKILL.md +110 -0
  109. package/templates/skills/orc-grill/SKILL.md +232 -232
  110. package/templates/skills/orc-grill/references/grill-doc.md +1 -1
  111. package/templates/skills/orc-mini/SKILL.md +4 -4
  112. package/templates/skills/orc-mini/examples/mini-run-mock.md +4 -2
  113. package/templates/skills/orc-quick/README.md +536 -536
  114. package/templates/skills/orc-quick/SKILL.md +2 -2
  115. package/templates/skills/orc-quick/references/context-doc.md +145 -145
  116. package/templates/skills/orc-quick/references/dispatch-gate.md +220 -219
  117. package/templates/skills/orc-quick/references/gh-mode.md +4 -2
  118. package/templates/skills/orc-retro/SKILL.md +1 -1
  119. package/templates/skills/orc-retro/examples/retro-mock.md +16 -16
  120. package/templates/skills/orc-wiki/README.md +325 -325
  121. package/templates/skills/orc-wiki/SKILL.md +195 -195
  122. package/templates/skills/orc-wiki/examples/wiki-run-mock.md +37 -37
  123. package/templates/skills/orc-wiki/references/extra.md +2 -2
  124. package/templates/skills/orc-wiki/references/partial-refresh.md +276 -271
  125. package/templates/skills/orc-wiki/references/phases/phase-0.md +1 -1
  126. package/templates/skills/orc-wiki/references/phases/phase-2.md +3 -3
  127. package/templates/skills/orc-wiki/references/phases/phase-3c.md +3 -2
  128. package/templates/agents/orc-claude-writer-opus-4-8-high.md +0 -48
  129. package/templates/agents/orc-wiki-scanner-opus-4-8-high.md +0 -74
@@ -30,7 +30,7 @@ const { boundary } = require("./boundary.js");
30
30
  const { usage, waitLanes, waitStatus } = require("./wait.js");
31
31
  const hookui = require("./hookui.js");
32
32
  const { handoff } = require("./handoff.js");
33
- const { exportState, mocks } = require("./maintenance.js");
33
+ const { exportState, mocks, clearLogsSummary, clearLogsPreview, clearLogsPreviewEmpty } = require("./maintenance.js");
34
34
  const { chGoals, chDims, challengeRoles, challengeCouncil, challengeCycles, challengeList, challengeShow, challengeDiff, challengeDiffMissing, challengeLint } = require("./challenge.js");
35
35
  const { docList, docParts, docStatuses, docMapSections, docMap, docLint, docPlan, docShow, docSection, docShipped, docShippedDrifted, docNext, docAudit, docJournalRich, docJournalEmpty, docContext, docRules, docRulesFrozen, docForecast, docCost } = require("./docs.js");
36
36
  const { laneList, lanePhases, laneCalls } = require("./lanes.js");
@@ -280,7 +280,7 @@ module.exports.get = function get(route, q) {
280
280
  case "/api/budget/rates":
281
281
  return budgetRates;
282
282
  case "/api/budget/actual":
283
- return { ok: true, run: "store-credit", lane: "orc", trace: "run-orc-store-credit-100826-093012.txt", rows: [{ band: "[40,55)", dispatches: 3, forecast_weighted: 96000, actual_weighted: 138000, diff_pct: 44, tokens: { input: 9000, cache_write: 61000, cache_read: 121000, output: 11000 } }, { band: "[70,80)", dispatches: 1, forecast_weighted: 121000, actual_weighted: 304000, diff_pct: 151, tokens: { input: 12000, cache_write: 98000, cache_read: 240000, output: 24000 } }], actual: { tokens: { input: 21000, cache_write: 159000, cache_read: 361000, output: 35000 }, raw: 576000, weighted: 251100, usd: 7.02 }, cache_read_share: 0.71, unattributed: { blocks: 12, tokens: { input: 900, cache_write: 12000, cache_read: 24000, output: 1100 } }, joined: 17, dispatches: 19 };
283
+ return { ok: true, run: "store-credit", lane: "orc", trace: "run-orc-store-credit-100826-093012.txt", rows: [{ band: "[31,41)", dispatches: 3, forecast_weighted: 96000, actual_weighted: 138000, diff_pct: 44, tokens: { input: 9000, cache_write: 61000, cache_read: 121000, output: 11000 } }, { band: "[41,90)", dispatches: 1, forecast_weighted: 121000, actual_weighted: 304000, diff_pct: 151, tokens: { input: 12000, cache_write: 98000, cache_read: 240000, output: 24000 } }], actual: { tokens: { input: 21000, cache_write: 159000, cache_read: 361000, output: 35000 }, raw: 576000, weighted: 251100, usd: 7.02 }, cache_read_share: 0.71, unattributed: { blocks: 12, tokens: { input: 900, cache_write: 12000, cache_read: 24000, output: 1100 } }, joined: 17, dispatches: 19 };
284
284
  case "/api/aftermath":
285
285
  return aftermath;
286
286
  case "/api/export":
@@ -464,10 +464,37 @@ module.exports.get = function get(route, q) {
464
464
  { id: "prune", label: "Update AND delete ORC-named orphans from a pre-manifest install", command: "orc update --prune", network: false, names_files: true },
465
465
  { id: "fix", label: "Apply every fix orc doctor found (= update + prune + settings re-merge)", command: "orc doctor --fix", network: false, names_files: false },
466
466
  { id: "upgrade", label: "Fetch the LATEST package from the network, then apply it", command: "orc upgrade", network: true, names_files: false },
467
+ { id: "export", label: "Recompile AGENTS.md from the wiki, patterns, PACT.md and boundary cards", command: "orc export", network: false, names_files: false },
468
+ {
469
+ id: "clear-logs",
470
+ label: "Delete finished traces and run folders older than log_retention_days (never user data, never a waiting run)",
471
+ command: "orc clear logs --apply",
472
+ network: false,
473
+ names_files: true,
474
+ danger: true,
475
+ restarts_ui: false,
476
+ status: clearLogsSummary,
477
+ },
467
478
  { id: "update-global", label: "Re-copy this package's payload over the GLOBAL install in ~/.claude", command: "orc update --global", network: false, names_files: false, advanced: true },
468
479
  ],
469
480
  };
470
481
  case "/api/maintenance/preview":
482
+ if (q.action === "clear-logs")
483
+ return {
484
+ action: q.action,
485
+ label: "Preview (fixtures)",
486
+ command: "orc clear logs --apply",
487
+ network: false,
488
+ names_files: true,
489
+ advanced: false,
490
+ danger: true,
491
+ restarts_ui: false,
492
+ preview_command: "orc clear logs",
493
+ // ORC_UI_FIXTURE_CLEAR=empty shows the "nothing is old enough" state.
494
+ preview: process.env.ORC_UI_FIXTURE_CLEAR === "empty" ? clearLogsPreviewEmpty : clearLogsPreview,
495
+ waiting_runs: runs.runs.filter((r) => r.status === "waiting").map((r) => r.slug),
496
+ dirty_tree: false,
497
+ };
471
498
  return {
472
499
  action: q.action,
473
500
  label: "Preview (fixtures)",
@@ -481,7 +508,9 @@ module.exports.get = function get(route, q) {
481
508
  ? "upgrade"
482
509
  : q.action === "update-global"
483
510
  ? "update --global"
484
- : "update"),
511
+ : q.action === "export"
512
+ ? "export"
513
+ : "update"),
485
514
  network: q.action === "upgrade",
486
515
  names_files: q.action === "prune",
487
516
  advanced: q.action === "update-global",
@@ -191,8 +191,8 @@ const wikiPlan = {
191
191
  { id: "orientation", cost: "free", cmd: "/orc-wiki refresh wiki/orc-orientation.md", what: "regenerate the derived orientation doc (read first by every consumer)" },
192
192
  ],
193
193
  rows: [
194
- { doc: "wiki/orc-feature-refunds.md", state: "STRUCTURAL", delta: 0, delta_files: [], gone: ["api/refunds/window.ts"], used: 17, used_of: 20, last_used: "2026-08-10", tier: "deep", agent: "orc-wiki-scanner-opus-4-8-high", tier_rule: "structural", tier_why: "STRUCTURAL — a covered file is gone; a targeted refresh cannot re-anchor blind", new_surface: false, estimate: { p50: { input: 8000, cache_write: 40000, cache_read: 69000, output: 21000 }, p90: { input: 11000, cache_write: 58000, cache_read: 99000, output: 30000 }, samples: 7 }, usd: 0.42, retire_hint: false },
195
- { doc: "wiki/orc-feature-payments.md", state: "TOUCHED", delta: 6, delta_files: ["src/payments/ledger.ts", "src/payments/idempotency.ts"], gone: [], used: 14, used_of: 20, last_used: "2026-08-09", tier: "deep", agent: "orc-wiki-scanner-opus-4-8-high", tier_rule: "wide-delta", tier_why: "covered files touched >= wiki_tier_deep_files", new_surface: false, estimate: { p50: { input: 7000, cache_write: 36000, cache_read: 62000, output: 19000 }, p90: { input: 10000, cache_write: 51000, cache_read: 88000, output: 27000 }, samples: 7 }, usd: 0.38, retire_hint: false },
194
+ { doc: "wiki/orc-feature-refunds.md", state: "STRUCTURAL", delta: 0, delta_files: [], gone: ["api/refunds/window.ts"], used: 17, used_of: 20, last_used: "2026-08-10", tier: "deep", agent: "orc-wiki-scanner-opus-5-low", tier_rule: "structural", tier_why: "STRUCTURAL — a covered file is gone; a targeted refresh cannot re-anchor blind", new_surface: false, estimate: { p50: { input: 8000, cache_write: 40000, cache_read: 69000, output: 21000 }, p90: { input: 11000, cache_write: 58000, cache_read: 99000, output: 30000 }, samples: 7 }, usd: 0.42, retire_hint: false },
195
+ { doc: "wiki/orc-feature-payments.md", state: "TOUCHED", delta: 6, delta_files: ["src/payments/ledger.ts", "src/payments/idempotency.ts"], gone: [], used: 14, used_of: 20, last_used: "2026-08-09", tier: "deep", agent: "orc-wiki-scanner-opus-5-low", tier_rule: "wide-delta", tier_why: "covered files touched >= wiki_tier_deep_files", new_surface: false, estimate: { p50: { input: 7000, cache_write: 36000, cache_read: 62000, output: 19000 }, p90: { input: 10000, cache_write: 51000, cache_read: 88000, output: 27000 }, samples: 7 }, usd: 0.38, retire_hint: false },
196
196
  { doc: "wiki/orc-reference-config.md", state: "TOUCHED", delta: 1, delta_files: ["src/config/index.ts"], gone: [], used: 2, used_of: 20, last_used: "2026-07-25", tier: "light", agent: "orc-wiki-scanner-sonnet-5-high", tier_rule: "small-delta", tier_why: "small delta, no new surface", new_surface: false, estimate: { p50: { input: 3000, cache_write: 11000, cache_read: 17000, output: 4000 }, p90: { input: 4000, cache_write: 16000, cache_read: 25000, output: 6000 }, samples: 4 }, usd: 0.06, retire_hint: false },
197
197
  // The zero-use retire candidate. It KEEPS ITS SLOT and renders muted with a
198
198
  // hint — filtering it out would make "unused" and "does not exist" identical.
@@ -1,42 +1,123 @@
1
- "use strict";
2
- /* fixtures/maintenance.js — canned data for `orc ui --fixtures`.
3
- The export state and the mocked-example listing.
4
-
5
- THE RULE FOR EVERY FILE IN HERE: carry ONE OF EVERY STATE, including the
6
- ugly ones. You cannot DESIGN a STALE chip on a fresh wiki, and a state
7
- with no fixture is a state nobody has ever looked at. A per-state count
8
- test asserts this, so a new state cannot ship without one.
9
-
10
- Shapes MUST match what `bin/cli.js --json` really emits — a drifted
11
- fixture is worse than no fixture. */
12
-
13
- const { PROJECT } = require("./shell.js");
14
-
15
- const exportState = {
16
- ok: false,
17
- out: PROJECT + "/AGENTS.md",
18
- exists: true,
19
- source_commit: "c273793aa1b4",
20
- sources: 17,
21
- drifted: ["PACT.md", "wiki/orc-feature-payments.md", ".claude/orc/patterns/ts-pattern.md"],
22
- removed: [],
23
- stale: true,
24
- };
25
-
26
- /* ============================================================ v0.47.0 ====== */
27
- /* /orc-challenge. ONE OF EVERY STATE, including the ugly ones — you cannot
28
- design a TAMPERED chip on a healthy cycle, a MISSING-REVISION candidate list
29
- on a cycle whose revision is right where it should be, or a `NOT-CHECKED`
30
- dimension chip on a cycle that has a template. test/webui.test.js asserts one
31
- fixture per state, so a new state cannot ship without one. */
32
-
33
- const mocks = {
34
- root: PROJECT + "/mock-examples",
35
- total: 2,
36
- mocks: [
37
- { slug: "merchant-notifications", dir: PROJECT + "/mock-examples/merchant-notifications", mtime_ms: Date.now() - 40 * 60 * 1000, has_readme: true },
38
- { slug: "invoice-pdf-export", dir: PROJECT + "/mock-examples/invoice-pdf-export", mtime_ms: Date.now() - 5 * 24 * 60 * 60 * 1000, has_readme: false },
39
- ],
40
- };
41
-
42
- module.exports = { exportState, mocks };
1
+ "use strict";
2
+ /* fixtures/maintenance.js — canned data for `orc ui --fixtures`.
3
+ The export state and the mocked-example listing.
4
+
5
+ THE RULE FOR EVERY FILE IN HERE: carry ONE OF EVERY STATE, including the
6
+ ugly ones. You cannot DESIGN a STALE chip on a fresh wiki, and a state
7
+ with no fixture is a state nobody has ever looked at. A per-state count
8
+ test asserts this, so a new state cannot ship without one.
9
+
10
+ Shapes MUST match what `bin/cli.js --json` really emits — a drifted
11
+ fixture is worse than no fixture. */
12
+
13
+ const { PROJECT } = require("./shell.js");
14
+
15
+ const exportState = {
16
+ ok: false,
17
+ out: PROJECT + "/AGENTS.md",
18
+ exists: true,
19
+ source_commit: "c273793aa1b4",
20
+ sources: 17,
21
+ drifted: ["PACT.md", "wiki/orc-feature-payments.md", ".claude/orc/patterns/ts-pattern.md"],
22
+ removed: [],
23
+ stale: true,
24
+ };
25
+
26
+ /* ============================================================ v0.47.0 ====== */
27
+ /* /orc-challenge. ONE OF EVERY STATE, including the ugly ones — you cannot
28
+ design a TAMPERED chip on a healthy cycle, a MISSING-REVISION candidate list
29
+ on a cycle whose revision is right where it should be, or a `NOT-CHECKED`
30
+ dimension chip on a cycle that has a template. test/webui.test.js asserts one
31
+ fixture per state, so a new state cannot ship without one. */
32
+
33
+ const mocks = {
34
+ root: PROJECT + "/mock-examples",
35
+ total: 2,
36
+ mocks: [
37
+ { slug: "merchant-notifications", dir: PROJECT + "/mock-examples/merchant-notifications", mtime_ms: Date.now() - 40 * 60 * 1000, has_readme: true },
38
+ { slug: "invoice-pdf-export", dir: PROJECT + "/mock-examples/invoice-pdf-export", mtime_ms: Date.now() - 5 * 24 * 60 * 60 * 1000, has_readme: false },
39
+ ],
40
+ };
41
+
42
+ /* ============================================================ v2.1.0 W7 ==== */
43
+ /* `orc clear logs`. The summary is `--summary --json` (no scan); the preview
44
+ is the print mode's `--json`. ONE OF EVERY STATE the renderer draws: a trace
45
+ set, a leftover, a closed run with its git ref, a done run whose ref is
46
+ already gone, every keep reason, the moved cutoff, and the old default
47
+ folder. `ORC_UI_FIXTURE_CLEAR=empty` gives the nothing-to-delete preview. */
48
+
49
+ const clearLogsSummary = {
50
+ ok: true,
51
+ older_than_days: 30,
52
+ auto: "on",
53
+ last_sweep: { date: "2026-10-02", at: Date.now() - 3 * 60 * 60 * 1000, files: 41, bytes: 309112, older_than_days: 60 },
54
+ last_apply: null,
55
+ pruned_runs: 17,
56
+ rollup: ".claude/orc/logs-rollup.json",
57
+ };
58
+
59
+ const L = ".claude/orc/traces/";
60
+ const R = ".claude/orc/run/";
61
+ const clearLogsPreview = {
62
+ ok: true,
63
+ applied: false,
64
+ older_than_days: 30,
65
+ effective_days: 60,
66
+ cutoff: "2026-08-03",
67
+ cutoff_moved: { from: 30, to: 60, reason: "aftermath_window_days" },
68
+ log_dir: ".claude/orc/traces",
69
+ run_dir: ".claude/orc/run",
70
+ delete: [
71
+ {
72
+ path: L + "run-mini-order-store-extract-150626-192929.txt",
73
+ kind: "trace",
74
+ last_activity: "2026-06-15T20:04:11",
75
+ dated_by: "line stamp",
76
+ bytes: 9214,
77
+ files: [L + "run-mini-order-store-extract-150626-192929.txt", L + "run-mini-order-store-extract-150626-192929.txt.jsonl", L + "run-mini-order-store-extract-150626-192929.txt.pending.json"],
78
+ },
79
+ { path: L + "run-300626-005724.txt.superseded", kind: "leftover", last_activity: "2026-06-30T00:57:24", dated_by: "name stamp", bytes: 5830, files: [L + "run-300626-005724.txt.superseded"] },
80
+ {
81
+ path: R + "orders-cancel-endpoint/",
82
+ kind: "run",
83
+ status: "closed",
84
+ ref: "refs/orc/runs/orders-cancel-endpoint/pre",
85
+ last_activity: "2026-07-02T11:40:00",
86
+ dated_by: "mtime",
87
+ bytes: 22410,
88
+ files: [R + "orders-cancel-endpoint/RESUME.closed.md", R + "orders-cancel-endpoint/closed.json", R + "orders-cancel-endpoint/checkpoint.json", R + "orders-cancel-endpoint/snapshot.json"],
89
+ },
90
+ { path: R + "health-endpoint/", kind: "run", status: "done", ref: null, last_activity: "2026-06-20T09:12:45", dated_by: "mtime", bytes: 4096, files: [R + "health-endpoint/checkpoint.json"] },
91
+ ],
92
+ keep: [
93
+ { path: L + ".current", reason: "the active-run pointer — never touched" },
94
+ { path: L + "run-orc-orders-users-get-by-id-auth-011026-091500.txt", reason: "the active run — `.current` names it" },
95
+ { path: L + "run-quick-version-route-020926-101500.txt", reason: "holds habit answers (younger than 180 days)" },
96
+ { path: L + "run-fast-health-endpoint-210926-143000.txt", reason: "younger than 60 days (last activity 2026-09-21T14:41:09)" },
97
+ { path: L + "run-verify-cancel-endpoint-tree-021026-071000.txt", reason: "changed less than 6 hours ago — a run may still write to it" },
98
+ { path: L + "retro/", reason: "retro/ holds /orc-retro reports (deliverables) — never touched" },
99
+ { path: L + "habits-state.json", reason: "user data — never deleted" },
100
+ { path: R + "add-version-route/", reason: "a waiting run (RESUME.md, no RESUME.closed.md) — never touched" },
101
+ { path: R + "orders-search-endpoint/", reason: "a wait is armed (wait.json) — never touched" },
102
+ ],
103
+ totals: { units: 4, files: 9, bytes: 41550 },
104
+ default_dir: { path: ".claude/orc/logs", files: 132, bytes: 784384, included: false },
105
+ notes: [
106
+ "The cutoff moved from 30 to 60 days: aftermath_window_days is 60, and /orc-aftermath grades that window.",
107
+ "The old default folder .claude/orc/logs still holds 132 file(s) (766.0 KB). No reader sees it. Add --include-default-dir to clear it with the same rules.",
108
+ ],
109
+ };
110
+
111
+ const clearLogsPreviewEmpty = Object.assign({}, clearLogsPreview, {
112
+ older_than_days: 90,
113
+ effective_days: 90,
114
+ cutoff: "2026-07-04",
115
+ cutoff_moved: null,
116
+ delete: [],
117
+ keep: clearLogsPreview.keep.slice(0, 4),
118
+ totals: { units: 0, files: 0, bytes: 0 },
119
+ default_dir: null,
120
+ notes: [],
121
+ });
122
+
123
+ module.exports = { exportState, mocks, clearLogsSummary, clearLogsPreview, clearLogsPreviewEmpty };