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.
- package/AGENTS.md +66 -0
- package/CONTRIBUTING.md +39 -0
- package/README.md +4 -1
- package/SECURITY.md +34 -0
- package/dist/core/git-state.d.ts +31 -0
- package/dist/core/git-state.js +142 -0
- package/dist/core/git-state.js.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +3 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/run-primitives.d.ts +66 -0
- package/dist/core/run-primitives.js +120 -0
- package/dist/core/run-primitives.js.map +1 -0
- package/dist/observer-assets.js +1663 -2180
- package/dist/observer-assets.js.map +1 -1
- package/dist/observer-data.d.ts +1 -1
- package/dist/observer-data.js +5 -1
- package/dist/observer-data.js.map +1 -1
- package/dist/observer.js +8 -61
- package/dist/observer.js.map +1 -1
- package/dist/oss-meta-lab.d.ts +50 -0
- package/dist/oss-meta-lab.js +454 -27
- package/dist/oss-meta-lab.js.map +1 -1
- package/dist/program.d.ts +6 -0
- package/dist/program.js +75 -8
- package/dist/program.js.map +1 -1
- package/dist/run.d.ts +19 -6
- package/dist/run.js +1263 -9
- package/dist/run.js.map +1 -1
- package/docs/architecture/github-feedback-loop.md +189 -0
- package/docs/architecture/local-codex-tui-actor.md +210 -0
- package/docs/architecture/observer.md +109 -0
- package/docs/architecture/oss-lab-poc.md +170 -0
- package/docs/architecture/project-layout.md +132 -0
- package/docs/assets/mimetic-oss-lab-observer.png +0 -0
- package/docs/contracts/adapter-fixtures.md +80 -0
- package/docs/contracts/core.md +71 -0
- package/docs/contracts/feedback.md +131 -0
- package/docs/contracts/policy.md +273 -0
- package/docs/contracts/run-bundle.md +110 -0
- package/docs/contracts/schemas.md +511 -0
- package/docs/goals/current.md +163 -0
- package/docs/principles/self-driving-harness.md +129 -0
- package/docs/product/open-source-install-experience.md +138 -0
- package/docs/ramp/README.md +167 -0
- package/docs/release/open-source-readiness.md +171 -0
- package/docs/release/public-readiness-standard.md +205 -0
- package/docs/roadmap/world-class-open-source-v0.md +286 -0
- package/package.json +14 -2
- package/skills/mimetic-cli/SKILL.md +1 -1
package/AGENTS.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
Agent instructions for `mimetic-cli`.
|
|
4
|
+
|
|
5
|
+
## Public Boundary
|
|
6
|
+
|
|
7
|
+
Assume this repository is public.
|
|
8
|
+
|
|
9
|
+
Hard rule: never commit, paste, preserve, or generate PII, PHI, secrets, keys,
|
|
10
|
+
tokens, raw private transcripts, private screenshots, private customer data,
|
|
11
|
+
private patient data, or private source snippets.
|
|
12
|
+
|
|
13
|
+
- Use synthetic personas, synthetic emails, synthetic screenshots, and redacted
|
|
14
|
+
proof examples only.
|
|
15
|
+
- Do not copy `.env*`, credential files, hosted logs with identifiers, or
|
|
16
|
+
artifact bundles that may contain sensitive user data.
|
|
17
|
+
- Do not let private upstream context leak into docs, examples, issue
|
|
18
|
+
bodies, fixtures, tests, Observer screenshots, or generated run bundles.
|
|
19
|
+
- If an artifact might contain PII, PHI, credentials, or private operational
|
|
20
|
+
context, summarize the shape and keep the raw artifact outside this repo.
|
|
21
|
+
- Public usefulness beats private convenience. When in doubt, redact,
|
|
22
|
+
synthesize, or stop and ask.
|
|
23
|
+
|
|
24
|
+
## Mission
|
|
25
|
+
|
|
26
|
+
- Build a reusable CLI and harness standard for persona simulation.
|
|
27
|
+
- Keep reusable substrate in core code and product truth in adapters.
|
|
28
|
+
- Make product feedback loops cheap: run manifests, scenario profiles, actor
|
|
29
|
+
traces, Observer views, review packets, and proof artifacts.
|
|
30
|
+
- Treat run bundles as the source of truth and Observer as the projection.
|
|
31
|
+
|
|
32
|
+
## Architecture Principles
|
|
33
|
+
|
|
34
|
+
- Adapter-first, not config sprawl: product-specific apps, ports, env
|
|
35
|
+
allowlists, routes, scenarios, milestones, and review vocabulary belong in
|
|
36
|
+
adapters.
|
|
37
|
+
- Core owns generic primitives: manifests, artifact layout, source packaging,
|
|
38
|
+
actor orchestration, lifecycle events, Observer rendering, run review, and
|
|
39
|
+
history indexing.
|
|
40
|
+
- CLI JSON envelopes must be truthful. Unsupported capabilities fail closed
|
|
41
|
+
with structured errors.
|
|
42
|
+
- Proof artifacts are API surface. Treat paths, schemas, and review packets as
|
|
43
|
+
durable contracts.
|
|
44
|
+
- Prefer fixtures and contract tests over prose claims.
|
|
45
|
+
|
|
46
|
+
## Development Rules
|
|
47
|
+
|
|
48
|
+
- Keep `main` clean. Use scoped branches or worktrees for feature work.
|
|
49
|
+
- Make small commits with explicit scope.
|
|
50
|
+
- Before substantial work, read [`docs/ramp/README.md`](docs/ramp/README.md)
|
|
51
|
+
and [`docs/goals/current.md`](docs/goals/current.md).
|
|
52
|
+
- Do not commit generated proof artifacts, local env files, E2B/runtime caches,
|
|
53
|
+
`.npmrc`, packed tarballs, or provider credentials.
|
|
54
|
+
- Before extracting from any source project, classify the code as core, CLI
|
|
55
|
+
shell, Observer, adapter contract, or example adapter.
|
|
56
|
+
- Before publishing, run the release gates in
|
|
57
|
+
[`docs/release/open-source-readiness.md`](docs/release/open-source-readiness.md).
|
|
58
|
+
|
|
59
|
+
## Acceptance Bar
|
|
60
|
+
|
|
61
|
+
- A change is not done until it has command-level proof.
|
|
62
|
+
- Harness changes need tests or fixture artifacts that prove the contract.
|
|
63
|
+
- Adapter changes need at least one safe dry-run path and one realistic path
|
|
64
|
+
where credentials allow it.
|
|
65
|
+
- End substantial work with what changed, what was checked, and what remains
|
|
66
|
+
uncertain.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for helping make Mimetic better.
|
|
4
|
+
|
|
5
|
+
## Ground Rules
|
|
6
|
+
|
|
7
|
+
- Keep examples synthetic and public-safe.
|
|
8
|
+
- Do not commit `.env*`, `.npmrc`, `.mimetic/`, generated run bundles, provider
|
|
9
|
+
credentials, private screenshots, raw transcripts, or customer data.
|
|
10
|
+
- Prefer small PRs with explicit proof commands.
|
|
11
|
+
- Keep product-specific route names, milestones, and vocabulary in adapters.
|
|
12
|
+
- If a change touches credentials, provider spend, hosted execution, or GitHub
|
|
13
|
+
mutation, document the stop conditions and use dry-run proof first.
|
|
14
|
+
|
|
15
|
+
## Local Setup
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pnpm install
|
|
19
|
+
pnpm check
|
|
20
|
+
pnpm public-surface:scan
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Useful Commands
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pnpm mimetic -- --help
|
|
27
|
+
pnpm mimetic -- watch --json --no-open
|
|
28
|
+
pnpm mimetic -- verify --run latest --json
|
|
29
|
+
pnpm pack:dry-run
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Pull Requests
|
|
33
|
+
|
|
34
|
+
PRs should include:
|
|
35
|
+
|
|
36
|
+
- a concise summary;
|
|
37
|
+
- proof commands and outcomes;
|
|
38
|
+
- any remaining gaps;
|
|
39
|
+
- confirmation that fixtures and examples are synthetic or redacted.
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ It creates committed simulation source under `mimetic/`, ignored run evidence
|
|
|
9
9
|
under `.mimetic/`, a watchable Observer UI, verification gates, and public-safe
|
|
10
10
|
feedback drafts.
|
|
11
11
|
|
|
12
|
-

