mimetic-cli 0.1.1 → 0.1.3

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 (50) hide show
  1. package/AGENTS.md +66 -0
  2. package/CONTRIBUTING.md +39 -0
  3. package/README.md +5 -0
  4. package/SECURITY.md +34 -0
  5. package/dist/core/git-state.d.ts +31 -0
  6. package/dist/core/git-state.js +142 -0
  7. package/dist/core/git-state.js.map +1 -0
  8. package/dist/core/index.d.ts +4 -0
  9. package/dist/core/index.js +3 -0
  10. package/dist/core/index.js.map +1 -0
  11. package/dist/core/run-primitives.d.ts +66 -0
  12. package/dist/core/run-primitives.js +120 -0
  13. package/dist/core/run-primitives.js.map +1 -0
  14. package/dist/observer-assets.js +1663 -2180
  15. package/dist/observer-assets.js.map +1 -1
  16. package/dist/observer-data.d.ts +1 -1
  17. package/dist/observer-data.js +5 -1
  18. package/dist/observer-data.js.map +1 -1
  19. package/dist/observer.js +8 -61
  20. package/dist/observer.js.map +1 -1
  21. package/dist/oss-meta-lab.d.ts +50 -0
  22. package/dist/oss-meta-lab.js +454 -27
  23. package/dist/oss-meta-lab.js.map +1 -1
  24. package/dist/program.d.ts +6 -0
  25. package/dist/program.js +75 -8
  26. package/dist/program.js.map +1 -1
  27. package/dist/run.d.ts +19 -6
  28. package/dist/run.js +1263 -9
  29. package/dist/run.js.map +1 -1
  30. package/docs/architecture/github-feedback-loop.md +189 -0
  31. package/docs/architecture/local-codex-tui-actor.md +210 -0
  32. package/docs/architecture/observer.md +109 -0
  33. package/docs/architecture/oss-lab-poc.md +170 -0
  34. package/docs/architecture/project-layout.md +132 -0
  35. package/docs/assets/mimetic-oss-lab-observer.png +0 -0
  36. package/docs/contracts/adapter-fixtures.md +80 -0
  37. package/docs/contracts/core.md +71 -0
  38. package/docs/contracts/feedback.md +131 -0
  39. package/docs/contracts/policy.md +273 -0
  40. package/docs/contracts/run-bundle.md +110 -0
  41. package/docs/contracts/schemas.md +511 -0
  42. package/docs/goals/current.md +163 -0
  43. package/docs/principles/self-driving-harness.md +129 -0
  44. package/docs/product/open-source-install-experience.md +138 -0
  45. package/docs/ramp/README.md +167 -0
  46. package/docs/release/open-source-readiness.md +171 -0
  47. package/docs/release/public-readiness-standard.md +205 -0
  48. package/docs/roadmap/world-class-open-source-v0.md +286 -0
  49. package/package.json +14 -2
  50. package/skills/mimetic-cli/SKILL.md +1 -1
