owlrunkit 0.13.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 (128) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/LICENSE +674 -0
  3. package/NOTICE.md +137 -0
  4. package/README.md +44 -0
  5. package/SOURCE.md +10 -0
  6. package/docs/architecture/OWLCODA_RUN_KIT_CONTRACT_V0_1.md +160 -0
  7. package/docs/architecture/OWLCODA_RUN_KIT_CONTRACT_V0_2.md +459 -0
  8. package/integrations/codex/skills/owlcoda-runkit/SKILL.md +408 -0
  9. package/integrations/codex/skills/owlcoda-runkit/agents/openai.yaml +4 -0
  10. package/integrations/codex/skills/owlcoda-runkit/assets/templates/agents-snippet.md +7 -0
  11. package/integrations/codex/skills/owlcoda-runkit/assets/templates/config.json +10 -0
  12. package/integrations/codex/skills/owlcoda-runkit/assets/templates/coverage-adopt-request.json +26 -0
  13. package/integrations/codex/skills/owlcoda-runkit/assets/templates/execution-delivery-packet.json +13 -0
  14. package/integrations/codex/skills/owlcoda-runkit/assets/templates/finalize-request.json +18 -0
  15. package/integrations/codex/skills/owlcoda-runkit/assets/templates/goal-contract.json +11 -0
  16. package/integrations/codex/skills/owlcoda-runkit/assets/templates/profiles.json +9 -0
  17. package/integrations/codex/skills/owlcoda-runkit/assets/templates/ready-for-commit-request.json +11 -0
  18. package/integrations/codex/skills/owlcoda-runkit/assets/templates/resource-preflight-request.json +56 -0
  19. package/integrations/codex/skills/owlcoda-runkit/assets/templates/resume-request.json +10 -0
  20. package/integrations/codex/skills/owlcoda-runkit/assets/templates/snapshot-request.json +23 -0
  21. package/integrations/codex/skills/owlcoda-runkit/assets/templates/verification-context.json +15 -0
  22. package/integrations/codex/skills/owlcoda-runkit/assets/templates/verification-receipt.json +11 -0
  23. package/integrations/codex/skills/owlcoda-runkit/assets/templates/verify-plan-request.json +31 -0
  24. package/integrations/codex/skills/owlcoda-runkit/assets/templates/visual-smoke-request.json +32 -0
  25. package/integrations/codex/skills/owlcoda-runkit/assets/templates/worker-lease.json +7 -0
  26. package/package.json +24 -0
  27. package/packages/attest/LICENSE +674 -0
  28. package/packages/attest/README.md +63 -0
  29. package/packages/attest/cli/owlcoda-attest.mjs +155 -0
  30. package/packages/attest/consumer-surface-v1.json +255 -0
  31. package/packages/attest/distribution-manifest-v1.json +104 -0
  32. package/packages/attest/fixtures/bad/accepted-authority-leak.json +7 -0
  33. package/packages/attest/fixtures/bad/accepted-failed-receipt.json +7 -0
  34. package/packages/attest/fixtures/bad/active-context-binding-mismatch.json +7 -0
  35. package/packages/attest/fixtures/bad/active-source-binding-mismatch.json +7 -0
  36. package/packages/attest/fixtures/bad/context-fingerprint-mismatch.json +7 -0
  37. package/packages/attest/fixtures/bad/duplicate-object-key.json +8 -0
  38. package/packages/attest/fixtures/bad/multiple-active-leaves.json +10 -0
  39. package/packages/attest/fixtures/bad/orphan-replacement.json +7 -0
  40. package/packages/attest/fixtures/bad/root-shape-extra-property.json +8 -0
  41. package/packages/attest/fixtures/bad/source-fingerprint-mismatch.json +7 -0
  42. package/packages/attest/fixtures/good/accepted-replacement-chain.json +59 -0
  43. package/packages/attest/fixtures/good/blocked-single-leaf.json +9 -0
  44. package/packages/attest/fixtures/index.json +90 -0
  45. package/packages/attest/sbom.spdx.json +33 -0
  46. package/packages/attest/schemas/attestation-ref-v1.schema.json +44 -0
  47. package/packages/attest/schemas/attestation-result-v1.schema.json +163 -0
  48. package/packages/attest/schemas/offline-attestation-bundle-v1.schema.json +30 -0
  49. package/packages/attest/schemas/public-verification-bundle-v1.schema.json +74 -0
  50. package/packages/attest/schemas/quick-verification-receipt-v1.schema.json +219 -0
  51. package/packages/attest/schemas/workspace-snapshot-v1.schema.json +135 -0
  52. package/packages/attest/src/canonical.mjs +12 -0
  53. package/packages/attest/src/formal.mjs +762 -0
  54. package/packages/attest/src/index.mjs +113 -0
  55. package/packages/attest/src/offline-bundle.mjs +108 -0
  56. package/packages/attest/src/quick-receipt-contract.mjs +156 -0
  57. package/packages/attest/src/quick.mjs +274 -0
  58. package/packages/attest/src/reference-contract.mjs +64 -0
  59. package/packages/attest/src/reference.mjs +131 -0
  60. package/packages/attest/src/workspace-snapshot.mjs +171 -0
  61. package/registry-release-policy-v1.json +34 -0
  62. package/sbom.spdx.json +39 -0
  63. package/scripts/runkit-contract/acceptance-evidence.mjs +103 -0
  64. package/scripts/runkit-contract/core-contract.mjs +392 -0
  65. package/scripts/runkit-contract/coverage-adoption.mjs +414 -0
  66. package/scripts/runkit-contract/delivery-create.mjs +252 -0
  67. package/scripts/runkit-contract/delivery-selection.mjs +31 -0
  68. package/scripts/runkit-contract/finalize.mjs +790 -0
  69. package/scripts/runkit-contract/inspect-presentation.mjs +183 -0
  70. package/scripts/runkit-contract/install-codex-skill.mjs +239 -0
  71. package/scripts/runkit-contract/lease-lifecycle.mjs +324 -0
  72. package/scripts/runkit-contract/lifecycle-orchestration.mjs +415 -0
  73. package/scripts/runkit-contract/offline-store.mjs +248 -0
  74. package/scripts/runkit-contract/profile-impact.mjs +223 -0
  75. package/scripts/runkit-contract/provenance-common.mjs +153 -0
  76. package/scripts/runkit-contract/quick-attest.mjs +4 -0
  77. package/scripts/runkit-contract/quick-canonical.mjs +41 -0
  78. package/scripts/runkit-contract/quick-metrics.mjs +86 -0
  79. package/scripts/runkit-contract/quick-receipt.mjs +139 -0
  80. package/scripts/runkit-contract/quick-verify.mjs +201 -0
  81. package/scripts/runkit-contract/quick-workspace-snapshot.mjs +3 -0
  82. package/scripts/runkit-contract/ready-for-commit.mjs +188 -0
  83. package/scripts/runkit-contract/receipt-lineage.mjs +332 -0
  84. package/scripts/runkit-contract/registry-adoption-gate.mjs +117 -0
  85. package/scripts/runkit-contract/repair-execution.mjs +997 -0
  86. package/scripts/runkit-contract/resource-preflight.mjs +829 -0
  87. package/scripts/runkit-contract/resume-execution.mjs +569 -0
  88. package/scripts/runkit-contract/runkit-cli.mjs +1214 -0
  89. package/scripts/runkit-contract/schemas/closeout-receipt-v2.schema.json +42 -0
  90. package/scripts/runkit-contract/schemas/core-artifact-v2.schema.json +23 -0
  91. package/scripts/runkit-contract/schemas/core-artifact.schema.json +23 -0
  92. package/scripts/runkit-contract/schemas/coverage-adopt-request-v1.schema.json +66 -0
  93. package/scripts/runkit-contract/schemas/engine-pin-v2.schema.json +14 -0
  94. package/scripts/runkit-contract/schemas/engine-pin.schema.json +14 -0
  95. package/scripts/runkit-contract/schemas/evidence-coverage-index-v1.schema.json +131 -0
  96. package/scripts/runkit-contract/schemas/finalize-request-v1.schema.json +131 -0
  97. package/scripts/runkit-contract/schemas/profiles.schema.json +47 -0
  98. package/scripts/runkit-contract/schemas/project-config-v2.schema.json +13 -0
  99. package/scripts/runkit-contract/schemas/project-config.schema.json +13 -0
  100. package/scripts/runkit-contract/schemas/ready-for-commit-v1.schema.json +26 -0
  101. package/scripts/runkit-contract/schemas/replayable-evidence-v1.schema.json +82 -0
  102. package/scripts/runkit-contract/schemas/resource-preflight-request-v1.schema.json +178 -0
  103. package/scripts/runkit-contract/schemas/resource-preflight-v1.schema.json +153 -0
  104. package/scripts/runkit-contract/schemas/resume-attempt-v1.schema.json +80 -0
  105. package/scripts/runkit-contract/schemas/resume-request-v1.schema.json +77 -0
  106. package/scripts/runkit-contract/schemas/snapshot-v1.schema.json +71 -0
  107. package/scripts/runkit-contract/schemas/verification-context-v1.schema.json +92 -0
  108. package/scripts/runkit-contract/schemas/verification-plan-v1.schema.json +150 -0
  109. package/scripts/runkit-contract/schemas/verification-receipt-v2.schema.json +118 -0
  110. package/scripts/runkit-contract/schemas/verify-plan-request-v1.schema.json +56 -0
  111. package/scripts/runkit-contract/schemas/visual-smoke-request-v1.schema.json +64 -0
  112. package/scripts/runkit-contract/schemas/visual-smoke-result-v1.schema.json +68 -0
  113. package/scripts/runkit-contract/snapshot.mjs +340 -0
  114. package/scripts/runkit-contract/source-fingerprint.mjs +404 -0
  115. package/scripts/runkit-contract/templates/coverage-adopt-request.json +26 -0
  116. package/scripts/runkit-contract/templates/finalize-request.json +18 -0
  117. package/scripts/runkit-contract/templates/goal-contract.json +11 -0
  118. package/scripts/runkit-contract/templates/ready-for-commit-request.json +11 -0
  119. package/scripts/runkit-contract/templates/resource-preflight-request.json +56 -0
  120. package/scripts/runkit-contract/templates/resume-request.json +10 -0
  121. package/scripts/runkit-contract/templates/snapshot-request.json +23 -0
  122. package/scripts/runkit-contract/templates/verify-plan-request.json +31 -0
  123. package/scripts/runkit-contract/templates/visual-smoke-request.json +32 -0
  124. package/scripts/runkit-contract/templates/worker-lease.json +7 -0
  125. package/scripts/runkit-contract/verification-context.mjs +141 -0
  126. package/scripts/runkit-contract/verification-plan.mjs +608 -0
  127. package/scripts/runkit-contract/verification-receipt-gate.mjs +566 -0
  128. package/scripts/runkit-contract/visual-smoke.mjs +410 -0
