mimetic-cli 0.1.2 → 0.1.4

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 +4 -1
  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,129 @@
1
+ # Self-Driving Harness Principles
2
+
3
+ Date: 2026-06-01
4
+
5
+ Status: initial repo doctrine for `mimetic-cli`.
6
+
7
+ ## Thesis
8
+
9
+ `mimetic-cli` should be a closed-loop product simulation system, not just a
10
+ CLI that launches agents.
11
+
12
+ The operating loop is:
13
+
14
+ ```text
15
+ persona scenario run
16
+ -> durable evidence bundle
17
+ -> review and verification
18
+ -> structured feedback
19
+ -> GitHub issue or project queue
20
+ -> scoped implementation
21
+ -> rerun and compare
22
+ ```
23
+
24
+ The hard part is not getting an agent to do something. The hard part is making
25
+ the result verifiable, repeatable, safe to file, and useful to the next
26
+ agent with no chat context.
27
+
28
+ ## Public Boundary
29
+
30
+ This repo must be designed as if it will become public.
31
+
32
+ No PII, PHI, secrets, keys, tokens, raw private transcripts, real patient data,
33
+ real customer data, or private product artifacts belong here. Examples,
34
+ fixtures, screenshots, personas, run bundles, issue bodies, and docs must be
35
+ synthetic or redacted.
36
+
37
+ ## Principles
38
+
39
+ ### 1. Model, Harness, Environment
40
+
41
+ Reliable agentic work is the composition of model, harness, and environment.
42
+ `mimetic-cli` owns the harness layer: replay, invariants, observability,
43
+ policy, artifacts, review, and feedback routing.
44
+
45
+ ### 2. Verifiability Defines Throughput
46
+
47
+ Autonomy stalls when outcomes cannot be classified as red, yellow, or green.
48
+ Every claim a run makes should point to retrievable evidence: bundle files,
49
+ screenshots, terminal transcripts, state proofs, event streams, review packets,
50
+ or issue links.
51
+
52
+ ### 3. Run Bundles Are Source Of Truth
53
+
54
+ The observer is a projection. The GitHub Project is a cockpit. The issue queue
55
+ is a work surface. The run bundle is the canonical evidence record.
56
+
57
+ ### 4. Coverage Is The Product
58
+
59
+ Serious adapters need discovery maps and coverage matrices. Hidden
60
+ undercoverage is worse than visible gaps. A partial matrix with named gaps is
61
+ more useful than three green happy paths pretending to prove the whole product.
62
+
63
+ ### 5. Product Trial Beats Tracker Truth
64
+
65
+ Tracker fields, issue comments, PR summaries, and author receipts are not
66
+ acceptance. A product claim needs a product trial or a precise explanation of
67
+ why the run is only contract proof.
68
+
69
+ ### 6. Staged Autonomy Beats Binary Replacement
70
+
71
+ Authority should progress through stages:
72
+
73
+ ```text
74
+ observe -> draft feedback -> draft issue -> draft spec -> draft PR -> steward PR -> release assist
75
+ ```
76
+
77
+ Each stage requires stricter proof, narrower write scope, and clearer stop
78
+ conditions.
79
+
80
+ ### 7. Idempotent Closed Loops Beat Heroic Retries
81
+
82
+ Every run and feedback issue-draft path needs idempotency keys, duplicate
83
+ prevention, explicit terminal states, cleanup proof, and safe re-run behavior.
84
+ Retries without loop closure create queue debt.
85
+
86
+ ### 8. Feedback Is A First-Class Artifact
87
+
88
+ Friction found by a persona or agent should not be buried in prose. It should
89
+ be structured, evidence-linked, dedupable, public-safe, and reviewable. For an
90
+ open-source CLI, the default output should be an issue draft and filing
91
+ instructions, not live GitHub mutation.
92
+
93
+ ### 9. Product Nouns Belong In Adapters
94
+
95
+ Core owns schema, lifecycle, actors, substrates, evidence streams, history,
96
+ review, verification, redaction, and feedback mechanics. Adapters own product
97
+ routes, personas, app topology, milestones, vocabulary, environment allowlists,
98
+ and product-specific proof.
99
+
100
+ ### 10. Credential Boundaries Are Architecture
101
+
102
+ Executor auth, product auth, provider auth, spend policy, network policy, and
103
+ repo/GitHub authority are separate boundaries. A run must name what was
104
+ available and prove that sensitive values were not persisted.
105
+
106
+ ### 11. Dry-Run Is Contract Proof
107
+
108
+ Dry-run proves scenario selection, bundle shape, review generation, and CLI
109
+ semantics. It does not prove product behavior. Review output must preserve that
110
+ distinction.
111
+
112
+ ### 12. Green Requires Reviewer Acceptance
113
+
114
+ The builder of a harness is not the final judge of the harness. `review` can
115
+ summarize, `verify` can validate contracts, but acceptance requires a reviewer
116
+ or reviewer-like gate that checks coverage, evidence, and product relevance.
117
+
118
+ ## Anti-Patterns
119
+
120
+ - Treating the best model as a substitute for harness quality.
121
+ - Using screenshots as vibes without state or transcript evidence.
122
+ - Letting product-specific nouns leak into generic core.
123
+ - Generating GitHub issue drafts from vague summaries without bundle links.
124
+ - Closing issues because a PR exists, not because product proof exists.
125
+ - Giving autonomous agents broad write authority before observe/draft stages
126
+ are reliable.
127
+ - Letting project fields become canonical state.
128
+ - Retrying failed issue submission paths until duplicates appear.
129
+ - Storing private data in examples because it was convenient during extraction.
@@ -0,0 +1,138 @@
1
+ # Open-Source Install Experience
2
+
3
+ Date: 2026-06-01
4
+
5
+ Status: product target for the first world-class `mimetic-cli` implementation.
6
+
7
+ ## Product Promise
8
+
9
+ Drop Mimetic into an app and let a coding agent set up realistic persona
10
+ simulations, run them safely, watch them in a polished observer, and turn
11
+ friction into public-safe issue drafts.
12
+
13
+ The first experience should feel like a mature one-command simulation harness,
14
+ but with an open-source-safe package shape:
15
+
16
+ ```bash
17
+ npm i -D mimetic-cli
18
+ npx mimetic init
19
+ npm run mimetic:doctor
20
+ npm run mimetic:watch
21
+ npm run mimetic:verify
22
+ npx mimetic feedback issue --run latest --repo example/app --format markdown
23
+ ```
24
+
25
+ ## Two-Part Distribution
26
+
27
+ ### NPM Package
28
+
29
+ The npm package owns executable behavior:
30
+
31
+ - binary: `mimetic`;
32
+ - CLI framework: `commander`;
33
+ - commands: `init`, `doctor`, `run`, `watch`, `review`, `verify`,
34
+ `feedback`;
35
+ - schemas and validators;
36
+ - synthetic starter templates;
37
+ - observer static assets;
38
+ - artifact and run-bundle utilities;
39
+ - redaction and public issue-draft generation.
40
+
41
+ ### Agent Skill
42
+
43
+ The agent skill owns installation guidance and repo adaptation:
44
+
45
+ ```bash
46
+ npx skills add danielgwilson/mimetic-cli --skill mimetic-cli
47
+ ```
48
+
49
+ Installable repo skill: [`skills/mimetic-cli/SKILL.md`](../../skills/mimetic-cli/SKILL.md).
50
+
51
+ The skill should teach the user's coding agent how to:
52
+
53
+ - install `mimetic-cli`;
54
+ - run `mimetic init`;
55
+ - inspect the target app's routes and dev command;
56
+ - create synthetic personas and scenarios;
57
+ - configure local app targets;
58
+ - document E2B and OpenAI env var names without storing values;
59
+ - run `doctor`, `watch`, `verify`, and `feedback issue`;
60
+ - avoid PII, PHI, secrets, real customer data, and private artifacts.
61
+
62
+ The skill should not hide critical behavior in chat memory. It should point to
63
+ repo-owned `mimetic/` files and package-owned docs.
64
+
65
+ ## First-Run Principles
66
+
67
+ - No keys required for the first wow moment.
68
+ - No live GitHub mutation.
69
+ - No hosted queues or private infrastructure.
70
+ - No real customer/user/patient data.
71
+ - No generated personas from tickets, logs, transcripts, screenshots, or
72
+ production analytics.
73
+ - Safe dry-run should produce a valid synthetic run bundle and observer view.
74
+ - The user should see what changed in git.
75
+
76
+ ## `mimetic init`
77
+
78
+ `mimetic init` should:
79
+
80
+ 1. Detect package manager and app framework when possible.
81
+ 2. Create committed starter files under `mimetic/`.
82
+ 3. Create ignored runtime state under `.mimetic/`.
83
+ 4. Add `.mimetic/` and secret/local overlays to `.gitignore`.
84
+ 5. Patch `package.json` scripts only after showing the intended diff or when
85
+ `--yes` is passed.
86
+ 6. Create only synthetic public-safe personas and scenarios.
87
+ 7. Write credential references as env var names only.
88
+ 8. Run a dry-run verification if dependencies are available.
89
+
90
+ Suggested scripts:
91
+
92
+ ```json
93
+ {
94
+ "scripts": {
95
+ "mimetic": "mimetic",
96
+ "mimetic:doctor": "mimetic doctor",
97
+ "mimetic:run": "mimetic run --dry-run",
98
+ "mimetic:watch": "mimetic watch",
99
+ "mimetic:watch:ci": "mimetic watch --json --no-open",
100
+ "mimetic:verify": "mimetic verify"
101
+ }
102
+ }
103
+ ```
104
+
105
+ ## Command Ladder
106
+
107
+ | Command | Purpose | First version should |
108
+ | --- | --- | --- |
109
+ | `mimetic init` | Set up project-owned harness files | Scaffold committed `mimetic/`, ignored `.mimetic/`, package scripts |
110
+ | `mimetic doctor` | Explain readiness | Check config, gitignore, app target, browser, env var names, redaction policy |
111
+ | `mimetic run --dry-run` | Prove contract without app/browser/keys | Write synthetic run bundle |
112
+ | `mimetic verify` | Validate bundle and public-safety gates | Fail closed on schema/evidence/redaction errors |
113
+ | `mimetic review` | Build review packet from evidence | Summarize verdicts without inventing product proof |
114
+ | `mimetic watch` | Run sims and watch the observer | Create a fresh four-lane bundle, render Observer, open it, and keep the shell attached |
115
+ | `mimetic watch --json --no-open` | Agent/CI proof path | Create the same bundle and Observer artifacts without browser open or attached watch server |
116
+ | `mimetic lab oss` | Watch public OSS meta-sims | Open the Observer-of-Observers with headed desktop lanes assigned by `--repos` |
117
+ | `mimetic lab oss-smoke` | Try Mimetic on disposable public OSS clones | Shallow clone lightweight GitHub repos, run setup/proof/verify, report, and remove clones |
118
+ | `mimetic feedback issue` | Produce public-safe issue draft | Print Markdown or prefilled issue URL, no GitHub API mutation |
119
+
120
+ ## Live Capability Ladder
121
+
122
+ Live execution should be staged after the dry-run path is boring:
123
+
124
+ 1. Synthetic dry-run bundle.
125
+ 2. Local app reachability and browser smoke.
126
+ 3. Scripted browser scenario.
127
+ 4. Observer over real screenshots/traces.
128
+ 5. Computer-use / OpenAI actor.
129
+ 6. E2B substrate.
130
+ 7. Multi-persona matrix.
131
+ 8. Optional maintainer-only issue sync tooling.
132
+
133
+ Do not make E2B, OpenAI, or GitHub credentials part of the first successful
134
+ run.
135
+
136
+ Live E2B desktop labs are an optional advanced path. Target projects that need
137
+ them should install `@e2b/desktop` explicitly instead of receiving that
138
+ substrate as part of the default Mimetic package install.
@@ -0,0 +1,167 @@
1
+ # Mimetic Ramp
2
+
3
+ Status: public-safe contributor and agent ramp.
4
+
5
+ Use this page when you are starting cold on `mimetic-cli`. It is meant to be
6
+ useful without chat history, private notes, local machine paths, or maintainer
7
+ context.
8
+
9
+ ## First Read
10
+
11
+ Read these in order:
12
+
13
+ 1. [`AGENTS.md`](../../AGENTS.md) for public boundary and engineering rules.
14
+ 2. [`README.md`](../../README.md) for install, commands, and package shape.
15
+ 3. [`docs/goals/current.md`](../goals/current.md) for the active product goal.
16
+ 4. [`docs/product/open-source-install-experience.md`](../product/open-source-install-experience.md) for first-run UX.
17
+ 5. [`docs/roadmap/world-class-open-source-v0.md`](../roadmap/world-class-open-source-v0.md) for staged delivery history and remaining work.
18
+ 6. [`docs/architecture/observer.md`](../architecture/observer.md) for Observer architecture.
19
+ 7. [`docs/contracts/run-bundle.md`](../contracts/run-bundle.md) and [`docs/contracts/policy.md`](../contracts/policy.md) for proof contracts.
20
+ 8. [`docs/release/public-readiness-standard.md`](../release/public-readiness-standard.md) before deciding what must be scrubbed.
21
+ 9. [`docs/release/open-source-readiness.md`](../release/open-source-readiness.md) before touching public packaging or repository visibility.
22
+
23
+ ## Mental Model
24
+
25
+ Mimetic is a persona simulation harness for apps, CLIs, and agent-facing product
26
+ flows.
27
+
28
+ - `mimetic/` is committed source: personas, scenarios, policy, adapters, and
29
+ project intent.
30
+ - `.mimetic/` is ignored runtime state: runs, Observer output, transcripts,
31
+ reviews, temporary clones, and local evidence.
32
+ - A run bundle is the source of truth.
33
+ - The Observer is the projection that makes that truth reviewable.
34
+ - Feedback commands turn verified evidence into public-safe issue drafts.
35
+
36
+ If a change does not improve one of those loops, it probably belongs elsewhere.
37
+
38
+ ## Current State
39
+
40
+ Mimetic has a working public package shape and a safe first-run path:
41
+
42
+ ```bash
43
+ pnpm install --frozen-lockfile
44
+ pnpm release:check
45
+ pnpm mimetic -- watch --json --no-open
46
+ pnpm mimetic -- verify --run latest --json
47
+ ```
48
+
49
+ Implemented:
50
+
51
+ - `commander` CLI with stable command help;
52
+ - `init`, `doctor`, `run`, `watch`, `verify`, `review`, `runs`, and `feedback`;
53
+ - synthetic run bundles;
54
+ - public-safety verification;
55
+ - mission-control Observer over UI, CLI, TUI, and Codex UI stream contracts;
56
+ - public-safe feedback issue drafts without GitHub API mutation;
57
+ - skills.sh-compatible agent skill;
58
+ - experimental public OSS lab and disposable OSS smoke harness.
59
+
60
+ Still not good enough:
61
+
62
+ - live browser/user-journey proof is not yet first-class;
63
+ - live PTY and Codex UI lanes need stronger completion health;
64
+ - OSS lab lanes need automatic nested Observer health readback;
65
+ - the package needs fresh-agent install proof on real disposable public apps;
66
+ - Observer evidence needs real screenshots/traces once browser adapters land.
67
+
68
+ ## First Commands
69
+
70
+ From a clean checkout:
71
+
72
+ ```bash
73
+ git status --short --branch
74
+ pnpm install --frozen-lockfile
75
+ pnpm release:check
76
+ pnpm mimetic -- watch --json --no-open
77
+ pnpm mimetic -- runs --json
78
+ ```
79
+
80
+ For local product feel:
81
+
82
+ ```bash
83
+ pnpm mimetic -- watch
84
+ ```
85
+
86
+ For public OSS dogfood without credentials:
87
+
88
+ ```bash
89
+ pnpm mimetic -- lab oss --dry-run --json --no-open
90
+ pnpm mimetic -- lab oss-smoke --limit 1 --json
91
+ ```
92
+
93
+ ## How To Pick Work
94
+
95
+ Start from [`docs/goals/current.md`](../goals/current.md).
96
+
97
+ Prefer work that makes Mimetic more believable to a new maintainer:
98
+
99
+ - a command becomes easier to run;
100
+ - a run bundle becomes more truthful;
101
+ - Observer evidence becomes more inspectable;
102
+ - verification catches a real bad state;
103
+ - feedback drafts become more actionable;
104
+ - public-safety gates catch a class of leak or stale residue.
105
+
106
+ If no GitHub issue exists for substantial work, draft one with the repo issue
107
+ template before building. Use labels to communicate authority, area, risk, and
108
+ required proof.
109
+
110
+ ## Quality Bar
111
+
112
+ Do not close a change on narrative alone.
113
+
114
+ Useful proof includes:
115
+
116
+ - `pnpm release:check`;
117
+ - focused unit or contract tests;
118
+ - a generated run bundle under ignored `.mimetic/`;
119
+ - Observer screenshots or health output;
120
+ - `mimetic verify` results;
121
+ - public-surface scan output;
122
+ - fresh clone checks for packaging or release work.
123
+
124
+ A green subset is not the same thing as complete coverage. If something is not
125
+ covered, name it as a gap.
126
+
127
+ ## Public Boundary
128
+
129
+ Assume this repository is public even when local or remote visibility says it is
130
+ private.
131
+
132
+ Never commit or paste:
133
+
134
+ - PII or PHI;
135
+ - secrets, keys, tokens, cookies, or raw env files;
136
+ - raw private transcripts;
137
+ - private screenshots;
138
+ - private customer or patient data;
139
+ - local machine paths;
140
+ - private upstream code or operational details.
141
+
142
+ Use synthetic examples, redacted evidence, and env var names without values.
143
+
144
+ ## Embarrassment Filter
145
+
146
+ Before committing, ask:
147
+
148
+ - Would this make sense to someone who found the repo through npm?
149
+ - Would I be comfortable with this file quoted in a public issue?
150
+ - Does this depend on private chat memory?
151
+ - Does it mention removed docs, private machine paths, or internal-only names?
152
+ - Does it claim product proof when it only proves a contract?
153
+
154
+ If the answer is uncomfortable, rewrite it, synthesize it, or keep it out of the
155
+ repo.
156
+
157
+ ## Hand-Off Format
158
+
159
+ End substantial work with:
160
+
161
+ - what changed;
162
+ - what proof passed;
163
+ - what remains uncertain;
164
+ - the next best issue or command.
165
+
166
+ Future agents should be able to continue from the repo, not from the previous
167
+ chat transcript.
@@ -0,0 +1,171 @@
1
+ # Open-Source Release Readiness
2
+
3
+ Date: 2026-06-02
4
+
5
+ Status: public repository candidate after reviewed history cleanup. Actual
6
+ `npm publish` remains a human release action and must not be run by an agent
7
+ without explicit approval in the current context.
8
+
9
+ Use [`docs/release/public-readiness-standard.md`](public-readiness-standard.md)
10
+ as the public-cleanliness policy. The standard distinguishes real blockers such
11
+ as secrets, PHI, private source, private screenshots, and raw credentials from
12
+ acceptable public metadata such as maintainer-approved public commit email.
13
+
14
+ ## Package State
15
+
16
+ - Package name: `mimetic-cli`
17
+ - Version: `0.1.3`
18
+ - Binary: `mimetic`
19
+ - License: MIT
20
+ - Repository: `https://github.com/danielgwilson/mimetic-cli`
21
+ - npm access: public via `publishConfig.access`
22
+ - npm contents: compiled `dist`, public docs directories, including ramp and
23
+ current-goal docs, `skills/`,
24
+ `README.md`, `LICENSE`, `SECURITY.md`, `CONTRIBUTING.md`, and
25
+ `package.json`
26
+ - GitHub Actions publish workflow: `.github/workflows/publish.yml`
27
+ - optional live E2B peer: `@e2b/desktop`
28
+
29
+ `prepack` runs the TypeScript build so a clean checkout can produce a usable
30
+ tarball with `npm pack` or `npm publish`.
31
+
32
+ ## Skill State
33
+
34
+ The installable agent skill lives at:
35
+
36
+ ```text
37
+ skills/mimetic-cli/SKILL.md
38
+ ```
39
+
40
+ This matches skills.sh discovery for `skills/<name>/SKILL.md`. The required
41
+ frontmatter fields are present:
42
+
43
+ ```yaml
44
+ name: mimetic-cli
45
+ description: ...
46
+ ```
47
+
48
+ Verification command:
49
+
50
+ ```bash
51
+ DISABLE_TELEMETRY=1 npx skills add . --list
52
+ ```
53
+
54
+ Expected install command after the repository is public:
55
+
56
+ ```bash
57
+ npx skills add danielgwilson/mimetic-cli --skill mimetic-cli
58
+ ```
59
+
60
+ ## Public Boundary
61
+
62
+ Release work must not include PII, PHI, secrets, keys, tokens, raw private
63
+ transcripts, private screenshots, raw customer data, raw patient data, private
64
+ source snippets, or generated run bundles.
65
+
66
+ Allowed examples are synthetic or redacted only.
67
+
68
+ ## GitHub Visibility Gate
69
+
70
+ The current tree and reachable Git history are the public surface being
71
+ hardened here. The repository must not be made public until these checks pass
72
+ from a fresh clone:
73
+
74
+ - only the intended `main` branch is reachable;
75
+ - no stale release tags point at pre-cleanup source;
76
+ - history scans have no private upstream system names, absolute maintainer paths,
77
+ secret patterns, or generated runtime bundles;
78
+ - reachable commit author and committer emails are GitHub noreply-style
79
+ addresses or explicitly approved public maintainer emails;
80
+ - GitHub issues, PRs, labels, and project fields have been scanned or rewritten
81
+ for public-safe language.
82
+
83
+ GitHub may still retain unreachable object caches or historical Actions logs
84
+ internally. Treat those as residual platform-cache risk and delete old workflow
85
+ runs before public launch if a stricter surface is required.
86
+
87
+ History-check shape used during this audit:
88
+
89
+ ```bash
90
+ git rev-list --all | xargs -n 32 git grep -n -I -i -e '<private-source-name>' -e '<absolute-local-path-marker>' -e '<workspace-path-marker>'
91
+ git rev-list --all | xargs -n 32 git grep -n -I -E 'sk-[A-Za-z0-9_-]{20,}|gh[pousr]_[A-Za-z0-9_]{20,}|github_pat_[A-Za-z0-9_]{20,}|AKIA[0-9A-Z]{16}|BEGIN [A-Z ]*PRIVATE KEY|AIza[0-9A-Za-z_-]{20,}|xox[baprs]-[A-Za-z0-9-]{20,}'
92
+ ```
93
+
94
+ ## Required Gates
95
+
96
+ Run these before any public release candidate:
97
+
98
+ ```bash
99
+ pnpm install --frozen-lockfile
100
+ pnpm check
101
+ pnpm public-surface:scan
102
+ pnpm skill:check
103
+ pnpm pack:dry-run
104
+ git diff --check
105
+ ```
106
+
107
+ `pnpm public-surface:scan` scans tracked files plus the npm dry-run payload,
108
+ including built `dist/` output. It fails on common secret tokens, absolute local
109
+ user paths, local workspace paths, unapproved durable commit email metadata,
110
+ known private upstream system names, and binary public assets that are not
111
+ explicitly allowlisted by SHA-256.
112
+
113
+ ## Tarball Inspection
114
+
115
+ Use:
116
+
117
+ ```bash
118
+ pnpm pack:dry-run
119
+ ```
120
+
121
+ `pnpm pack:dry-run` delegates to `npm pack --dry-run` after `prepack` builds
122
+ `dist`.
123
+
124
+ The tarball must not include `.env*`, `.mimetic/`, generated run bundles,
125
+ private screenshots, raw transcripts, `.npmrc`, tests, fixtures, internal
126
+ operations notes, local runtime caches, or private operator packets. Public
127
+ `docs/ramp/`, `docs/goals/`, and repo-local `AGENTS.md` files are allowed when
128
+ they are synthetic, durable, and public-safe. Public image assets must remain on
129
+ the scanner allowlist and keep their approved checksum.
130
+
131
+ ## Publish Procedure
132
+
133
+ Only after maintainer approval:
134
+
135
+ ```bash
136
+ pnpm release:check && npm publish --access public
137
+ ```
138
+
139
+ No agent should run that command without explicit human approval in the current
140
+ thread. That approval must come from the maintainer responsible for the release.
141
+
142
+ ## Trusted Publishing Setup
143
+
144
+ The npm package page exists. Trusted Publishing should be configured for GitHub
145
+ Actions before cutting the next tag:
146
+
147
+ - provider: GitHub Actions
148
+ - repository owner: `danielgwilson`
149
+ - repository name: `mimetic-cli`
150
+ - workflow filename: `publish.yml`
151
+ - environment: blank
152
+ - registry: npm public registry
153
+
154
+ The workflow uses:
155
+
156
+ - `permissions.id-token: write` for OIDC;
157
+ - `permissions.contents: read`;
158
+ - `actions/checkout@v6`;
159
+ - `actions/setup-node@v6` with Node 24 and npm registry URL;
160
+ - `npm publish --access public`;
161
+ - no long-lived npm token secret.
162
+
163
+ Future automated release flow after trusted publishing is configured:
164
+
165
+ ```bash
166
+ pnpm release:check
167
+ npm version patch -m "Release %s"
168
+ git push origin main --tags
169
+ ```
170
+
171
+ The publish job is tag-gated and only publishes when running on a `v*` tag.