@@ -0,0 +1,273 @@
1
+ # Policy Contract
2
+
3
+ Date: 2026-06-02
4
+
5
+ Status: v0 draft contract for credential, network, spend, redaction, and
6
+ assisted-run boundaries.
7
+
8
+ ## Purpose
9
+
10
+ Policy defines what a run may access, what it may persist, and what it may
11
+ promote into public feedback. It keeps the public CLI useful without requiring
12
+ private infrastructure, maintainer GitHub credentials, provider account access,
13
+ or real product data.
14
+
15
+ Policy records env var names, capability classes, decisions, and redaction
16
+ status. It never records credential values.
17
+
18
+ ## Boundary Principles
19
+
20
+ - Credential classes are separate; access to one class does not imply access to
21
+ another.
22
+ - Dry-run and smoke proof should work with no provider spend.
23
+ - Network and provider spend require explicit opt-in.
24
+ - Public feedback requires redaction status `passed`.
25
+ - Assisted runs are useful evidence, but they are non-comparable to autonomous
26
+ runs unless the assistance is modeled as an explicit actor event.
27
+ - Maintainer GitHub credentials are not required for the public CLI feedback
28
+ path.
29
+
30
+ ## Credential Classes
31
+
32
+ | Class | Examples | May Be Recorded | Must Not Be Recorded |
33
+ | --- | --- | --- | --- |
34
+ | Executor auth | local Codex login, local shell authority, E2B desktop token, browser automation session | class name, env var name, present/missing status, authority level | tokens, cookies, session ids, raw home config, private command history |
35
+ | Product auth | target app test account, synthetic browser state, local fixture login | synthetic fixture id, auth state class, redaction status | real emails, passwords, customer accounts, patient accounts, production cookies |
36
+ | Provider auth | model provider key, desktop provider key, package registry token | env var name, provider class, present/missing status, spend policy | API key values, auth-bearing stream URLs, billing account identifiers |
37
+ | Maintainer auth | GitHub token, npm publish authority, repository admin rights | required/not-required, requested authority, explicit maintainer approval status | tokens, OAuth payloads, private org metadata, mutation authority by implication |
38
+
39
+ Synthetic fixture:
40
+
41
+ ```yaml
42
+ schema: mimetic.policy.v1
43
+ kind: credentials
44
+ credentials:
45
+ executor:
46
+ required: false
47
+ envNames: []
48
+ valuesPersisted: false
49
+ product:
50
+ required: false
51
+ fixture: synthetic-login-state
52
+ valuesPersisted: false
53
+ provider:
54
+ required: false
55
+ envNames:
56
+ - OPENAI_API_KEY
57
+ - E2B_API_KEY
58
+ availability: names_only
59
+ valuesPersisted: false
60
+ maintainer:
61
+ required: false
62
+ githubMutation: disabled
63
+ valuesPersisted: false
64
+ ```
65
+
66
+ ## Network Policy
67
+
68
+ Network policy describes where a run may connect. It is not a hidden allowlist
69
+ for credentials.
70
+
71
+ | Mode | Meaning | Default For |
72
+ | --- | --- | --- |
73
+ | `no_network` | No external network calls. | contract docs, local unit tests |
74
+ | `local_only` | Localhost and loopback only. | Observer, local fixtures |
75
+ | `public_oss` | Public GitHub clone/fetch of owner/repo slugs only. | disposable OSS smoke |
76
+ | `provider_substrate` | Explicit provider substrate such as hosted desktop streams. | live OSS lab with keys |
77
+ | `custom_allowlist` | Adapter-declared public hosts. | target-specific adapters |
78
+
79
+ Synthetic fixture:
80
+
81
+ ```yaml
82
+ schema: mimetic.policy.v1
83
+ kind: network
84
+ mode: public_oss
85
+ allowedHosts:
86
+ - github.com
87
+ allowedRepoSlugs:
88
+ - developit/mitt
89
+ denied:
90
+ - private remotes
91
+ - SSH remotes
92
+ - auth-bearing URLs
93
+ - target repo mutation
94
+ ```
95
+
96
+ ## Spend Policy
97
+
98
+ Spend policy names when provider costs may be incurred.
99
+
100
+ | Mode | Meaning |
101
+ | --- | --- |
102
+ | `no_spend` | No provider calls that can bill. |
103
+ | `dry_run_only` | Only local contract proof; no live substrate. |
104
+ | `explicit_live_provider` | Provider calls allowed because required env var names are present and operator intent is explicit. |
105
+ | `maintainer_approved` | Reserved for publish, billing, or high-risk mutation workflows. |
106
+
107
+ Synthetic fixture:
108
+
109
+ ```yaml
110
+ schema: mimetic.policy.v1
111
+ kind: spend
112
+ mode: explicit_live_provider
113
+ providerClasses:
114
+ - model
115
+ - desktop_substrate
116
+ operatorIntent:
117
+ command: mimetic lab oss --json --no-open
118
+ explicit: true
119
+ budget:
120
+ limit: unspecified
121
+ note: Operator-provided keys were present; values were not recorded.
122
+ ```
123
+
124
+ ## Redaction Policy
125
+
126
+ Redaction gates public output. A run may keep ignored local artifacts for
127
+ operator inspection, but public feedback cannot promote them unless the
128
+ redaction result is `passed`.
129
+
130
+ Required redaction gates:
131
+
132
+ - run bundle verification;
133
+ - Observer public-safety note;
134
+ - feedback draft creation;
135
+ - issue Markdown or issue URL rendering;
136
+ - PR or issue comments that summarize local live evidence.
137
+
138
+ Synthetic fixture:
139
+
140
+ ```yaml
141
+ schema: mimetic.policy.v1
142
+ kind: redaction
143
+ status: passed
144
+ deny:
145
+ - pii
146
+ - phi
147
+ - secrets
148
+ - tokens
149
+ - raw_private_transcripts
150
+ - private_screenshots
151
+ - auth-bearing URLs
152
+ allow:
153
+ - synthetic_personas
154
+ - synthetic_fixtures
155
+ - env_var_names
156
+ - local ignored artifact paths
157
+ promotion:
158
+ publicFeedbackAllowed: true
159
+ ```
160
+
161
+ If redaction is `failed` or `unknown`, the public CLI must fail closed and tell
162
+ the operator which class of material blocked promotion without printing the
163
+ material itself.
164
+
165
+ ## GitHub Authority
166
+
167
+ The default public CLI does not need a GitHub token.
168
+
169
+ Allowed by default:
170
+
171
+ - render local feedback drafts;
172
+ - print public-safe issue Markdown;
173
+ - print prefilled issue URLs;
174
+ - include exact proof commands;
175
+ - include redacted local artifact pointers.
176
+
177
+ Not allowed by default:
178
+
179
+ - create issues through the GitHub API;
180
+ - update Projects;
181
+ - resolve review threads;
182
+ - merge PRs;
183
+ - publish packages;
184
+ - use maintainer tokens from the environment.
185
+
186
+ Maintainer automation can be built later as a separate, token-explicit,
187
+ dry-run-first tool. It must not be required for ordinary Mimetic feedback.
188
+
189
+ Synthetic fixture:
190
+
191
+ ```yaml
192
+ schema: mimetic.policy.v1
193
+ kind: maintainer-authority
194
+ github:
195
+ publicCliRequiresToken: false
196
+ defaultAction: print_issue_draft
197
+ apiMutation: disabled
198
+ tokenValuePersisted: false
199
+ ```
200
+
201
+ ## Assisted Runs
202
+
203
+ An assisted run is any run where a human or outside tool performs work that the
204
+ declared actor could not perform autonomously inside the declared substrate.
205
+
206
+ Examples:
207
+
208
+ - human manually logs in to a target account;
209
+ - human edits the target repo during the run;
210
+ - human copies hidden browser state into a fixture;
211
+ - human clicks through product UI while the actor only observes;
212
+ - operator restarts a provider substrate lane and continues the same run;
213
+ - support staff or private upstream context resolves the blocker.
214
+
215
+ Assisted runs can produce useful observations, but they are non-comparable to
216
+ autonomous baselines. They must not be used as green regression proof unless the
217
+ assistance is explicitly modeled as an actor event and the review says what was
218
+ assisted.
219
+
220
+ Synthetic fixture:
221
+
222
+ ```yaml
223
+ schema: mimetic.policy.v1
224
+ kind: run-comparability
225
+ assistance:
226
+ status: assisted
227
+ comparableToAutonomousBaseline: false
228
+ reason: Human supplied setup that the actor could not perform.
229
+ review:
230
+ verdictAllowed: blocked
231
+ publicFeedbackAllowed: true
232
+ notes: Assisted observation may become a spec issue, not a green proof.
233
+ ```
234
+
235
+ ## Policy Decision Envelope
236
+
237
+ Policy checks should produce small, public-safe decisions that can be copied
238
+ into run bundles, reviews, or feedback drafts.
239
+
240
+ ```yaml
241
+ schema: mimetic.policy-decision.v1
242
+ ok: true
243
+ checkedAt: "2026-06-02T10:00:00.000Z"
244
+ policies:
245
+ credentials:
246
+ ok: true
247
+ message: Required env var names are documented; values were not persisted.
248
+ network:
249
+ ok: true
250
+ message: Public OSS clone mode only.
251
+ spend:
252
+ ok: true
253
+ message: No provider spend in dry-run proof.
254
+ redaction:
255
+ ok: true
256
+ message: Redaction passed before feedback promotion.
257
+ comparability:
258
+ ok: true
259
+ message: Run is autonomous and comparable to dry-run baseline.
260
+ ```
261
+
262
+ ## Stop Conditions
263
+
264
+ Stop before public promotion when:
265
+
266
+ - a credential value appears in a prompt, artifact, issue, or PR body;
267
+ - a stream URL includes auth material;
268
+ - redaction is not `passed`;
269
+ - a run used human assistance but is being treated as autonomous proof;
270
+ - maintainer GitHub credentials would be required for the default public path;
271
+ - provider spend is implied but not explicit;
272
+ - network access exceeds the declared mode;
273
+ - a fixture requires real personal, customer, patient, or private source data.
@@ -0,0 +1,110 @@
1
+ # Run Bundle Contract
2
+
3
+ Date: 2026-06-02
4
+
5
+ Status: v0 draft contract for bundle identity, layout, source state, history,
6
+ lifecycle, and timing primitives.
7
+
8
+ ## Purpose
9
+
10
+ A run bundle is the durable evidence packet for one harness run. It should be
11
+ reviewable by a person, parseable by a tool, and safe to use as the source for
12
+ feedback drafts and future public issues.
13
+
14
+ ## Minimum Bundle Shape
15
+
16
+ ```yaml
17
+ schema: mimetic.run-bundle.v1
18
+ runId: "<core run id>"
19
+ mode: "dry-run|live"
20
+ simCount: 1
21
+ createdAt: "<ISO timestamp>"
22
+ cwd: "<local cwd; public issue drafts must not copy this>"
23
+ artifactRoot: ".mimetic/runs/<run-id>"
24
+ source:
25
+ packageName: "<public package name or null>"
26
+ mimeticSource: "present|missing"
27
+ git:
28
+ schema: mimetic.git-state.v1
29
+ status: "clean|dirty|missing|unavailable"
30
+ capturedAt: "<ISO timestamp>"
31
+ head:
32
+ shortSha: "<short sha or null>"
33
+ refState: "attached|detached|unborn|unknown"
34
+ changes:
35
+ staged: 0
36
+ unstaged: 0
37
+ untracked: 0
38
+ total: 0
39
+ note: "<public-safe note>"
40
+ lifecycle:
41
+ - at: "<ISO timestamp>"
42
+ event: "run.created"
43
+ message: "<public-safe message>"
44
+ artifacts:
45
+ run: "run.json"
46
+ reviewJson: "review.json"
47
+ reviewMarkdown: "review.md"
48
+ observerData: "observer/observer-data.json"
49
+ events: "events.ndjson"
50
+ review:
51
+ schema: mimetic.review.v1
52
+ verdict: "contract_proof_only|pass|fail|blocked|timed_out"
53
+ ```
54
+
55
+ ## Relative Artifact Layout
56
+
57
+ For run id `example-2026-06-02t10-00-00-000z-proof`, the core layout is:
58
+
59
+ ```text
60
+ .mimetic/runs/example-2026-06-02t10-00-00-000z-proof/run.json
61
+ .mimetic/runs/example-2026-06-02t10-00-00-000z-proof/review.json
62
+ .mimetic/runs/example-2026-06-02t10-00-00-000z-proof/review.md
63
+ .mimetic/runs/example-2026-06-02t10-00-00-000z-proof/observer/observer-data.json
64
+ .mimetic/runs/example-2026-06-02t10-00-00-000z-proof/events.ndjson
65
+ .mimetic/runs/latest.json
66
+ ```
67
+
68
+ Absolute paths, traversal segments, remotes, hosted logs, and private artifact
69
+ URLs are not part of the core layout.
70
+
71
+ ## Latest And History
72
+
73
+ The latest pointer is a small local index:
74
+
75
+ ```yaml
76
+ schema: mimetic.latest-run.v1
77
+ runId: "<run-id>"
78
+ path: ".mimetic/runs/<run-id>"
79
+ updatedAt: "<ISO timestamp>"
80
+ ```
81
+
82
+ History entries use:
83
+
84
+ ```yaml
85
+ schema: mimetic.run-history-entry.v1
86
+ runId: "<run-id>"
87
+ createdAt: "<ISO timestamp>"
88
+ mode: "dry-run|live"
89
+ path: ".mimetic/runs/<run-id>"
90
+ ```
91
+
92
+ The latest pointer may move. Run bundle directories should not.
93
+
94
+ ## Contract Fixture Proof
95
+
96
+ The core fixture proves:
97
+
98
+ - deterministic run ids from explicit inputs;
99
+ - stable relative artifact paths;
100
+ - latest/history/lifecycle/timing records;
101
+ - git status counts without branch names, remotes, file names, file paths, or
102
+ absolute directories;
103
+ - no environment-specific nouns in `src/core`.
104
+
105
+ Proof commands:
106
+
107
+ ```bash
108
+ pnpm test
109
+ pnpm typecheck
110
+ ```