@mcrescenzo/opencode-workflows 0.1.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 (71) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/CODE_OF_CONDUCT.md +134 -0
  3. package/CONTRIBUTING.md +95 -0
  4. package/LICENSE +21 -0
  5. package/README.md +746 -0
  6. package/SECURITY.md +38 -0
  7. package/commands/repo-bughunt.md +94 -0
  8. package/commands/repo-review.md +148 -0
  9. package/commands/workflow-live-gates-release-check.md +143 -0
  10. package/docs/workflow-plugin.md +400 -0
  11. package/opencode-workflows.js +5 -0
  12. package/package.json +86 -0
  13. package/skills/opencode-workflow-authoring/SKILL.md +180 -0
  14. package/skills/repo-review-command-protocol/SKILL.md +56 -0
  15. package/skills/workflow-model-tiering/SKILL.md +57 -0
  16. package/skills/workflow-plan-review/SKILL.md +91 -0
  17. package/workflow-kernel/approval-hashing.js +39 -0
  18. package/workflow-kernel/async-util.js +33 -0
  19. package/workflow-kernel/audited-shell-policy.js +200 -0
  20. package/workflow-kernel/authority-policy.js +670 -0
  21. package/workflow-kernel/budget-accounting.js +142 -0
  22. package/workflow-kernel/capability-adapter.js +753 -0
  23. package/workflow-kernel/child-agent-runner.js +1264 -0
  24. package/workflow-kernel/constants.js +117 -0
  25. package/workflow-kernel/diagnostics.js +152 -0
  26. package/workflow-kernel/drain-runtime.js +421 -0
  27. package/workflow-kernel/errors.js +181 -0
  28. package/workflow-kernel/event-journal.js +487 -0
  29. package/workflow-kernel/extension-registry.js +144 -0
  30. package/workflow-kernel/free-text-redactor.js +91 -0
  31. package/workflow-kernel/gate-shapes.js +82 -0
  32. package/workflow-kernel/git-util.js +45 -0
  33. package/workflow-kernel/index.js +72 -0
  34. package/workflow-kernel/integration-mode.js +155 -0
  35. package/workflow-kernel/lane-effort-policy.js +134 -0
  36. package/workflow-kernel/lifecycle-control.js +608 -0
  37. package/workflow-kernel/live-gate-probes.js +916 -0
  38. package/workflow-kernel/notification-toast-cards.js +393 -0
  39. package/workflow-kernel/notification-toast-policy.js +179 -0
  40. package/workflow-kernel/notification-toast-scope.js +100 -0
  41. package/workflow-kernel/notification-toast.js +287 -0
  42. package/workflow-kernel/path-policy.js +219 -0
  43. package/workflow-kernel/result-readback.js +106 -0
  44. package/workflow-kernel/role-template-loading.js +606 -0
  45. package/workflow-kernel/run-context.js +139 -0
  46. package/workflow-kernel/run-observability.js +43 -0
  47. package/workflow-kernel/run-store-fs.js +231 -0
  48. package/workflow-kernel/run-store-locks.js +180 -0
  49. package/workflow-kernel/run-store-projections.js +421 -0
  50. package/workflow-kernel/run-store-rehydrate.js +68 -0
  51. package/workflow-kernel/run-store-state.js +147 -0
  52. package/workflow-kernel/run-store-status-format.js +1154 -0
  53. package/workflow-kernel/run-store-status.js +107 -0
  54. package/workflow-kernel/sandbox-executor.js +1131 -0
  55. package/workflow-kernel/session-access.js +56 -0
  56. package/workflow-kernel/structured-output.js +143 -0
  57. package/workflow-kernel/test-fix-drain-adapter.js +119 -0
  58. package/workflow-kernel/text-json.js +136 -0
  59. package/workflow-kernel/workflow-plugin.js +3017 -0
  60. package/workflow-kernel/workflow-source.js +444 -0
  61. package/workflow-kernel/worktree-adapter.js +256 -0
  62. package/workflow-kernel/worktree-git.js +147 -0
  63. package/workflows/repo-bughunt.js +362 -0
  64. package/workflows/repo-cleanup.js +383 -0
  65. package/workflows/repo-complexity.js +404 -0
  66. package/workflows/repo-deps.js +457 -0
  67. package/workflows/repo-modernize.js +395 -0
  68. package/workflows/repo-perf.js +394 -0
  69. package/workflows/repo-review.js +831 -0
  70. package/workflows/repo-security-audit.js +466 -0
  71. package/workflows/repo-test-gaps.js +377 -0