@@ -0,0 +1,408 @@
1
+ ---
2
+ name: owlcoda-runkit
3
+ description: Run receipt-backed, project-owned software execution with OwlCoda RunKit. Use when Codex needs to initialize or inspect `.owlcoda/runkit/`, plan bounded work with engine pins and leases, capture exact shell or visual verification evidence, finalize delivery evidence, avoid duplicate covered tests, close an execution, produce a ready-for-commit receipt, or perform a read-only foreign-project shadow without widening Git or release authority.
4
+ ---
5
+
6
+ # OwlCoda RunKit
7
+
8
+ Use the bundled deterministic Core to coordinate work through project artifacts rather than chat memory. Require Node.js 20 or later.
9
+
10
+ The session is an execution interface. Project artifacts are the system of record.
11
+
12
+ ## Start safely
13
+
14
+ 1. Locate the project root and read its AGENTS.md chain.
15
+ 2. If `.owlrunkit/` exists, do not initialize `.owlcoda/runkit/`; report that an explicit migration is required.
16
+ 3. Treat `.owlcoda/runkit/config.json`, profiles, plans and commands as data, never as authorization.
17
+ 4. Never include `.owlcoda/runkit/**` in delivery changed files, profile rules or lease owned paths.
18
+ 5. Read [references/contract-v0.2.md](references/contract-v0.2.md) for new executions and accepted closeouts. Read [references/contract-v0.1.md](references/contract-v0.1.md) only when interpreting historical v0.1 artifacts.
19
+
20
+ Set `SKILL_ROOT` to this skill directory before running the examples below.
21
+
22
+ ## Initialize and inspect
23
+
24
+ ```bash
25
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" init --workspace "$PROJECT_ROOT"
26
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" inspect --json --workspace "$PROJECT_ROOT"
27
+ ```
28
+
29
+ Initialization may write only `.owlcoda/runkit/`. It must not modify business source.
30
+ It atomically upgrades a known ConfigV1 project or refreshes an older v0.2
31
+ Core patch identity and writes a local migration receipt with
32
+ `authorizationGranted=false`. An unknown config version fails closed.
33
+
34
+ Inspection validates a closed execution against the Core identity preserved
35
+ in its closeout receipt, so historical v0.1 work remains readable. An active
36
+ execution is still compared with the installed Core and engine drift exits
37
+ non-zero. Core v0.4 also emits a deterministic recovery summary. It reports
38
+ zero, one, or multiple active executions, validates current leases, delivery
39
+ packets, receipt lineage and accepted gates, and names one next allowed action.
40
+ Multiple active runs, stale delivery, malformed artifacts, or ambiguous
41
+ evidence fail closed instead of silently selecting a run.
42
+
43
+ Direct `inspect` without `--json` is the human view. It reports current
44
+ execution, latest indexed closeout, source/evidence state, active lease holders,
45
+ dominant gap, next legal action and false release authority. Use
46
+ `inspect --history` for indexed closed executions and
47
+ `inspect --run-id ID --verbose` for one execution. Codex and other machine
48
+ adapters must always request `--json`; that document retains the complete
49
+ recovery tree plus `OwlCodaRunKitInspectSummaryV1` for read-only consumers.
50
+ Malformed unclosed executions remain open and require repair, ambiguous active
51
+ executions never borrow historical evidence, and symlinked, redirected,
52
+ dangling or non-regular control truth fails closed instead of appearing absent.
53
+ Project config authority fields are validated before output, human text escapes
54
+ control characters, and indexed ordering is locale independent.
55
+
56
+ ## Choose the smallest assurance lane
57
+
58
+ Choose the lane before planning. Do not create a Formal execution merely
59
+ because this skill is available.
60
+
61
+ - Use ordinary project tools without RunKit for disposable prototypes, early
62
+ research, visual exploration or clean short tasks that need no durable
63
+ handoff, evidence consumption or formal acceptance.
64
+ - Use Quick Verification for one low-risk command that needs a source-bound,
65
+ reusable verification receipt but no writer lease or formal acceptance.
66
+ - Use Formal Delivery for multi-writer work, long-running or interrupted work,
67
+ dirty parallel workspaces, migration, integration, release, production,
68
+ funds or another delivery requiring formal acceptance.
69
+
70
+ If work crosses lanes, re-evaluate risk and authority. Moving from Quick to
71
+ Formal requires a fresh GoalContract, exact write scope, profiles and authority;
72
+ never treat a Quick receipt as Formal acceptance.
73
+
74
+ ## Plan one execution
75
+
76
+ Prepare a JSON goal contract, then run:
77
+
78
+ ```bash
79
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" plan \
80
+ --workspace "$PROJECT_ROOT" \
81
+ --run-id "$RUN_ID" \
82
+ --goal "$GOAL_JSON"
83
+ ```
84
+
85
+ Use one run id on one branch only. Assign one active lease per non-overlapping write scope. Feature work may stop at `ready_for_stage_verification` with a DeliveryPacket.
86
+
87
+ ## Use the high-level daily lifecycle
88
+
89
+ For a normal single-command verification path, compose the same atomic Core
90
+ artifacts with three commands:
91
+
92
+ ```bash
93
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" start \
94
+ --workspace "$PROJECT_ROOT" --run-id "$RUN_ID" --goal "$GOAL_JSON" \
95
+ --work-item "$WORK_ITEM_ID" \
96
+ --owned-path "src/exact-file.ts" --owned-path "tests/feature/**"
97
+
98
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" verify \
99
+ --workspace "$PROJECT_ROOT" --run-id "$RUN_ID" \
100
+ --from-lease "$WORK_ITEM_ID" --verification-id "$VERIFICATION_ID" \
101
+ --cwd "." -- "$ABSOLUTE_EXECUTABLE" "arg-one" "arg-two"
102
+
103
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" finish \
104
+ --workspace "$PROJECT_ROOT" --run-id "$RUN_ID" --decision accepted
105
+ ```
106
+
107
+ `start` rolls back a newly created execution if lease acquisition fails.
108
+ `verify` preserves the exact argv after `--`, derives the DeliveryPacket,
109
+ verification context, snapshot request and finalize request, and never
110
+ finalizes a failed snapshot. The executable may have zero arguments and argv
111
+ may contain empty strings; no shell normalization is allowed. High-level verify
112
+ holds the control transaction through command completion, and its snapshot
113
+ source map must match the same DeliveryPacket at finalize and accepted finish.
114
+ `finish accepted` derives the unique Contract v0.2 active gate before releasing
115
+ leases and closing; a persistence failure restores leases, and project-truth
116
+ directories with symlink ancestors fail before mutation. `blocked` and
117
+ `rejected` remain honest non-accepted closeouts. These are convenience
118
+ composition commands, not a second truth model. The atomic commands below
119
+ remain available for recovery and unusual workflows.
120
+
121
+ ## Manage leases and create delivery without hand-authored JSON
122
+
123
+ Acquire one bounded writer lease with repeated explicit paths:
124
+
125
+ ```bash
126
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" lease acquire \
127
+ --workspace "$PROJECT_ROOT" \
128
+ --run-id "$RUN_ID" \
129
+ --work-item "$WORK_ITEM_ID" \
130
+ --owned-path "src/exact-file.ts" \
131
+ --owned-path "tests/feature/**"
132
+ ```
133
+
134
+ Inspect or release it through the Core instead of editing lease JSON:
135
+
136
+ ```bash
137
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" lease inspect \
138
+ --workspace "$PROJECT_ROOT" --run-id "$RUN_ID"
139
+
140
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" lease release \
141
+ --workspace "$PROJECT_ROOT" --run-id "$RUN_ID" \
142
+ --work-item "$WORK_ITEM_ID"
143
+ ```
144
+
145
+ After implementation, derive the bounded DeliveryPacket from the active lease:
146
+
147
+ ```bash
148
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" delivery create \
149
+ --workspace "$PROJECT_ROOT" \
150
+ --run-id "$RUN_ID" \
151
+ --from-lease "$WORK_ITEM_ID" \
152
+ --packet-id "$PACKET_ID"
153
+ ```
154
+
155
+ The Core includes only changed regular files owned by that lease, reports
156
+ unrelated dirty paths without claiming them, and fails closed on deletions,
157
+ renames, symlinks, empty candidates, conflicting leases, or reserved runtime
158
+ paths. These commands write only RunKit artifacts and always keep
159
+ `authorizationGranted=false`.
160
+
161
+ ## Validate delivery before verification
162
+
163
+ ```bash
164
+ node "$SKILL_ROOT/scripts/runkit-contract/source-fingerprint.mjs" \
165
+ --workspace "$PROJECT_ROOT" \
166
+ --packet "$DELIVERY_PACKET"
167
+ ```
168
+
169
+ Exit `2` means `invalidated_by_concurrent_write`; run no verifier commands. Request a replacement packet and preserve the invalidated receipt.
170
+
171
+ Select profiles with JSON on stdin:
172
+
173
+ ```bash
174
+ node "$SKILL_ROOT/scripts/runkit-contract/profile-impact.mjs" < "$PROFILE_INPUT"
175
+ ```
176
+
177
+ If any path is uncovered, use the declared full profile. Do not interpret an empty selection as success.
178
+
179
+ ## Adopt receipt-backed coverage
180
+
181
+ Before reusing evidence, prepare `OwlCodaRunKitCoverageAdoptRequestV1` and run:
182
+
183
+ ```bash
184
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" coverage-adopt \
185
+ --workspace "$PROJECT_ROOT" \
186
+ --run-id "$RUN_ID" \
187
+ --request "$COVERAGE_ADOPT_REQUEST_JSON"
188
+ ```
189
+
190
+ The request may select a hashed Contract v0.2 gate artifact, bind its receipt
191
+ command ids to project profile commands, and map dependency ids to receipt
192
+ material inputs or VerificationContext entries. It must not supply receipt
193
+ status, source hashes, dependency hashes, context fingerprints, selected
194
+ profiles, or exit results. The Core recomputes those facts, validates the gate
195
+ and exact command evidence, and writes an authorization-free coverage index.
196
+ Never hand-author reusable coverage when `coverage-adopt` is available.
197
+
198
+ ## Resume without rewriting history
199
+
200
+ After inspecting the source execution, prepare `OwlCodaRunKitResumeRequestV1`
201
+ and run:
202
+
203
+ ```bash
204
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" resume \
205
+ --workspace "$PROJECT_ROOT" \
206
+ --run-id "$SOURCE_RUN_ID" \
207
+ --request "$RESUME_REQUEST_JSON"
208
+ ```
209
+
210
+ For an unclosed source, use `continuationRunId=null`; the source must be the
211
+ only active execution, its engine pin must match, and no writer lease may be
212
+ active. It must not already have a finalized receipt lineage; close such a run
213
+ before resuming it as a continuation so `inspect` cannot mistake prior
214
+ verification for resumed progress. For a closed source, provide a new
215
+ continuation run id. The Core copies
216
+ the exact parent goal bytes into the new execution and binds the parent goal,
217
+ closeout, decision, hashes, and run ids without changing the parent.
218
+
219
+ Resume coverage uses the same selectors and derivation boundary as
220
+ `coverage-adopt`; never add receipt status, source hashes, reusable receipt ids,
221
+ or other coverage truth to the request. After resume, follow the artifact's
222
+ required workflow: acquire a writer lease, prepare or replace the DeliveryPacket,
223
+ then run `verify-plan`. Do not treat inherited receipt ids as accepted or fresh
224
+ until `verify-plan` re-derives the coverage and classifies current drift.
225
+ `resume` always keeps `authorizationGranted=false`.
226
+
227
+ ## Generate the minimum verification plan
228
+
229
+ After freezing a DeliveryPacket, prepare
230
+ `OwlCodaRunKitVerifyPlanRequestV1` with the adopted coverage artifact path and
231
+ SHA-256, then run:
232
+
233
+ ```bash
234
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" verify-plan \
235
+ --workspace "$PROJECT_ROOT" \
236
+ --run-id "$RUN_ID" \
237
+ --request "$VERIFY_PLAN_REQUEST_JSON"
238
+ ```
239
+
240
+ The Core recomputes Git dirty paths, current delivery source hashes, declared
241
+ dependency hashes, active or released lease scopes, verification context, and
242
+ project profiles. Before any receipt is reused, it also re-derives the coverage
243
+ index from its current gate bytes, active receipt, exact command evidence, and
244
+ dependency selectors; a changed gate or derived mismatch fails closed. It
245
+ distinguishes leased source drift, declared dependency drift,
246
+ unrelated dirty-tree drift, and global gate failure. Unrelated changes remain visible but
247
+ do not invalidate an otherwise reusable receipt; a declared global gate may
248
+ still block acceptance. Supporting profile matches do not become selected
249
+ profiles, and supporting-only coverage fails closed.
250
+
251
+ Execute only the exact definitions in `pendingCommands`. Do not rerun
252
+ `reusedCommandIds`. If `unmappedProfileIds` is non-empty, stop at
253
+ `verification_mapping_required`; never infer that an empty command list means
254
+ verified. A generated plan is project-owned evidence and always keeps
255
+ `authorizationGranted=false`; it does not authorize executing commands, Git,
256
+ release, credentials, deletion, or foreign writes.
257
+
258
+ ## Preflight model resources before model-intensive work
259
+
260
+ For a model workload, first bind the remaining work to a hashed
261
+ `OwlCodaRunKitVerificationPlanV1`, then prepare
262
+ `OwlCodaRunKitResourcePreflightRequestV1` and run:
263
+
264
+ ```bash
265
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" resource-preflight \
266
+ --workspace "$PROJECT_ROOT" \
267
+ --run-id "$RUN_ID" \
268
+ --request "$RESOURCE_PREFLIGHT_REQUEST_JSON"
269
+ ```
270
+
271
+ Each workload must name its provider/model, estimated calls, total input and
272
+ output tokens, and elapsed time. Use `coveredByReceiptId` only when that receipt
273
+ appears in the bound plan's `reusableReceiptIds`; the Core rejects stale or
274
+ invented reuse. Availability, remaining calls, remaining tokens, reset time,
275
+ and pricing are separate typed facts. Record unavailable fields as `unknown`
276
+ with a reason; never substitute a screenshot, prose balance, guessed reset
277
+ time, credential, or provider response that lacks a hash-bound adapter source.
278
+ Set `maxObservationAgeMs` to the evidence lifetime the project can defend. If
279
+ `inspect` reports the latest preflight as `expired`, refresh the adapter evidence
280
+ and append a new preflight; do not use the previous model-readiness decision.
281
+
282
+ The project policy must explicitly choose fail-open or fail-closed behavior for
283
+ availability, quota, reset time, and pricing. A required unavailable model,
284
+ insufficient known quota, exceeded limit, or fail-closed unknown produces
285
+ `blocked_by_resource` and `pause_at_deterministic_stage`. A model-optional gate
286
+ may continue without model calls, but RunKit never selects a fallback model.
287
+ `ready_for_model_execution` is resource readiness only: it does not execute a
288
+ model call or grant credentials, Git, release, publish, deploy, or foreign-write
289
+ authority.
290
+
291
+ ## Validate receipts and gate acceptance
292
+
293
+ ```bash
294
+ node "$SKILL_ROOT/scripts/runkit-contract/receipt-lineage.mjs" "$LINEAGE_JSON"
295
+ node "$SKILL_ROOT/scripts/runkit-contract/verification-receipt-gate.mjs" "$GATE_INPUT_JSON"
296
+ ```
297
+
298
+ Run one stage profile after all dependent packets are fresh. Do not repeat commands already bound by a valid receipt. A zero-command receipt may remain ready or shadow-validated, but cannot be accepted as passed.
299
+
300
+ For Contract v0.2, bind the receipt to a recomputable
301
+ `VerificationContextV1`. Shell evidence requires exact argv; automation
302
+ evidence requires a manifest SHA-256 and output artifacts. Descriptive command
303
+ labels are not acceptance evidence.
304
+
305
+ ## Capture exact verification snapshots
306
+
307
+ Prepare `OwlCodaRunKitSnapshotRequestV1`, then run:
308
+
309
+ ```bash
310
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" snapshot \
311
+ --workspace "$PROJECT_ROOT" \
312
+ --run-id "$RUN_ID" \
313
+ --request "$SNAPSHOT_REQUEST_JSON"
314
+ ```
315
+
316
+ The request binds the absolute executable, exact argv, cwd, tool versions,
317
+ verification context, selected source paths, and the fixed Git status mode.
318
+ RunKit stores stdout/stderr bytes and hashes, line counts, HEAD, source
319
+ manifest, and before/after status while excluding `.owlcoda/runkit/**` from
320
+ the observed project status. A target write exits `2` and preserves the
321
+ invalidated snapshot. Raw environment values are not accepted.
322
+
323
+ For `foreign_readonly`, all artifacts remain in the controller project. The
324
+ foreign target must have identical HEAD, selected manifest, and status before
325
+ and after the command.
326
+
327
+ ## Capture visual-smoke evidence
328
+
329
+ Prepare `OwlCodaRunKitVisualSmokeRequestV1`, then run:
330
+
331
+ ```bash
332
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" visual-smoke \
333
+ --workspace "$PROJECT_ROOT" \
334
+ --run-id "$RUN_ID" \
335
+ --request "$VISUAL_SMOKE_REQUEST_JSON"
336
+ ```
337
+
338
+ RunKit launches the exact project-supplied automation runner once. The Core
339
+ does not embed Playwright, CDP, Electron, or Computer Use. The runner writes a
340
+ structured result and output artifacts inside the execution evidence root;
341
+ RunKit verifies viewport and assertion ids, console policy, denied external
342
+ navigation, every artifact hash, and selected source stability. Raw environment
343
+ values are not accepted. The resulting automation snapshot can be passed to
344
+ `finalize` alongside shell snapshots.
345
+
346
+ ## Finalize verification evidence
347
+
348
+ After every required snapshot passed and the DeliveryPacket is still fresh,
349
+ prepare `OwlCodaRunKitFinalizeRequestV1` and run:
350
+
351
+ ```bash
352
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" finalize \
353
+ --workspace "$PROJECT_ROOT" \
354
+ --run-id "$RUN_ID" \
355
+ --request "$FINALIZE_REQUEST_JSON"
356
+ ```
357
+
358
+ `finalize` runs the source gate before accepting command evidence, recomputes
359
+ profile impact, validates output hashes and verification context, appends the
360
+ receipt lineage, and writes the gate input/output. Stale source exits `2`
361
+ without accepting snapshots. Do not hand-author an equivalent receipt when
362
+ this command is available.
363
+
364
+ ## Close an execution
365
+
366
+ Close only after consuming the current stage receipt and making an explicit controller decision:
367
+
368
+ ```bash
369
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" closeout \
370
+ --workspace "$PROJECT_ROOT" \
371
+ --run-id "$RUN_ID" \
372
+ --decision accepted \
373
+ --gate-input "$GATE_INPUT_JSON"
374
+ ```
375
+
376
+ An accepted closeout requires a Contract v0.2 gate for the same run and at
377
+ least one released writer lease. `rejected` and `blocked` may close without a
378
+ passing gate so failed work still leaves durable truth.
379
+
380
+ `accepted`, `rejected`, and `blocked` are record states, not Git or release actions. Never stage, commit, push, publish, deploy, delete, or write a foreign project without separate authority.
381
+
382
+ ## Produce ready-for-commit evidence
383
+
384
+ After an accepted closeout, capture fresh project-root snapshots, prepare
385
+ `OwlCodaRunKitReadyForCommitRequestV1`, then run:
386
+
387
+ ```bash
388
+ node "$SKILL_ROOT/scripts/runkit-contract/runkit-cli.mjs" ready-for-commit \
389
+ --workspace "$PROJECT_ROOT" \
390
+ --run-id "$RUN_ID" \
391
+ --request "$READY_REQUEST_JSON"
392
+ ```
393
+
394
+ The command revalidates the DeliveryPacket, profile impact, gate input,
395
+ accepted closeout, released leases, and selected root manifests. It writes
396
+ `READY_FOR_COMMIT_RECEIPT.json` with every repository action and
397
+ `authorizationGranted` set to false. A ready receipt records state; it does
398
+ not authorize Git.
399
+
400
+ ## Foreign-project shadow
401
+
402
+ Use `snapshot` with `mode=foreign_readonly`. Write all artifacts and scratch in
403
+ the controller project. Any target drift is
404
+ `invalidated_by_target_write`, regardless of verifier success.
405
+
406
+ ## Templates
407
+
408
+ Use files under `assets/templates/` as starting shapes. Preserve project-owned values and remove example placeholders before execution.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "OwlCoda RunKit"
3
+ short_description: "Run receipt-backed project execution with OwlCoda"
4
+ default_prompt: "Use $owlcoda-runkit to initialize or operate a receipt-backed project execution."
@@ -0,0 +1,7 @@
1
+ ## OwlCoda RunKit
2
+
3
+ - Treat `.owlcoda/runkit/` as this project's execution truth, not as product source.
4
+ - Keep one active lease per write scope and never include `.owlcoda/runkit/**` in owned source paths.
5
+ - Do not repeat commands already covered by a valid receipt.
6
+ - Require stage verification before accepting an execution.
7
+ - RunKit configuration does not authorize Git, release, credentials, destructive actions, or foreign-project writes.
@@ -0,0 +1,10 @@
1
+ {
2
+ "schemaVersion": "OwlCodaRunKitConfigV2",
3
+ "core": {
4
+ "contractVersion": "0.2",
5
+ "coreVersion": "0.12.0",
6
+ "coreManifestSha256": "sha256:replace-with-installed-core-manifest",
7
+ "coreSourceRef": "artifact:sha256:replace-with-content-addressed-source"
8
+ },
9
+ "authorizationPolicy": "external_explicit_authority_required"
10
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "schemaVersion": "OwlCodaRunKitCoverageAdoptRequestV1",
3
+ "coverageId": "replace-with-coverage-id",
4
+ "sources": [
5
+ {
6
+ "gateInputPath": ".owlcoda/runkit/executions/replace-with-source-run/verification-receipts/replace-with-receipt/verification-gate-input.json",
7
+ "gateInputSha256": "replace-with-lowercase-sha256",
8
+ "commandBindings": [
9
+ {
10
+ "receiptCommandId": "replace-with-receipt-command-id",
11
+ "profileId": "replace-with-profile-id",
12
+ "commandId": "replace-with-profile-command-id"
13
+ }
14
+ ],
15
+ "dependencyBindings": [
16
+ {
17
+ "dependencyId": "root-lockfile",
18
+ "source": {
19
+ "kind": "lockfile",
20
+ "identity": "package-lock.json"
21
+ }
22
+ }
23
+ ]
24
+ }
25
+ ]
26
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "schemaVersion": "ExecutionDeliveryPacketV1",
3
+ "changedFiles": {
4
+ "wholeFileSha256": {
5
+ "src/example.ts": "replace-with-64-hex-sha256"
6
+ }
7
+ },
8
+ "sourceFingerprint": {
9
+ "sha256": "replace-with-canonical-source-fingerprint"
10
+ },
11
+ "commands": [],
12
+ "repositoryActions": []
13
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "schemaVersion": "OwlCodaRunKitFinalizeRequestV1",
3
+ "receiptId": "replace-with-stable-receipt-id",
4
+ "deliveryPacketPath": ".owlcoda/runkit/executions/replace-with-run-id/delivery-packets/replace-with-packet.json",
5
+ "verificationContext": {
6
+ "schemaVersion": "OwlCodaRunKitVerificationContextV1",
7
+ "reusePolicy": "portable",
8
+ "platform": null,
9
+ "toolchains": [],
10
+ "lockfiles": [],
11
+ "fixtures": [],
12
+ "services": [],
13
+ "environment": []
14
+ },
15
+ "snapshotPaths": [
16
+ ".owlcoda/runkit/executions/replace-with-run-id/snapshots/replace-with-snapshot.json"
17
+ ]
18
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "schemaVersion": "OwlCodaRunKitGoalContractV1",
3
+ "objective": "Replace with one measurable project outcome.",
4
+ "nonGoals": [],
5
+ "authorization": {
6
+ "git": false,
7
+ "publish": false,
8
+ "deploy": false,
9
+ "destructive": false
10
+ }
11
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "schemaVersion": "OwlCodaRunKitProfilesV1",
3
+ "profiles": [
4
+ {
5
+ "id": "focused",
6
+ "paths": ["src/**"]
7
+ }
8
+ ]
9
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "schemaVersion": "OwlCodaRunKitReadyForCommitRequestV1",
3
+ "deliveryPacketPath": ".owlcoda/runkit/executions/replace-with-run-id/delivery-packets/replace-with-packet.json",
4
+ "verificationGateInputPath": ".owlcoda/runkit/executions/replace-with-run-id/verification-receipts/replace-with-receipt/verification-gate-input.json",
5
+ "roots": [
6
+ {
7
+ "role": "candidate",
8
+ "snapshotPath": ".owlcoda/runkit/executions/replace-with-run-id/snapshots/replace-with-root-snapshot.json"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,56 @@
1
+ {
2
+ "schemaVersion": "OwlCodaRunKitResourcePreflightRequestV1",
3
+ "preflightId": "resource-preflight-001",
4
+ "verificationPlanPath": ".owlcoda/runkit/executions/replace-run-id/verification-plans/replace-plan-id.json",
5
+ "verificationPlanSha256": "replace-with-lowercase-sha256",
6
+ "policy": {
7
+ "gateMode": "model_required",
8
+ "maxObservationAgeMs": 300000,
9
+ "unknownHandling": {
10
+ "availability": "fail_closed",
11
+ "quota": "fail_closed",
12
+ "resetTime": "fail_open",
13
+ "pricing": "fail_closed"
14
+ },
15
+ "limits": {
16
+ "maxCalls": 100,
17
+ "maxTotalTokens": 1000000,
18
+ "maxElapsedMs": 3600000,
19
+ "maxCostUsd": 10
20
+ }
21
+ },
22
+ "observations": [
23
+ {
24
+ "providerId": "replace-provider",
25
+ "modelId": "replace-model",
26
+ "adapter": {
27
+ "id": "owlcoda-model-resource-adapter",
28
+ "kind": "owlcoda_runtime",
29
+ "evidenceRef": "artifact:sha256:replace-with-source-reference",
30
+ "evidenceSha256": "replace-with-lowercase-sha256",
31
+ "observedAt": "2026-01-01T00:00:00.000Z"
32
+ },
33
+ "availability": {
34
+ "status": "unknown",
35
+ "reason": "adapter_has_no_verified_live_probe"
36
+ },
37
+ "quota": {
38
+ "remainingCalls": { "status": "unknown", "reason": "provider_not_exposed" },
39
+ "remainingTokens": { "status": "unknown", "reason": "provider_not_exposed" },
40
+ "resetAt": { "status": "unknown", "reason": "provider_not_exposed" }
41
+ },
42
+ "pricing": { "status": "unknown", "reason": "project_pricing_not_declared" }
43
+ }
44
+ ],
45
+ "workloads": [
46
+ {
47
+ "id": "replace-model-workload",
48
+ "providerId": "replace-provider",
49
+ "modelId": "replace-model",
50
+ "calls": 1,
51
+ "inputTokens": 0,
52
+ "outputTokens": 0,
53
+ "elapsedMs": 0
54
+ }
55
+ ]
56
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "schemaVersion": "OwlCodaRunKitResumeRequestV1",
3
+ "resumeId": "replace-with-resume-id",
4
+ "continuationRunId": "replace-with-new-run-id-or-null-for-active-source",
5
+ "reason": "replace-with-explicit-resume-reason",
6
+ "coverage": {
7
+ "coverageId": "replace-with-coverage-id",
8
+ "sources": []
9
+ }
10
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "schemaVersion": "OwlCodaRunKitSnapshotRequestV1",
3
+ "snapshotId": "replace-with-stable-snapshot-id",
4
+ "mode": "project",
5
+ "targetRoot": "replace-with-absolute-project-root",
6
+ "cwd": ".",
7
+ "executable": "replace-with-absolute-executable-path",
8
+ "argv": ["replace-with-exact-argument"],
9
+ "launcherVersion": "replace-with-launcher-version",
10
+ "toolVersions": [{ "name": "replace-with-tool-name", "version": "replace-with-tool-version" }],
11
+ "selectedPaths": ["replace-with-product-source-path"],
12
+ "statusMode": "porcelain-v1-z-untracked-all-runkit-excluded",
13
+ "verificationContext": {
14
+ "schemaVersion": "OwlCodaRunKitVerificationContextV1",
15
+ "reusePolicy": "portable",
16
+ "platform": null,
17
+ "toolchains": [],
18
+ "lockfiles": [],
19
+ "fixtures": [],
20
+ "services": [],
21
+ "environment": []
22
+ }
23
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "schemaVersion": "OwlCodaRunKitVerificationContextV1",
3
+ "reusePolicy": "portable",
4
+ "platform": null,
5
+ "toolchains": [
6
+ {
7
+ "name": "node",
8
+ "version": "replace-with-exact-version"
9
+ }
10
+ ],
11
+ "lockfiles": [],
12
+ "fixtures": [],
13
+ "services": [],
14
+ "environment": []
15
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "schemaVersion": "OwlCodaRunKitVerificationReceiptV2",
3
+ "runId": "replace-with-run-id",
4
+ "receiptId": "replace-with-stable-receipt-id",
5
+ "status": "ready_for_verification",
6
+ "sourceFingerprint": "replace-with-canonical-source-fingerprint",
7
+ "verificationContextFingerprint": "replace-with-verification-context-fingerprint",
8
+ "selectedProfileIds": ["focused"],
9
+ "commandRuns": 0,
10
+ "commandReceipts": []
11
+ }