|
|
13
13
|
|
|
14
14
|
## Install
|
|
15
15
|
|
|
@@ -123,6 +123,8 @@ pnpm mimetic:feedback
|
|
|
123
123
|
|
|
124
124
|
## Docs
|
|
125
125
|
|
|
126
|
+
- [Ramp for future contributors and agents](docs/ramp/README.md)
|
|
127
|
+
- [Current goals](docs/goals/current.md)
|
|
126
128
|
- [Project layout](docs/architecture/project-layout.md)
|
|
127
129
|
- [Observer architecture](docs/architecture/observer.md)
|
|
128
130
|
- [OSS lab POC](docs/architecture/oss-lab-poc.md)
|
|
@@ -131,6 +133,7 @@ pnpm mimetic:feedback
|
|
|
131
133
|
- [Self-driving harness principles](docs/principles/self-driving-harness.md)
|
|
132
134
|
- [World-class open-source v0 roadmap](docs/roadmap/world-class-open-source-v0.md)
|
|
133
135
|
- [Open-source release readiness](docs/release/open-source-readiness.md)
|
|
136
|
+
- [Public readiness standard](docs/release/public-readiness-standard.md)
|
|
134
137
|
|
|
135
138
|
## Release Status
|
|
136
139
|
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Public-Safety Boundary
|
|
4
|
+
|
|
5
|
+
Mimetic must not contain or emit PII, PHI, secrets, keys, tokens, raw private
|
|
6
|
+
transcripts, private screenshots, private customer data, private patient data,
|
|
7
|
+
or private source snippets.
|
|
8
|
+
|
|
9
|
+
Do not file public issues that contain sensitive data. Redact the data and
|
|
10
|
+
describe the class of problem instead.
|
|
11
|
+
|
|
12
|
+
## Reporting A Vulnerability
|
|
13
|
+
|
|
14
|
+
If you find a security issue, open a minimal public issue only when the report
|
|
15
|
+
does not disclose exploitable details or sensitive data. Otherwise, contact the
|
|
16
|
+
maintainer privately through the repository owner profile.
|
|
17
|
+
|
|
18
|
+
Include:
|
|
19
|
+
|
|
20
|
+
- affected version or commit;
|
|
21
|
+
- command run;
|
|
22
|
+
- safe reproduction steps;
|
|
23
|
+
- redacted evidence path or synthetic fixture;
|
|
24
|
+
- whether any generated `.mimetic/` artifact may contain sensitive data.
|
|
25
|
+
|
|
26
|
+
## Maintainer Release Checks
|
|
27
|
+
|
|
28
|
+
Before any public release, run:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pnpm check
|
|
32
|
+
pnpm public-surface:scan
|
|
33
|
+
pnpm pack:dry-run
|
|
34
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const GIT_STATE_SCHEMA = "mimetic.git-state.v1";
|
|
2
|
+
export type GitStateStatus = "clean" | "dirty" | "missing" | "unavailable";
|
|
3
|
+
export type GitRefState = "attached" | "detached" | "unborn" | "unknown";
|
|
4
|
+
export interface GitStateChangeSummary {
|
|
5
|
+
staged: number;
|
|
6
|
+
unstaged: number;
|
|
7
|
+
untracked: number;
|
|
8
|
+
total: number;
|
|
9
|
+
}
|
|
10
|
+
export interface CapturedGitState {
|
|
11
|
+
schema: typeof GIT_STATE_SCHEMA;
|
|
12
|
+
status: GitStateStatus;
|
|
13
|
+
capturedAt: string;
|
|
14
|
+
head: {
|
|
15
|
+
shortSha: string | null;
|
|
16
|
+
refState: GitRefState;
|
|
17
|
+
};
|
|
18
|
+
changes: GitStateChangeSummary;
|
|
19
|
+
note: string;
|
|
20
|
+
}
|
|
21
|
+
export interface GitCommandResult {
|
|
22
|
+
exitCode: number | null;
|
|
23
|
+
stdout: string;
|
|
24
|
+
stderr: string;
|
|
25
|
+
}
|
|
26
|
+
export type GitCommandRunner = (args: string[], cwd: string) => Promise<GitCommandResult>;
|
|
27
|
+
export declare function captureGitState(cwd: string, options?: {
|
|
28
|
+
capturedAt?: Date | string;
|
|
29
|
+
runner?: GitCommandRunner;
|
|
30
|
+
}): Promise<CapturedGitState>;
|
|
31
|
+
export declare function summarizePorcelainStatus(output: string): GitStateChangeSummary;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
export const GIT_STATE_SCHEMA = "mimetic.git-state.v1";
|
|
3
|
+
export async function captureGitState(cwd, options = {}) {
|
|
4
|
+
const capturedAt = toIsoString(options.capturedAt ?? new Date());
|
|
5
|
+
const runner = options.runner ?? runGitCommand;
|
|
6
|
+
const inside = await runner(["rev-parse", "--is-inside-work-tree"], cwd);
|
|
7
|
+
if (inside.exitCode === null) {
|
|
8
|
+
return unavailableState(capturedAt, "Git command could not be started.");
|
|
9
|
+
}
|
|
10
|
+
if (inside.exitCode !== 0 || inside.stdout.trim() !== "true") {
|
|
11
|
+
return {
|
|
12
|
+
schema: GIT_STATE_SCHEMA,
|
|
13
|
+
status: "missing",
|
|
14
|
+
capturedAt,
|
|
15
|
+
head: {
|
|
16
|
+
shortSha: null,
|
|
17
|
+
refState: "unknown"
|
|
18
|
+
},
|
|
19
|
+
changes: emptyChanges(),
|
|
20
|
+
note: "No git work tree was detected."
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const statusOutput = await runner(["status", "--porcelain=v1"], cwd);
|
|
24
|
+
if (statusOutput.exitCode === null) {
|
|
25
|
+
return unavailableState(capturedAt, "Git status command could not be started.");
|
|
26
|
+
}
|
|
27
|
+
if (statusOutput.exitCode !== 0) {
|
|
28
|
+
return unavailableState(capturedAt, "Git status could not be captured.");
|
|
29
|
+
}
|
|
30
|
+
const headOutput = await runner(["rev-parse", "--short=12", "HEAD"], cwd);
|
|
31
|
+
const shortSha = headOutput.exitCode === 0 ? normalizeNullableText(headOutput.stdout) : null;
|
|
32
|
+
const refState = await captureRefState(runner, cwd, shortSha);
|
|
33
|
+
const changes = summarizePorcelainStatus(statusOutput.stdout);
|
|
34
|
+
const status = changes.total === 0 ? "clean" : "dirty";
|
|
35
|
+
return {
|
|
36
|
+
schema: GIT_STATE_SCHEMA,
|
|
37
|
+
status,
|
|
38
|
+
capturedAt,
|
|
39
|
+
head: {
|
|
40
|
+
shortSha,
|
|
41
|
+
refState
|
|
42
|
+
},
|
|
43
|
+
changes,
|
|
44
|
+
note: status === "clean"
|
|
45
|
+
? "Git work tree was clean; branch names, remotes, paths, and file names were not captured."
|
|
46
|
+
: "Git work tree had changes; only counts were captured, not branch names, remotes, paths, or file names."
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export function summarizePorcelainStatus(output) {
|
|
50
|
+
const lines = output.split(/\r?\n/).filter((line) => line.length > 0);
|
|
51
|
+
let staged = 0;
|
|
52
|
+
let unstaged = 0;
|
|
53
|
+
let untracked = 0;
|
|
54
|
+
for (const line of lines) {
|
|
55
|
+
const indexStatus = line[0] ?? " ";
|
|
56
|
+
const workTreeStatus = line[1] ?? " ";
|
|
57
|
+
if (indexStatus === "?" && workTreeStatus === "?") {
|
|
58
|
+
untracked += 1;
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (indexStatus !== " ") {
|
|
62
|
+
staged += 1;
|
|
63
|
+
}
|
|
64
|
+
if (workTreeStatus !== " ") {
|
|
65
|
+
unstaged += 1;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
staged,
|
|
70
|
+
unstaged,
|
|
71
|
+
untracked,
|
|
72
|
+
total: lines.length
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
async function captureRefState(runner, cwd, shortSha) {
|
|
76
|
+
const symbolicRef = await runner(["symbolic-ref", "--quiet", "HEAD"], cwd);
|
|
77
|
+
if (symbolicRef.exitCode === 0) {
|
|
78
|
+
return "attached";
|
|
79
|
+
}
|
|
80
|
+
return shortSha === null ? "unborn" : "detached";
|
|
81
|
+
}
|
|
82
|
+
async function runGitCommand(args, cwd) {
|
|
83
|
+
return await new Promise((resolve) => {
|
|
84
|
+
const child = spawn("git", args, {
|
|
85
|
+
cwd,
|
|
86
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
87
|
+
});
|
|
88
|
+
const stdout = [];
|
|
89
|
+
const stderr = [];
|
|
90
|
+
child.stdout.setEncoding("utf8");
|
|
91
|
+
child.stderr.setEncoding("utf8");
|
|
92
|
+
child.stdout.on("data", (chunk) => stdout.push(chunk));
|
|
93
|
+
child.stderr.on("data", (chunk) => stderr.push(chunk));
|
|
94
|
+
child.on("error", (error) => {
|
|
95
|
+
resolve({
|
|
96
|
+
exitCode: null,
|
|
97
|
+
stdout: stdout.join(""),
|
|
98
|
+
stderr: error.message
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
child.on("close", (exitCode) => {
|
|
102
|
+
resolve({
|
|
103
|
+
exitCode,
|
|
104
|
+
stdout: stdout.join(""),
|
|
105
|
+
stderr: stderr.join("")
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
function unavailableState(capturedAt, note) {
|
|
111
|
+
return {
|
|
112
|
+
schema: GIT_STATE_SCHEMA,
|
|
113
|
+
status: "unavailable",
|
|
114
|
+
capturedAt,
|
|
115
|
+
head: {
|
|
116
|
+
shortSha: null,
|
|
117
|
+
refState: "unknown"
|
|
118
|
+
},
|
|
119
|
+
changes: emptyChanges(),
|
|
120
|
+
note
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function emptyChanges() {
|
|
124
|
+
return {
|
|
125
|
+
staged: 0,
|
|
126
|
+
unstaged: 0,
|
|
127
|
+
untracked: 0,
|
|
128
|
+
total: 0
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function normalizeNullableText(value) {
|
|
132
|
+
const normalized = value.trim();
|
|
133
|
+
return normalized.length === 0 ? null : normalized;
|
|
134
|
+
}
|
|
135
|
+
function toIsoString(value) {
|
|
136
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
137
|
+
if (Number.isNaN(date.getTime())) {
|
|
138
|
+
throw new Error(`Invalid date: ${String(value)}`);
|
|
139
|
+
}
|
|
140
|
+
return date.toISOString();
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=git-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-state.js","sourceRoot":"","sources":["../../src/core/git-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAgCvD,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,GAAW,EACX,UAGI,EAAE;IAEN,MAAM,UAAU,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;IACjE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,aAAa,CAA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AAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,iBAAiB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { CORE_RUN_ID_PATTERN, HISTORY_ENTRY_SCHEMA, LATEST_POINTER_SCHEMA, assertRunId, buildArtifactLayout, buildRunId, createHistoryEntry, createLatestPointer, createLifecycleEvent, isValidRunId, summarizeTiming } from "./run-primitives.js";
|
|
2
|
+
export type { ArtifactLayout, BuildRunIdOptions, CoreLifecycleEvent, CoreRunMode, LatestRunPointer, RunHistoryEntry, TimingSummary } from "./run-primitives.js";
|
|
3
|
+
export { GIT_STATE_SCHEMA, captureGitState, summarizePorcelainStatus } from "./git-state.js";
|
|
4
|
+
export type { CapturedGitState, GitCommandResult, GitCommandRunner, GitRefState, GitStateChangeSummary, GitStateStatus } from "./git-state.js";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { CORE_RUN_ID_PATTERN, HISTORY_ENTRY_SCHEMA, LATEST_POINTER_SCHEMA, assertRunId, buildArtifactLayout, buildRunId, createHistoryEntry, createLatestPointer, createLifecycleEvent, isValidRunId, summarizeTiming } from "./run-primitives.js";
|
|
2
|
+
export { GIT_STATE_SCHEMA, captureGitState, summarizePorcelainStatus } from "./git-state.js";
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,WAAW,EACX,mBAAmB,EACnB,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAU7B,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EACzB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export declare const CORE_RUN_ID_PATTERN: RegExp;
|
|
2
|
+
export declare const LATEST_POINTER_SCHEMA = "mimetic.latest-run.v1";
|
|
3
|
+
export declare const HISTORY_ENTRY_SCHEMA = "mimetic.run-history-entry.v1";
|
|
4
|
+
export type CoreRunMode = "dry-run" | "live";
|
|
5
|
+
export interface BuildRunIdOptions {
|
|
6
|
+
prefix: string;
|
|
7
|
+
createdAt: Date | string;
|
|
8
|
+
entropy: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ArtifactLayout {
|
|
11
|
+
artifactRoot: string;
|
|
12
|
+
run: string;
|
|
13
|
+
reviewJson: string;
|
|
14
|
+
reviewMarkdown: string;
|
|
15
|
+
observerData: string;
|
|
16
|
+
events: string;
|
|
17
|
+
latestPointer: string;
|
|
18
|
+
}
|
|
19
|
+
export interface LatestRunPointer {
|
|
20
|
+
schema: typeof LATEST_POINTER_SCHEMA;
|
|
21
|
+
runId: string;
|
|
22
|
+
path: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
}
|
|
25
|
+
export interface RunHistoryEntry {
|
|
26
|
+
schema: typeof HISTORY_ENTRY_SCHEMA;
|
|
27
|
+
runId: string;
|
|
28
|
+
createdAt: string;
|
|
29
|
+
mode: CoreRunMode;
|
|
30
|
+
path: string;
|
|
31
|
+
}
|
|
32
|
+
export interface CoreLifecycleEvent {
|
|
33
|
+
at: string;
|
|
34
|
+
event: string;
|
|
35
|
+
message: string;
|
|
36
|
+
}
|
|
37
|
+
export interface TimingSummary {
|
|
38
|
+
startedAt: string;
|
|
39
|
+
endedAt: string | null;
|
|
40
|
+
durationMs: number | null;
|
|
41
|
+
status: "running" | "complete";
|
|
42
|
+
}
|
|
43
|
+
export declare function buildRunId(options: BuildRunIdOptions): string;
|
|
44
|
+
export declare function isValidRunId(value: string): boolean;
|
|
45
|
+
export declare function assertRunId(value: string): void;
|
|
46
|
+
export declare function buildArtifactLayout(runId: string, runsRoot?: string): ArtifactLayout;
|
|
47
|
+
export declare function createLatestPointer(options: {
|
|
48
|
+
runId: string;
|
|
49
|
+
artifactRoot: string;
|
|
50
|
+
updatedAt: Date | string;
|
|
51
|
+
}): LatestRunPointer;
|
|
52
|
+
export declare function createHistoryEntry(options: {
|
|
53
|
+
runId: string;
|
|
54
|
+
createdAt: Date | string;
|
|
55
|
+
mode: CoreRunMode;
|
|
56
|
+
artifactRoot: string;
|
|
57
|
+
}): RunHistoryEntry;
|
|
58
|
+
export declare function createLifecycleEvent(options: {
|
|
59
|
+
at: Date | string;
|
|
60
|
+
event: string;
|
|
61
|
+
message: string;
|
|
62
|
+
}): CoreLifecycleEvent;
|
|
63
|
+
export declare function summarizeTiming(options: {
|
|
64
|
+
startedAt: Date | string;
|
|
65
|
+
endedAt?: Date | string;
|
|
66
|
+
}): TimingSummary;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export const CORE_RUN_ID_PATTERN = /^[a-z0-9][a-z0-9-]{0,127}$/;
|
|
2
|
+
export const LATEST_POINTER_SCHEMA = "mimetic.latest-run.v1";
|
|
3
|
+
export const HISTORY_ENTRY_SCHEMA = "mimetic.run-history-entry.v1";
|
|
4
|
+
export function buildRunId(options) {
|
|
5
|
+
const prefix = toSafeSegment(options.prefix, "run");
|
|
6
|
+
const entropy = toSafeSegment(options.entropy, "proof");
|
|
7
|
+
const timestamp = toTimestampSegment(options.createdAt);
|
|
8
|
+
const runId = `${prefix}-${timestamp}-${entropy}`;
|
|
9
|
+
assertRunId(runId);
|
|
10
|
+
return runId;
|
|
11
|
+
}
|
|
12
|
+
export function isValidRunId(value) {
|
|
13
|
+
return CORE_RUN_ID_PATTERN.test(value) && !value.includes("--");
|
|
14
|
+
}
|
|
15
|
+
export function assertRunId(value) {
|
|
16
|
+
if (!isValidRunId(value)) {
|
|
17
|
+
throw new Error(`Invalid run id: ${value}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export function buildArtifactLayout(runId, runsRoot = ".mimetic/runs") {
|
|
21
|
+
assertRunId(runId);
|
|
22
|
+
const normalizedRoot = normalizeRelativePath(runsRoot);
|
|
23
|
+
const artifactRoot = `${normalizedRoot}/${runId}`;
|
|
24
|
+
return {
|
|
25
|
+
artifactRoot,
|
|
26
|
+
run: `${artifactRoot}/run.json`,
|
|
27
|
+
reviewJson: `${artifactRoot}/review.json`,
|
|
28
|
+
reviewMarkdown: `${artifactRoot}/review.md`,
|
|
29
|
+
observerData: `${artifactRoot}/observer/observer-data.json`,
|
|
30
|
+
events: `${artifactRoot}/events.ndjson`,
|
|
31
|
+
latestPointer: `${normalizedRoot}/latest.json`
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function createLatestPointer(options) {
|
|
35
|
+
assertRunId(options.runId);
|
|
36
|
+
return {
|
|
37
|
+
schema: LATEST_POINTER_SCHEMA,
|
|
38
|
+
runId: options.runId,
|
|
39
|
+
path: normalizeRelativePath(options.artifactRoot),
|
|
40
|
+
updatedAt: toIsoString(options.updatedAt)
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function createHistoryEntry(options) {
|
|
44
|
+
assertRunId(options.runId);
|
|
45
|
+
return {
|
|
46
|
+
schema: HISTORY_ENTRY_SCHEMA,
|
|
47
|
+
runId: options.runId,
|
|
48
|
+
createdAt: toIsoString(options.createdAt),
|
|
49
|
+
mode: options.mode,
|
|
50
|
+
path: normalizeRelativePath(options.artifactRoot)
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export function createLifecycleEvent(options) {
|
|
54
|
+
const event = options.event.trim();
|
|
55
|
+
const message = options.message.trim();
|
|
56
|
+
if (event.length === 0) {
|
|
57
|
+
throw new Error("Lifecycle event is required.");
|
|
58
|
+
}
|
|
59
|
+
if (message.length === 0) {
|
|
60
|
+
throw new Error("Lifecycle message is required.");
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
at: toIsoString(options.at),
|
|
64
|
+
event,
|
|
65
|
+
message
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export function summarizeTiming(options) {
|
|
69
|
+
const startedAt = toIsoString(options.startedAt);
|
|
70
|
+
if (options.endedAt === undefined) {
|
|
71
|
+
return {
|
|
72
|
+
startedAt,
|
|
73
|
+
endedAt: null,
|
|
74
|
+
durationMs: null,
|
|
75
|
+
status: "running"
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const endedAt = toIsoString(options.endedAt);
|
|
79
|
+
const durationMs = new Date(endedAt).getTime() - new Date(startedAt).getTime();
|
|
80
|
+
if (durationMs < 0) {
|
|
81
|
+
throw new Error("Timing summary endedAt must be after startedAt.");
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
startedAt,
|
|
85
|
+
endedAt,
|
|
86
|
+
durationMs,
|
|
87
|
+
status: "complete"
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function toTimestampSegment(value) {
|
|
91
|
+
return toIsoString(value).toLowerCase().replace(/[:.]/g, "-");
|
|
92
|
+
}
|
|
93
|
+
function toIsoString(value) {
|
|
94
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
95
|
+
if (Number.isNaN(date.getTime())) {
|
|
96
|
+
throw new Error(`Invalid date: ${String(value)}`);
|
|
97
|
+
}
|
|
98
|
+
return date.toISOString();
|
|
99
|
+
}
|
|
100
|
+
function toSafeSegment(value, fallback) {
|
|
101
|
+
const normalized = value
|
|
102
|
+
.trim()
|
|
103
|
+
.toLowerCase()
|
|
104
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
105
|
+
.replace(/^-+|-+$/g, "")
|
|
106
|
+
.slice(0, 48);
|
|
107
|
+
return normalized.length > 0 ? normalized : fallback;
|
|
108
|
+
}
|
|
109
|
+
function normalizeRelativePath(value) {
|
|
110
|
+
const normalized = value.replace(/\\/g, "/");
|
|
111
|
+
if (normalized.startsWith("/") || /^[A-Za-z]:\//.test(normalized)) {
|
|
112
|
+
throw new Error(`Artifact paths must be relative: ${value}`);
|
|
113
|
+
}
|
|
114
|
+
const parts = normalized.split("/").filter((part) => part.length > 0);
|
|
115
|
+
if (parts.length === 0 || parts.some((part) => part === "." || part === "..")) {
|
|
116
|
+
throw new Error(`Artifact path contains an unsafe segment: ${value}`);
|
|
117
|
+
}
|
|
118
|
+
return parts.join("/");
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=run-primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-primitives.js","sourceRoot":"","sources":["../../src/core/run-primitives.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG,4BAA4B,CAAC;AAChE,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAC7D,MAAM,CAAC,MAAM,oBAAoB,GAAG,8BAA8B,CAAC;AAgDnE,MAAM,UAAU,UAAU,CAAC,OAA0B;IACnD,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACxD,MAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACxD,MAAM,KAAK,GAAG,GAAG,MAAM,IAAI,SAAS,IAAI,OAAO,EAAE,CAAC;IAElD,WAAW,CAAC,KAAK,CAAC,CAAC;IACnB,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,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