@@ -0,0 +1,107 @@
1
+ // Run store + status aggregator.
2
+ //
3
+ // This module was a 957-line file mixing five concerns (opencode-workflows-nbp). It has been
4
+ // split along its five existing concerns using the documented RunContext coupling surface
5
+ // (run-context.js), plus a shared FS/primitive base:
6
+ //
7
+ // - run-store-fs.js shared FS/JSON/path/PID/run-root primitives + `runs` registry
8
+ // - run-store-state.js (1) durable state writes (writeState)
9
+ // - run-store-locks.js (2) lock-file management (acquire/read/clear, lifecycle requests)
10
+ // - run-store-projections.js (3) lane outcome / projection recording + checkpoints + salvage
11
+ // - run-store-rehydrate.js (4) run rehydration from prior on-disk state
12
+ // - run-store-status-format.js (5) status formatting (compact/full/list/cleanup/reconcile)
13
+ //
14
+ // This file now exists only to preserve the historical public surface: every symbol the old
15
+ // run-store-status.js exported is re-exported here so existing importers
16
+ // (workflow-plugin.js, sandbox-executor.js, child-agent-runner.js, lifecycle-control.js,
17
+ // role-template-loading.js, live-gate-probes.js) and the index.js barrel resolve identically.
18
+ // The split is behavior-preserving; no logic lives here.
19
+
20
+ export {
21
+ PRIVATE_DIR_MODE,
22
+ PRIVATE_FILE_MODE,
23
+ LOCK_LIVENESS_FALLBACK_TTL_MS,
24
+ runs,
25
+ selfStartTime,
26
+ readJsonFile,
27
+ writeJsonAtomic,
28
+ ensurePrivateDir,
29
+ writeFilePrivate,
30
+ appendFilePrivate,
31
+ pathExists,
32
+ assertSafeRunId,
33
+ runDirForRoot,
34
+ processStartTime,
35
+ selfProcessStartTime,
36
+ processAppearsAlive,
37
+ currentProcessInfo,
38
+ runRoot,
39
+ globalRunRoot,
40
+ runRoots,
41
+ ensureRunRoot,
42
+ assertContainedRealPath,
43
+ assertContainedRunDir,
44
+ safeProjectionName,
45
+ isPathInside,
46
+ } from "./run-store-fs.js";
47
+
48
+ export {
49
+ RUN_LOCK_FILE,
50
+ APPLY_LOCK_FILE,
51
+ CLEANUP_LOCK_FILE,
52
+ CANCEL_REQUEST_FILE,
53
+ PAUSE_REQUEST_FILE,
54
+ KILL_REQUEST_FILE,
55
+ lockPathForRun,
56
+ cleanupLockPath,
57
+ readLock,
58
+ acquireWorkflowLock,
59
+ runLocksForEntry,
60
+ clearStaleRunLocks,
61
+ lifecycleRequestPath,
62
+ writeLifecycleRequest,
63
+ readLifecycleRequests,
64
+ } from "./run-store-locks.js";
65
+
66
+ export {
67
+ recordLaneOutcome,
68
+ writeSalvagedLaneOutcome,
69
+ recoverySummary,
70
+ writeLaneProjection,
71
+ writeDurableProjections,
72
+ readLaneProjections,
73
+ writeLaneCheckpoint,
74
+ readLaneRequestCheckpoint,
75
+ readLaneResultCheckpoint,
76
+ removeLaneCheckpoint,
77
+ computeSalvageCandidates,
78
+ attachSalvageCandidates,
79
+ } from "./run-store-projections.js";
80
+
81
+ export { writeState, computeLastProgressAt, __setWriteStateTestHook } from "./run-store-state.js";
82
+
83
+ export { rehydrateRunFromPriorState } from "./run-store-rehydrate.js";
84
+
85
+ export {
86
+ STALE_PROGRESS_THRESHOLD_MS,
87
+ lastProgressAtForState,
88
+ stalenessSignal,
89
+ laneFailureSummaries,
90
+ timeoutResumeEligibilityForState,
91
+ readRunEntry,
92
+ compactStatusForEntry,
93
+ declaredProfileForState,
94
+ resultStatusForEntry,
95
+ notificationStatusForEntry,
96
+ fullStatusForEntry,
97
+ statusForEntry,
98
+ eventsForEntry,
99
+ eventsText,
100
+ listRunEntries,
101
+ cleanupProtectionReason,
102
+ summarizeEntries,
103
+ statusText,
104
+ reconcileRuns,
105
+ cleanupRuns,
106
+ readRunById,
107
+ } from "./run-store-status-format.js";