cohorte 3.0.0-dev.5 → 3.0.0-dev.7
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/assets/manifest.json +16 -6
- package/assets/prompts/agents/brainstormer.md +3 -0
- package/assets/prompts/agents/spec-author.md +3 -0
- package/assets/schemas/commands.schema.json +7 -0
- package/assets/schemas/config.schema.json +22 -0
- package/dist/bundle-manifest.json +72 -48
- package/dist/chunks/align-ds-r_X_1aQ_.mjs +93 -0
- package/dist/chunks/align-ds-r_X_1aQ_.mjs.map +1 -0
- package/dist/chunks/audit-B4ZWQ_DI.mjs +179 -0
- package/dist/chunks/audit-B4ZWQ_DI.mjs.map +1 -0
- package/dist/chunks/brainstorm-DasVwI1D.mjs +123 -0
- package/dist/chunks/brainstorm-DasVwI1D.mjs.map +1 -0
- package/dist/chunks/build-crOld8gE.mjs +19 -0
- package/dist/chunks/build-crOld8gE.mjs.map +1 -0
- package/dist/chunks/{catalogue-B5uFqfzJ.mjs → catalogue-IaCJdfB8.mjs} +4 -4
- package/dist/chunks/{catalogue-B5uFqfzJ.mjs.map → catalogue-IaCJdfB8.mjs.map} +1 -1
- package/dist/chunks/{compose-CKo_q39e.mjs → compose-DRKjQcn0.mjs} +42 -23
- package/dist/chunks/compose-DRKjQcn0.mjs.map +1 -0
- package/dist/chunks/{config-DefHA2Lw.mjs → config-Cqu5XQoP.mjs} +2 -2
- package/dist/chunks/{config-DefHA2Lw.mjs.map → config-Cqu5XQoP.mjs.map} +1 -1
- package/dist/chunks/{contract-BkMjU1kR.mjs → contract-DjssDPpS.mjs} +66 -26
- package/dist/chunks/contract-DjssDPpS.mjs.map +1 -0
- package/dist/chunks/{diff-D_0hBwHl.mjs → diff-Qw0II0sj.mjs} +2 -2
- package/dist/chunks/{diff-D_0hBwHl.mjs.map → diff-Qw0II0sj.mjs.map} +1 -1
- package/dist/chunks/{discover-BJMwXyGL.mjs → discover-BZPolSZG.mjs} +2 -2
- package/dist/chunks/{discover-BJMwXyGL.mjs.map → discover-BZPolSZG.mjs.map} +1 -1
- package/dist/chunks/{doctor-CginW8y8.mjs → doctor-DcDFPvQM.mjs} +6 -6
- package/dist/chunks/{doctor-CginW8y8.mjs.map → doctor-DcDFPvQM.mjs.map} +1 -1
- package/dist/chunks/fix-B_oGzGVn.mjs +82 -0
- package/dist/chunks/fix-B_oGzGVn.mjs.map +1 -0
- package/dist/chunks/fleet-yWHQY2ya.mjs +297 -0
- package/dist/chunks/fleet-yWHQY2ya.mjs.map +1 -0
- package/dist/chunks/{init-CP6puNbE.mjs → init--FxxkrcT.mjs} +2 -2
- package/dist/chunks/{init-CP6puNbE.mjs.map → init--FxxkrcT.mjs.map} +1 -1
- package/dist/chunks/intake-Dd1KVXnO.mjs +12 -0
- package/dist/chunks/intake-Dd1KVXnO.mjs.map +1 -0
- package/dist/chunks/loop-BWsUpyus.mjs +212 -0
- package/dist/chunks/loop-BWsUpyus.mjs.map +1 -0
- package/dist/chunks/{migrate-DybihKzZ.mjs → migrate-DuYCAbE3.mjs} +2 -2
- package/dist/chunks/{migrate-DybihKzZ.mjs.map → migrate-DuYCAbE3.mjs.map} +1 -1
- package/dist/chunks/obsidian-BHLkXx_H.mjs +235 -0
- package/dist/chunks/obsidian-BHLkXx_H.mjs.map +1 -0
- package/dist/chunks/patch-sAgVqjpx.mjs +50 -0
- package/dist/chunks/patch-sAgVqjpx.mjs.map +1 -0
- package/dist/chunks/{policy-Clypo20s.mjs → policy-Du7WVBFX.mjs} +4 -4
- package/dist/chunks/{policy-Clypo20s.mjs.map → policy-Du7WVBFX.mjs.map} +1 -1
- package/dist/chunks/{reconcile-czNaLOP6.mjs → reconcile-BHn66X3C.mjs} +3 -3
- package/dist/chunks/{reconcile-czNaLOP6.mjs.map → reconcile-BHn66X3C.mjs.map} +1 -1
- package/dist/chunks/refactor-CoNoqLZr.mjs +153 -0
- package/dist/chunks/refactor-CoNoqLZr.mjs.map +1 -0
- package/dist/chunks/retro-Dr-2RTNN.mjs +78 -0
- package/dist/chunks/retro-Dr-2RTNN.mjs.map +1 -0
- package/dist/chunks/review-ZsBqp3vZ.mjs +35 -0
- package/dist/chunks/review-ZsBqp3vZ.mjs.map +1 -0
- package/dist/chunks/{run-CgTWYlcd.mjs → run-NGAxdsIX.mjs} +28 -5
- package/dist/chunks/run-NGAxdsIX.mjs.map +1 -0
- package/dist/chunks/{schema-C9QbUW4H.mjs → schema-Bq9qtgsd.mjs} +9 -4
- package/dist/chunks/schema-Bq9qtgsd.mjs.map +1 -0
- package/dist/chunks/ship-BizfUe62.mjs +140 -0
- package/dist/chunks/ship-BizfUe62.mjs.map +1 -0
- package/dist/chunks/spec-C2h3U64g.mjs +65 -0
- package/dist/chunks/spec-C2h3U64g.mjs.map +1 -0
- package/dist/chunks/spec-path-tptqR7W8.mjs +10 -0
- package/dist/chunks/spec-path-tptqR7W8.mjs.map +1 -0
- package/dist/chunks/{src-r0ECB1UJ.mjs → src-Bfr1yzsn.mjs} +3 -3
- package/dist/chunks/{src-r0ECB1UJ.mjs.map → src-Bfr1yzsn.mjs.map} +1 -1
- package/dist/chunks/{src-DZazJCp1.mjs → src-CPW2_Ons.mjs} +101 -17
- package/dist/chunks/src-CPW2_Ons.mjs.map +1 -0
- package/dist/chunks/{src-CmFjh4M0.mjs → src-DNsLSxgm.mjs} +2 -2
- package/dist/chunks/{src-CmFjh4M0.mjs.map → src-DNsLSxgm.mjs.map} +1 -1
- package/dist/chunks/{src-DcU4IXMe.mjs → src-DbS9gkJy.mjs} +2 -2
- package/dist/chunks/{src-DcU4IXMe.mjs.map → src-DbS9gkJy.mjs.map} +1 -1
- package/dist/chunks/{src-s7YRvk0t.mjs → src-yi5whv3n.mjs} +4 -2
- package/dist/chunks/src-yi5whv3n.mjs.map +1 -0
- package/dist/chunks/update-pipeline-Du-Gu1Pl.mjs +56 -0
- package/dist/chunks/update-pipeline-Du-Gu1Pl.mjs.map +1 -0
- package/dist/cli.mjs +29 -18
- package/dist/cli.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/brainstorm-BwKA6yZP.mjs +0 -7
- package/dist/chunks/brainstorm-BwKA6yZP.mjs.map +0 -1
- package/dist/chunks/compose-CKo_q39e.mjs.map +0 -1
- package/dist/chunks/contract-BkMjU1kR.mjs.map +0 -1
- package/dist/chunks/fix-D4Tj8RVA.mjs +0 -18
- package/dist/chunks/fix-D4Tj8RVA.mjs.map +0 -1
- package/dist/chunks/review-BDdjb6kB.mjs +0 -17
- package/dist/chunks/review-BDdjb6kB.mjs.map +0 -1
- package/dist/chunks/run-CgTWYlcd.mjs.map +0 -1
- package/dist/chunks/schema-C9QbUW4H.mjs.map +0 -1
- package/dist/chunks/ship-DTuLGoaJ.mjs +0 -19
- package/dist/chunks/ship-DTuLGoaJ.mjs.map +0 -1
- package/dist/chunks/spec-Bq0P3jVh.mjs +0 -20
- package/dist/chunks/spec-Bq0P3jVh.mjs.map +0 -1
- package/dist/chunks/src-DZazJCp1.mjs.map +0 -1
- package/dist/chunks/src-s7YRvk0t.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contract-BkMjU1kR.mjs","names":[],"sources":["../../../../apps/cli/src/contract/command-module.ts","../../../../apps/cli/src/contract/documents.ts","../../../../apps/cli/src/contract/exit-codes.ts","../../../../apps/cli/src/contract/verbs.ts"],"sourcesContent":["// apps/cli/src/contract/command-module.ts — DESIGN 10.1 rule 3 \"every barrel entry is a live export\": each verb's\n// `commands/<verb>/index.ts` implements `CommandModule`. Wave 0 fills every one with `notImplementedCommand` (the\n// documented not-available error, spec 24 `configuration/phase-not-available`); later waves replace the body,\n// never the shape — `cli.ts` and `lazy.ts` never change to accommodate a filled-in verb.\nimport { CohorteError, errorOf } from '@cohorte/base';\nimport type { CliContext } from './context.ts';\n\n/** What `cli.ts` hands a module after commander parsed the line: positionals, options, and the JSON flag. */\nexport interface CommandArgs {\n /**\n * Every token commander did not consume, IN ORDER — which in V3.0 means every flag a verb defines for itself:\n * `cohorte run spec-1 --wait 8 --detach` arrives as `['spec-1', '--wait', '8', '--detach']`. A verb module parses\n * its own flags from here.\n */\n readonly positionals: readonly string[];\n /**\n * In V3.0 this carries ONLY `json`. The registry is frozen (PLAN §3 rule 3) and `cli.ts` registers no option but\n * `--json`, on the verbs that publish a document; with `allowUnknownOption(true)` every other flag is left\n * unparsed in `positionals`. So `args.options.wait` / `args.options.check` are ALWAYS `undefined` — read\n * `positionals`. The map is kept open (rather than typed `{ json?: boolean }`) because a post-3.0 registry\n * amendment that declares a real option is a MINOR, not a breaking change to this contract.\n */\n readonly options: Readonly<Record<string, unknown>>;\n /** Set when the verb has DESIGN §9 sub-verbs (`config get`, `auth login`, ...): the one commander matched. */\n readonly subVerb?: string;\n readonly json: boolean;\n}\n\nexport interface CommandModule {\n readonly verb: string;\n /**\n * Runs the verb; returns the process exit code (DESIGN 2.8 / 2.3.4). Throwing is equivalent to returning the\n * class exit code of `toErrorInfo(thrown, …)`: `cli.ts` converts every throw at the boundary, so a module is\n * free to throw a `CohorteError`, a `NotImplemented`, or let an unexpected error surface — nothing here writes to\n * `ctx.stdio` on error, `cli.ts` alone owns the spec-21 `cause / impact / run / next action / exit code` format.\n */\n run(ctx: CliContext, args: CommandArgs): Promise<number>;\n}\n\n/**\n * The Wave-0 body of every verb (DESIGN §9 \"stubbed with a seam\" and the plain \"not yet built\" ones alike): a verb\n * a later wave fills replaces this factory call with a real implementation, never the module's shape.\n *\n * It throws a CLASSIFIED `CohorteError`, not a bare `NotImplemented`: `toErrorInfo` keeps a `CohorteError`'s own\n * code, so the documented `configuration/phase-not-available` (DESIGN §9, exit 10) is what the stub MEANS rather\n * than what `cli.ts`'s unknown-throwable fallback happens to be. `cli.ts`'s fallback is `configuration/unexpected`\n * (DESIGN 2.8 \"Unknown throwables -> `<nearest class>/unexpected`\"), so a real defect in a filled-in verb can never\n * masquerade as \"this phase is not available in this build\".\n */\nexport function notImplementedCommand(verb: string): CommandModule {\n return {\n verb,\n // `ctx`/`args` intentionally unused: the Wave-0 stub never touches a port (DESIGN 1.3).\n async run(_ctx, _args): Promise<number> {\n throw new CohorteError(\n errorOf('configuration/phase-not-available', `the verb \\`${verb}\\` is not available in this build`),\n );\n },\n };\n}\n","// apps/cli/src/contract/documents.ts — DESIGN 2.3.5 \"one [S] document per --json output\". `JSON_OUTPUTS` is the\n// map a Wave-4 command unit's `--json validates` test reads: verb -> the published document(s) that verb's\n// `--json` can print, each resolvable to a real schema in the protocol, project-model or security contract (PLAN\n// U0.10 test list, 6th row).\n\nimport { ProjectModel, ReconcilePlan } from '@cohorte/project-model/contract';\nimport { DOCUMENTS, type DocumentName } from '@cohorte/protocol';\nimport type { TSchema } from 'typebox';\n\n/** The two project-model documents a `--json` verb may print (DESIGN §9: `reconcile --plan`, `discover`). */\nexport const PROJECT_MODEL_DOCUMENT_NAMES = ['reconcile-plan', 'project-model'] as const;\nexport type ProjectModelDocumentName = (typeof PROJECT_MODEL_DOCUMENT_NAMES)[number];\n\nexport type DocumentRef =\n | { readonly source: 'protocol'; readonly name: DocumentName }\n | { readonly source: 'project-model'; readonly name: ProjectModelDocumentName };\n\n/** Resolves a `DocumentRef` to its real schema; throws when the referenced contract has no such entry (a drift\n * guard, not a runtime path: every entry of `JSON_OUTPUTS` below is checked against this at test time). */\nexport function resolveDocumentSchema(ref: DocumentRef): TSchema {\n if (ref.source === 'protocol') {\n const schema = DOCUMENTS[ref.name];\n if (!schema) throw new RangeError(`resolveDocumentSchema: no protocol document named ${ref.name}`);\n return schema;\n }\n // A plain lookup, not a `switch` with an unreachable default: the ref may come from a Wave-4 unit's data, so an\n // unknown name must throw at run time and not only fail to typecheck.\n // No cast: `TUnsafe<T> extends TSchema`, and there is exactly one typebox install (the `pnpm-workspace.yaml`\n // override pins 1.3.7), so `@cohorte/project-model/contract`'s schemas ARE `TSchema`s here. If this ever stops\n // compiling, the cause is a second typebox identity in the graph — a real defect to report, not to cast away.\n const projectModelSchemas: Record<ProjectModelDocumentName, TSchema> = {\n 'reconcile-plan': ReconcilePlan,\n 'project-model': ProjectModel,\n };\n const schema = projectModelSchemas[ref.name];\n if (!schema) throw new RangeError(`resolveDocumentSchema: no project-model document named ${String(ref.name)}`);\n return schema;\n}\n\nconst protocolDoc = (name: DocumentName): DocumentRef => ({ source: 'protocol', name });\nconst reconcilePlanDoc: DocumentRef = { source: 'project-model', name: 'reconcile-plan' };\n/** DESIGN §9 verb semantics: \"`cohorte discover` prints the deterministic scan as a Project Model document\". */\nconst projectModelDoc: DocumentRef = { source: 'project-model', name: 'project-model' };\n/** DESIGN 2.3.4's inbox route: every mutating command answers with a `CommandResultDocument`. */\nconst commandResult: readonly DocumentRef[] = [protocolDoc('command-result')];\n\n/**\n * Keyed by CLI verb (not by `CommandType`: read-only verbs publish a document with no command behind them).\n *\n * The key set is exactly `{ verb.name | verb.json }` of `contract/verbs.ts`, and `cli.ts` registers `--json` only\n * for those verbs — `apps/cli/test/registry/json-outputs.test.ts` pins both directions. `logs` and `tail` are\n * deliberately absent: DESIGN 4.7 gives an observer `--format=line|json` over an NDJSON *stream* of event\n * envelopes, not a single `--json` document (request U0.10 R1 asks U0.G to confirm that reading).\n */\nexport const JSON_OUTPUTS: Readonly<Record<string, readonly DocumentRef[]>> = Object.freeze({\n // `status <run>` -> run-state; `status` (no run) -> project-status (DESIGN 2.3.4 \"no runId => ProjectStatusDocument\")\n status: [protocolDoc('project-status'), protocolDoc('run-state')],\n inspect: [protocolDoc('inspect')],\n diff: [protocolDoc('run-diff')],\n doctor: [protocolDoc('doctor-report')],\n auth: [protocolDoc('auth-status')],\n reconcile: [reconcilePlanDoc],\n discover: [projectModelDoc],\n // `run` drives `start`; its `--wait`/`--json` prints the same run-state an observer would (DESIGN 4.7).\n run: [protocolDoc('command-result'), protocolDoc('run-state')],\n resume: commandResult,\n pause: commandResult,\n cancel: commandResult,\n approve: commandResult,\n deny: commandResult,\n retry: commandResult,\n skip: commandResult,\n shutdown: commandResult,\n send: commandResult,\n 'run-tool': commandResult,\n});\n","// apps/cli/src/contract/exit-codes.ts — DESIGN 2.8 \"Exit codes of a process that waits for a run\" + DESIGN 4.7 +\n// the controller codes of DESIGN 2.3.4 (`CONTROLLER_EXIT_CODES`). Total over `ErrorClass` because it is built\n// directly from `@cohorte/base`'s `EXIT_CODE_BY_CLASS`, which is itself total (a `satisfies Record<ErrorClass, …>`\n// literal): the totality test in `apps/cli/test/registry` checks that equality holds, it does not re-derive it.\nimport { ERROR_CLASSES, type ErrorClass, EXIT_CODE_BY_CLASS } from '@cohorte/base';\nimport { CONTROLLER_EXIT_CODES, HALTED_STATES, type PipelineState, SUSPENDED_STATES } from '@cohorte/protocol';\n\nexport { CONTROLLER_EXIT_CODES, EXIT_CODE_BY_CLASS };\n\n/** DESIGN 4.7 \"4 on a suspended state\" / DESIGN 2.3.4 \"4 accepted-but-pending at --wait expiry (not an error)\". */\nexport const SUSPENDED_EXIT_CODE = 4;\n/** DESIGN 2.8 \"16 on CANCELLED\" (shares the `conflict` class code, but CANCELLED is not itself an error). */\nexport const CANCELLED_EXIT_CODE = 16;\nexport const COMPLETED_EXIT_CODE = 0;\n\nconst SUSPENDED = new Set<string>(SUSPENDED_STATES);\nconst HALTED = new Set<string>(HALTED_STATES);\n\n/**\n * DESIGN 2.8 / 4.7: \"an observer started by `run`, or any `--wait`, exits 0 on COMPLETED, the class code of\n * `run.lastError` on FAILED/BLOCKED, 4 on a suspended state, 16 on CANCELLED.\" `lastErrorClass` is required\n * exactly when `state` is FAILED or BLOCKED (DESIGN 2.8: every halted run carries a `lastError`).\n */\nexport function waitExitCode(state: PipelineState, lastErrorClass?: ErrorClass): number {\n if (state === 'COMPLETED') return COMPLETED_EXIT_CODE;\n if (state === 'CANCELLED') return CANCELLED_EXIT_CODE;\n if (SUSPENDED.has(state)) return SUSPENDED_EXIT_CODE;\n if (HALTED.has(state)) {\n if (!lastErrorClass) throw new RangeError(`waitExitCode: ${state} requires lastErrorClass (DESIGN 2.8)`);\n return EXIT_CODE_BY_CLASS[lastErrorClass];\n }\n // IDLE and every ACTIVE_PIPELINE_STATE are not terminal/suspended: a waiter never observes them as a final state.\n throw new RangeError(`waitExitCode: ${state} is not a terminal or suspended state (DESIGN 2.8)`);\n}\n\nexport interface ExitCodeHelpRow {\n readonly code: number;\n readonly meaning: string;\n}\n\n/** DESIGN 2.3.4 \"Controller exit codes: 0 completed · 3 rejected · 4 accepted-but-pending · 2 usage.\" */\nexport const CONTROLLER_EXIT_HELP: readonly ExitCodeHelpRow[] = [\n { code: CONTROLLER_EXIT_CODES.completed, meaning: 'completed' },\n { code: CONTROLLER_EXIT_CODES.usage, meaning: 'usage error' },\n { code: CONTROLLER_EXIT_CODES.rejected, meaning: 'rejected' },\n { code: CONTROLLER_EXIT_CODES.pending, meaning: 'accepted, pending at --wait expiry (not an error: durable inbox)' },\n];\n\n/** DESIGN 2.8's table, class by class, in spec order. */\nexport const ERROR_CLASS_EXIT_HELP: readonly ExitCodeHelpRow[] = ERROR_CLASSES.map((errorClass) => ({\n code: EXIT_CODE_BY_CLASS[errorClass],\n meaning: `${errorClass} error`,\n}));\n\nexport const CANCELLED_EXIT_HELP: ExitCodeHelpRow = { code: CANCELLED_EXIT_CODE, meaning: 'cancelled' };\n\n/** Rendered into `--help` (PLAN U0.10 test: \"controller codes 0/2/3/4 documented in --help\"). */\nexport function formatExitCodesHelp(): string {\n const rows = [...CONTROLLER_EXIT_HELP, ...ERROR_CLASS_EXIT_HELP, CANCELLED_EXIT_HELP];\n const width = Math.max(...rows.map((row) => String(row.code).length));\n const lines = rows.map((row) => ` ${String(row.code).padStart(width)} ${row.meaning}`);\n return ['Exit codes:', ...lines].join('\\n');\n}\n","// apps/cli/src/contract/verbs.ts — DESIGN §9 \"V3.0 scope cut\" CLI row + the verb-semantics paragraph, and DESIGN\n// 2.3.4 \"every command type has a CLI verb, because one-shot CLI spawns are the only V3.0 transport\". `cli.ts`\n// builds the whole commander tree from this table and NOTHING ELSE (PLAN §3 rule 3: \"cli.ts pre-registers every\n// verb against commands/<verb>/index.ts\"); a later wave fills a verb's module, never this table's shape.\nimport type { CommandType } from '@cohorte/protocol';\n\nexport interface VerbSpec {\n readonly name: string;\n readonly summary: string;\n /** DESIGN §9: `config get|set|validate|trust`, `auth login|status|logout`, `providers list|test`, ... */\n readonly subVerbs?: readonly string[];\n /** Not listed in `cohorte --help` (the `__host` internal entry point, DESIGN 4.7). */\n readonly hidden?: boolean;\n /**\n * This verb accepts `--json` and publishes a document for it (DESIGN 2.3.5). Set exactly on the verbs that have\n * a `JSON_OUTPUTS` entry — `cli.ts` registers the `--json` option only for those, and\n * `apps/cli/test/registry/json-outputs.test.ts` pins the two sides equal in BOTH directions, so a verb can never\n * be silently flagged `--json` with no document behind it.\n */\n readonly json?: boolean;\n /** The `@cohorte/protocol` `CommandType` this verb drives 1:1, when it drives exactly one (DESIGN 2.3.4). */\n readonly commandType?: CommandType;\n}\n\nexport const VERBS: readonly VerbSpec[] = [\n { name: 'init', summary: 'Scaffold .cohorte/ for this repository' },\n { name: 'doctor', summary: 'Diagnose the installation, configuration and toolchain', json: true },\n { name: 'discover', summary: 'Print the deterministic project scan (no write)', json: true },\n { name: 'run', summary: 'Start a pipeline run', commandType: 'start', json: true },\n { name: 'status', summary: 'Show a run, or the project, status', commandType: 'status', json: true },\n {\n name: 'inspect',\n summary: 'Inspect one agent, context, approval, effect, snapshot, lock, diff or artifact',\n commandType: 'inspect',\n json: true,\n },\n { name: 'resume', summary: 'Resume a suspended run', commandType: 'resume', json: true },\n { name: 'pause', summary: 'Pause an active run', commandType: 'pause', json: true },\n { name: 'cancel', summary: 'Cancel a run', commandType: 'cancel', json: true },\n { name: 'shutdown', summary: 'Ask the detached host to shut down gracefully', commandType: 'shutdown', json: true },\n { name: 'approve', summary: 'Approve a pending approval request', commandType: 'approve', json: true },\n { name: 'deny', summary: 'Deny a pending approval request', commandType: 'deny', json: true },\n { name: 'retry', summary: 'Retry a phase or an agent', commandType: 'retry', json: true },\n { name: 'skip', summary: 'Skip a phase (only if policy.skip lists it)', commandType: 'skip', json: true },\n { name: 'logs', summary: 'Print durable run events' },\n { name: 'tail', summary: 'Follow a run (durable + ephemeral events)', commandType: 'tail' },\n { name: 'diff', summary: 'Show the run diff for a surface', json: true },\n { name: 'review', summary: 'Start a review-profile run over a ref range or a prior run' },\n { name: 'fix', summary: \"Retry a run's FIX phase\" },\n { name: 'ship', summary: 'Show and resolve the pending ship approval' },\n { name: 'auth', summary: 'Manage provider authentication', subVerbs: ['login', 'status', 'logout'], json: true },\n { name: 'providers', summary: 'List or test configured providers', subVerbs: ['list', 'test'] },\n { name: 'models', summary: 'List available models', subVerbs: ['list'] },\n {\n name: 'config',\n summary: 'Read, write, validate or trust the project configuration',\n subVerbs: ['get', 'set', 'validate', 'trust'],\n },\n { name: 'migrate', summary: 'Check or apply state-store migrations' },\n {\n name: 'reconcile',\n summary: 'Plan the project configuration against the discovered state',\n commandType: 'reconcile',\n json: true,\n },\n { name: 'spec', summary: 'Validate or freeze a human-written spec', subVerbs: ['validate', 'freeze'] },\n { name: 'policy', summary: 'Explain the effective security policy', subVerbs: ['explain'] },\n { name: 'gc', summary: 'Garbage-collect worktrees, spools and old runs' },\n {\n name: 'update',\n // DESIGN §9 spells it as a FLAG, `update --check`, not a sub-verb: the Wave-5 unit that fills\n // `commands/update/index.ts` reads `--check` from `args.options`/`args.positionals` like every other verb flag.\n summary: 'Check for a newer pinned install (offline, --check only in V3.0)',\n },\n { name: 'brainstorm', summary: 'Not available in V3.0 (reserved verb id, DESIGN §9)' },\n {\n name: 'run-tool',\n summary: 'Run one tool directly (admin; policy.admin.runTool)',\n commandType: 'run-tool',\n json: true,\n },\n {\n name: 'send',\n summary: 'Send text to a running agent (policy.steer.enabled)',\n commandType: 'agent.send',\n json: true,\n },\n { name: '__host', summary: 'Internal: run the detached host in-process', hidden: true },\n];\n\nconst BY_NAME = new Map(VERBS.map((verb) => [verb.name, verb]));\n\nexport function findVerb(name: string): VerbSpec | undefined {\n return BY_NAME.get(name);\n}\n\nexport const VERB_NAMES: readonly string[] = VERBS.map((verb) => verb.name);\n\n/** DESIGN 2.3.4: every `CommandType` has exactly one driving verb. Built from `VERBS`, so it can never drift. */\nexport const COMMAND_TYPE_TO_VERB: Readonly<Record<CommandType, string>> = Object.freeze(\n Object.fromEntries(\n VERBS.filter((verb): verb is VerbSpec & { commandType: CommandType } => verb.commandType !== undefined).map(\n (verb) => [verb.commandType, verb.name],\n ),\n ) as Record<CommandType, string>,\n);\n"],"mappings":";;;;;;;;;;;;;;AAiDA,SAAgB,sBAAsB,MAA6B;CACjE,OAAO;EACL;EAEA,MAAM,IAAI,MAAM,OAAwB;GACtC,MAAM,IAAI,aACR,QAAQ,qCAAqC,cAAc,KAAK,kCAAkC,CACpG;EACF;CACF;AACF;;;ACpBA,MAAM,eAAe,UAAqC;CAAE,QAAQ;CAAY;AAAK;AACrF,MAAM,mBAAgC;CAAE,QAAQ;CAAiB,MAAM;AAAiB;;AAExF,MAAM,kBAA+B;CAAE,QAAQ;CAAiB,MAAM;AAAgB;;AAEtF,MAAM,gBAAwC,CAAC,YAAY,gBAAgB,CAAC;AAUE,OAAO,OAAO;CAE1F,QAAQ,CAAC,YAAY,gBAAgB,GAAG,YAAY,WAAW,CAAC;CAChE,SAAS,CAAC,YAAY,SAAS,CAAC;CAChC,MAAM,CAAC,YAAY,UAAU,CAAC;CAC9B,QAAQ,CAAC,YAAY,eAAe,CAAC;CACrC,MAAM,CAAC,YAAY,aAAa,CAAC;CACjC,WAAW,CAAC,gBAAgB;CAC5B,UAAU,CAAC,eAAe;CAE1B,KAAK,CAAC,YAAY,gBAAgB,GAAG,YAAY,WAAW,CAAC;CAC7D,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,SAAS;CACT,MAAM;CACN,OAAO;CACP,MAAM;CACN,UAAU;CACV,MAAM;CACN,YAAY;AACd,CAAC;AC5DiB,IAAI,IAAY,gBAAgB;AACnC,IAAI,IAAY,aAAa;;AAyB5C,MAAa,uBAAmD;CAC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,SAAS;EACT,aAAa;EACb,MAAM;CACR;CACA;EAAE,MAAM;EAAU,SAAS;EAA8C,QAAQ;CAAK;AACxF;AAEgB,IAAI,IAAI,MAAM,KAAK,SAAS,CAAC,KAAK,MAAM,IAAI,CAAC,CAAC;AAMjB,MAAM,KAAK,SAAS,KAAK,IAAI;AAGC,OAAO,OAChF,OAAO,YACL,MAAM,QAAQ,SAA0D,KAAK,gBAAgB,KAAA,CAAS,CAAC,CAAC,KACrG,SAAS,CAAC,KAAK,aAAa,KAAK,IAAI,CACxC,CACF,CACF"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//#region src/commands/fix/index.ts
|
|
2
|
-
const fix = {
|
|
3
|
-
verb: "fix",
|
|
4
|
-
async run(ctx, args) {
|
|
5
|
-
const runId = args.positionals[0];
|
|
6
|
-
if (!runId) return 2;
|
|
7
|
-
const result = await ctx.controller.send("retry", { target: {
|
|
8
|
-
kind: "phase",
|
|
9
|
-
state: "FIX"
|
|
10
|
-
} }, { runId });
|
|
11
|
-
ctx.stdio.stdout.write(`${JSON.stringify(result)}\n`);
|
|
12
|
-
return result.status === "rejected" ? 3 : result.status === "pending" ? 4 : 0;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
//#endregion
|
|
16
|
-
export { fix as default };
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=fix-D4Tj8RVA.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fix-D4Tj8RVA.mjs","names":[],"sources":["../../../../apps/cli/src/commands/fix/index.ts"],"sourcesContent":["// apps/cli/src/commands/fix/index.ts — DESIGN §9 verb `fix` (PLAN §3 rule 3 \"later units fill\n// stub files that lie inside their owned paths; they never edit ... the registry\"). Wave-0 stub: exits with the\n// documented not-available error (spec 24 `configuration/phase-not-available`); filled by the Wave-4/5\n// unit that owns `apps/cli/src/commands/fix/**`.\nimport type { CommandModule } from '../../contract/index.ts';\n\nconst fix: CommandModule = {\n verb: 'fix',\n async run(ctx, args) {\n const runId = args.positionals[0];\n if (!runId) return 2;\n const result = await ctx.controller.send('retry', { target: { kind: 'phase', state: 'FIX' } }, { runId });\n ctx.stdio.stdout.write(`${JSON.stringify(result)}\\n`);\n return result.status === 'rejected' ? 3 : result.status === 'pending' ? 4 : 0;\n },\n};\n\nexport default fix;\n"],"mappings":";AAMA,MAAM,MAAqB;CACzB,MAAM;CACN,MAAM,IAAI,KAAK,MAAM;EACnB,MAAM,QAAQ,KAAK,YAAY;EAC/B,IAAI,CAAC,OAAO,OAAO;EACnB,MAAM,SAAS,MAAM,IAAI,WAAW,KAAK,SAAS,EAAE,QAAQ;GAAE,MAAM;GAAS,OAAO;EAAM,EAAE,GAAG,EAAE,MAAM,CAAC;EACxG,IAAI,MAAM,OAAO,MAAM,GAAG,KAAK,UAAU,MAAM,EAAE,GAAG;EACpD,OAAO,OAAO,WAAW,aAAa,IAAI,OAAO,WAAW,YAAY,IAAI;CAC9E;AACF"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//#region src/commands/review/index.ts
|
|
2
|
-
const review = {
|
|
3
|
-
verb: "review",
|
|
4
|
-
async run(ctx, args) {
|
|
5
|
-
const result = await ctx.controller.send("start", {
|
|
6
|
-
profile: "review",
|
|
7
|
-
unattended: false,
|
|
8
|
-
...args.positionals[0] ? { reviewTarget: { ref: args.positionals[0] } } : {}
|
|
9
|
-
});
|
|
10
|
-
ctx.stdio.stdout.write(`${JSON.stringify(result)}\n`);
|
|
11
|
-
return result.status === "rejected" ? 3 : result.status === "pending" ? 4 : 0;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
//#endregion
|
|
15
|
-
export { review as default };
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=review-BDdjb6kB.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"review-BDdjb6kB.mjs","names":[],"sources":["../../../../apps/cli/src/commands/review/index.ts"],"sourcesContent":["// apps/cli/src/commands/review/index.ts — DESIGN §9 verb `review` (PLAN §3 rule 3 \"later units fill\n// stub files that lie inside their owned paths; they never edit ... the registry\"). Wave-0 stub: exits with the\n// documented not-available error (spec 24 `configuration/phase-not-available`); filled by the Wave-4/5\n// unit that owns `apps/cli/src/commands/review/**`.\nimport type { CommandModule } from '../../contract/index.ts';\n\nconst review: CommandModule = {\n verb: 'review',\n async run(ctx, args) {\n const result = await ctx.controller.send('start', {\n profile: 'review',\n unattended: false,\n ...(args.positionals[0] ? { reviewTarget: { ref: args.positionals[0] } } : {}),\n });\n ctx.stdio.stdout.write(`${JSON.stringify(result)}\\n`);\n return result.status === 'rejected' ? 3 : result.status === 'pending' ? 4 : 0;\n },\n};\n\nexport default review;\n"],"mappings":";AAMA,MAAM,SAAwB;CAC5B,MAAM;CACN,MAAM,IAAI,KAAK,MAAM;EACnB,MAAM,SAAS,MAAM,IAAI,WAAW,KAAK,SAAS;GAChD,SAAS;GACT,YAAY;GACZ,GAAI,KAAK,YAAY,KAAK,EAAE,cAAc,EAAE,KAAK,KAAK,YAAY,GAAG,EAAE,IAAI,CAAC;EAC9E,CAAC;EACD,IAAI,MAAM,OAAO,MAAM,GAAG,KAAK,UAAU,MAAM,EAAE,GAAG;EACpD,OAAO,OAAO,WAAW,aAAa,IAAI,OAAO,WAAW,YAAY,IAAI;CAC9E;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-CgTWYlcd.mjs","names":[],"sources":["../../../../apps/cli/src/commands/run/index.ts"],"sourcesContent":["// apps/cli/src/commands/run/index.ts — DESIGN §9 verb `run` (PLAN §3 rule 3 \"later units fill\n// stub files that lie inside their owned paths; they never edit ... the registry\"). Wave-0 stub: exits with the\n// documented not-available error (spec 24 `configuration/phase-not-available`); filled by the Wave-4/5\n// unit that owns `apps/cli/src/commands/run/**`.\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { CohorteError, errorOf, type Sha256, sha256Hex } from '@cohorte/base';\nimport { loadConfig, resolveConfig } from '@cohorte/config';\nimport { createKeyStore, createTrustStore } from '@cohorte/security/auth';\nimport type { CommandModule } from '../../contract/index.ts';\n\nconst run: CommandModule = {\n verb: 'run',\n async run(ctx, args) {\n const valueAfter = (flag: string): string | undefined => {\n const index = args.positionals.indexOf(flag);\n return index >= 0 ? args.positionals[index + 1] : undefined;\n };\n const profile = (valueAfter('--profile') ??\n args.positionals.find((value) => ['feature', 'bugfix', 'review'].includes(value)) ??\n 'feature') as 'feature' | 'bugfix' | 'review';\n if (!['feature', 'bugfix', 'review'].includes(profile)) return 2;\n const spec = args.positionals.find(\n (value, index) =>\n !value.startsWith('--') &&\n args.positionals[index - 1] !== '--profile' &&\n args.positionals[index - 1] !== '--runtime' &&\n args.positionals[index - 1] !== '--script' &&\n args.positionals[index - 1] !== '--model' &&\n !['feature', 'bugfix', 'review'].includes(value),\n );\n const model = valueAfter('--model');\n const waitValue = valueAfter('--wait');\n const waitMs = waitValue === undefined ? undefined : Number(waitValue) * 1000;\n if (waitValue !== undefined && (!Number.isFinite(waitMs) || (waitMs as number) < 0)) return 2;\n const trustProjectConfig = args.positionals.includes('--trust-project-config');\n let consent: { policySha256: Sha256; via: 'cli-flag' } | undefined;\n // Test/fake contexts intentionally omit HOME; a real CLI invocation always\n // supplies it and is the only context allowed to resolve project trust.\n if (ctx.env.HOME && existsSync(join(ctx.cwd, '.cohorte', 'config.yaml'))) {\n const home = ctx.env.HOME ?? ctx.cwd;\n const loaded = await loadConfig({ cwd: ctx.cwd, home });\n const keys = createKeyStore({ directory: join(home, '.cohorte', 'keys') });\n const trustStore = createTrustStore({ directory: join(home, '.cohorte', 'trust'), keys });\n const resolved = await resolveConfig(loaded, {\n trustStore,\n projectKeyId: sha256Hex(loaded.projectRoot).slice(0, 24),\n });\n if (resolved.status === 'untrusted' && !trustProjectConfig) {\n throw new CohorteError(\n errorOf(\n 'security/project-policy-untrusted',\n `project policy is untrusted (${resolved.loosenedKeys.join(', ') || 'unknown key'})`,\n ),\n );\n }\n if (resolved.status === 'untrusted') consent = { policySha256: resolved.policySha256, via: 'cli-flag' };\n }\n const payload = {\n profile,\n unattended: false,\n ...(spec ? { spec: { path: spec } } : {}),\n ...(valueAfter('--runtime') ? { runtime: valueAfter('--runtime') as string } : {}),\n ...(valueAfter('--script') ? { fakeScript: valueAfter('--script') as string } : {}),\n ...(model ? { modelOverrides: { implementer: { provider: 'default', model } } } : {}),\n ...(consent ? { consent } : {}),\n };\n const result =\n waitMs === undefined\n ? await ctx.controller.send('start', payload)\n : await ctx.controller.send('start', payload, { waitMs });\n if (result.status === 'pending' && result.result && typeof result.result === 'object' && 'runId' in result.result) {\n const runId = (result.result as { runId?: string }).runId;\n if (runId) await ctx.hostSpawner.spawnDetached(runId);\n }\n if (args.json) ctx.stdio.stdout.write(`${JSON.stringify(result)}\\n`);\n else ctx.stdio.stdout.write(`${result.status}\\n`);\n return result.status === 'rejected' ? 3 : result.status === 'pending' ? 4 : 0;\n },\n};\n\nexport default run;\n"],"mappings":";;;;;;;AAWA,MAAM,MAAqB;CACzB,MAAM;CACN,MAAM,IAAI,KAAK,MAAM;EACnB,MAAM,cAAc,SAAqC;GACvD,MAAM,QAAQ,KAAK,YAAY,QAAQ,IAAI;GAC3C,OAAO,SAAS,IAAI,KAAK,YAAY,QAAQ,KAAK,KAAA;EACpD;EACA,MAAM,UAAW,WAAW,WAAW,KACrC,KAAK,YAAY,MAAM,UAAU;GAAC;GAAW;GAAU;EAAQ,CAAC,CAAC,SAAS,KAAK,CAAC,KAChF;EACF,IAAI,CAAC;GAAC;GAAW;GAAU;EAAQ,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO;EAC/D,MAAM,OAAO,KAAK,YAAY,MAC3B,OAAO,UACN,CAAC,MAAM,WAAW,IAAI,KACtB,KAAK,YAAY,QAAQ,OAAO,eAChC,KAAK,YAAY,QAAQ,OAAO,eAChC,KAAK,YAAY,QAAQ,OAAO,cAChC,KAAK,YAAY,QAAQ,OAAO,aAChC,CAAC;GAAC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AI,QAAQ,EAAE,gBAAgB,EAAE,aAAa;IAAE,UAAU;IAAW;GAAM,EAAE,EAAE,IAAI,CAAC;GACnF,GAAI,UAAU,EAAE,QAAQ,IAAI,CAAC;EAC/B;EACA,MAAM,SACJ,WAAW,KAAA,IACP,MAAM,IAAI,WAAW,KAAK,SAAS,OAAO,IAC1C,MAAM,IAAI,WAAW,KAAK,SAAS,SAAS,EAAE,OAAO,CAAC;EAC5D,IAAI,OAAO,WAAW,aAAa,OAAO,UAAU,OAAO,OAAO,WAAW,YAAY,WAAW,OAAO,QAAQ;GACjH,MAAM,QAAS,OAAO,OAA8B;GACpD,IAAI,OAAO,MAAM,IAAI,YAAY,cAAc,KAAK;EACtD;EACA,IAAI,KAAK,MAAM,IAAI,MAAM,OAAO,MAAM,GAAG,KAAK,UAAU,MAAM,EAAE,GAAG;OAC9D,IAAI,MAAM,OAAO,MAAM,GAAG,OAAO,OAAO,GAAG;EAChD,OAAO,OAAO,WAAW,aAAa,IAAI,OAAO,WAAW,YAAY,IAAI;CAC9E;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schema-C9QbUW4H.mjs","names":["closed","closed","closed","closed","names","closed"],"sources":["../../../../packages/config/src/schema/policy.ts","../../../../packages/config/src/schema/config.ts","../../../../packages/config/src/schema/manifest.ts","../../../../packages/config/src/schema/ownership.ts","../../../../packages/config/src/schema/skill.ts","../../../../packages/config/src/schema/spec.ts","../../../../packages/config/src/schema/trust.ts"],"sourcesContent":["// Policy DATA shapes (DESIGN 2.6.3, 2.6.4): declared here, evaluated by @cohorte/security. `config` never imports `security`.\nimport { type Static, type TUnsafe, Type } from 'typebox';\n\nconst closed = { additionalProperties: false } as const;\nconst tokens = () => Type.Array(Type.String({ minLength: 1 }));\n\nexport const COMMAND_RULE_ORIGINS = ['builtin', 'project-config', 'project-checks'] as const;\n\n/** DESIGN 2.6.4, verbatim. */\nexport interface CommandRule {\n id: string;\n program: string;\n /** exact tokens, e.g. ['run','test'] */\n subcommand?: readonly string[];\n /** anything not allowed is denied */\n flags?: { allow: readonly string[]; deny?: readonly string[] };\n positionals?:\n | { kind: 'none' }\n | { kind: 'paths-in-worktree'; max: number }\n | { kind: 'enum'; values: readonly string[]; max: number }\n | { kind: 'exact'; values: readonly string[] };\n decision: 'allow' | 'ask' | 'deny';\n when?: { branch?: 'any' | 'unprotected-only'; roles?: readonly string[]; phases?: readonly string[] };\n /** drives recovery (DESIGN 4.1) */\n replay: 'idempotent' | 'at-most-once';\n /** true => denied under L0; under L1 it fails closed in the sandbox */\n network: boolean;\n origin: (typeof COMMAND_RULE_ORIGINS)[number];\n}\n\nconst max = () => Type.Integer({ minimum: 0 });\n\nconst CommandRuleSchema = Type.Object(\n {\n id: Type.String({ minLength: 1 }),\n // A bare program name: a path separator can never name a program (DESIGN 2.6.4 step 1).\n program: Type.String({ pattern: '^[^/\\\\\\\\\\\\s]+$' }),\n subcommand: Type.Optional(tokens()),\n flags: Type.Optional(Type.Object({ allow: tokens(), deny: Type.Optional(tokens()) }, closed)),\n positionals: Type.Optional(\n Type.Union([\n Type.Object({ kind: Type.Literal('none') }, closed),\n Type.Object({ kind: Type.Literal('paths-in-worktree'), max: max() }, closed),\n Type.Object({ kind: Type.Literal('enum'), values: tokens(), max: max() }, closed),\n Type.Object({ kind: Type.Literal('exact'), values: Type.Array(Type.String()) }, closed),\n ]),\n ),\n decision: Type.Union([Type.Literal('allow'), Type.Literal('ask'), Type.Literal('deny')]),\n when: Type.Optional(\n Type.Object(\n {\n branch: Type.Optional(Type.Union([Type.Literal('any'), Type.Literal('unprotected-only')])),\n roles: Type.Optional(tokens()),\n phases: Type.Optional(tokens()),\n },\n closed,\n ),\n ),\n replay: Type.Union([Type.Literal('idempotent'), Type.Literal('at-most-once')]),\n network: Type.Boolean(),\n origin: Type.Union([Type.Literal('builtin'), Type.Literal('project-config'), Type.Literal('project-checks')]),\n },\n closed,\n);\n\n/** [S]. The explicit annotation keeps Biome's type inference out of the union (docs/v3/requests/U0.02.md R1). */\nexport const CommandRule: TUnsafe<CommandRule> = Type.Unsafe<CommandRule>(CommandRuleSchema);\n\n/** [S] DESIGN 2.6.3. Default: deny-outgoing + deny. */\nexport const SymlinkPolicy = Type.Object(\n {\n mode: Type.Union([Type.Literal('deny-outgoing'), Type.Literal('deny-all'), Type.Literal('allow')]),\n hardlinksOnWrite: Type.Union([Type.Literal('deny'), Type.Literal('allow')]),\n },\n closed,\n);\nexport type SymlinkPolicy = Static<typeof SymlinkPolicy>;\n\n/**\n * [S] What stage 4 evaluates for `network_request`. V3.0 has exactly one value: the tool is registered and always\n * denied (DESIGN 2.6.2, §9 \"proxy-based host allowlisting\" is out). The shape exists so a later version can add\n * an allowlist without moving the type.\n */\nexport const NetworkPolicyConfig = Type.Object({ default: Type.Literal('deny') }, closed);\nexport type NetworkPolicyConfig = Static<typeof NetworkPolicyConfig>;\n\nexport const DEFAULT_SYMLINK_POLICY: SymlinkPolicy = Object.freeze({ mode: 'deny-outgoing', hardlinksOnWrite: 'deny' });\nexport const DEFAULT_NETWORK_POLICY: NetworkPolicyConfig = Object.freeze({ default: 'deny' });\n","// `.cohorte/config.yaml` (DESIGN 2.10). NO open question of spec 32 is frozen as a literal type: `runtime.id`,\n// provider names and role keys are open strings; what 3.0 accepts among them is a LOADER rule, not a schema rule.\nimport { AuthMode, BudgetCounters, ID_PATTERN, ModelCapability, ModelRef, ThinkingLevel } from '@cohorte/base';\nimport { ActivePipelineState, type CohorteRole, EscalationPolicy } from '@cohorte/protocol';\nimport { type TUnsafe, Type } from 'typebox';\nimport { CommandRule, DEFAULT_SYMLINK_POLICY, SymlinkPolicy } from './policy.ts';\n\nconst closed = { additionalProperties: false } as const;\n\n/** The ONLY env channel of a provisioning effect (DESIGN 5.7): a closed allowlist of NAMES. */\nexport const PROVISION_ENV_NAMES = [\n 'npm_config_store_dir',\n 'npm_config_cache',\n 'YARN_CACHE_FOLDER',\n 'COREPACK_HOME',\n] as const;\nexport type ProvisionEnvName = (typeof PROVISION_ENV_NAMES)[number];\n\nexport interface TierTarget {\n ref: ModelRef;\n thinking: ThinkingLevel;\n}\nexport interface ApprovalsConfig {\n unattended: 'deny' | 'wait';\n expiryMinutes?: number;\n /** 10 */\n parkAfterMinutes: number;\n ship: 'human' | 'auto';\n notify: boolean;\n /** approve may spawn a host */\n autoResume: boolean;\n}\n\n/** DESIGN 2.10, verbatim. [S] schemas/config.schema.json */\nexport interface CohorteConfig {\n schemaVersion: 1;\n project: { id: string; defaultBranch: string; protectedBranches: string[] };\n runtime: { id: string /* 'pi' | 'fake' */; pi?: { loadFrom: 'package' | 'bundle' } };\n authentication: {\n mode: AuthMode;\n allowApiKeys: boolean;\n /** D2: all three true; accounted METERED (DESIGN 3.7) */\n anthropicSubscriptionViaPi?: {\n enabled: boolean;\n acknowledgePerTokenBilling: boolean;\n acknowledgeProviderTermsRisk: boolean;\n };\n };\n routing: {\n allowedProviders: string[];\n defaults: Partial<Record<CohorteRole, ModelCapability>>;\n tiers: Partial<Record<ModelCapability, TierTarget>>;\n escalation: EscalationPolicy;\n fallback: { enabled: boolean };\n };\n budgets: {\n run: BudgetCounters;\n phase: BudgetCounters;\n agent: BudgetCounters;\n provider: Record<string, BudgetCounters>;\n tool: Record<string, BudgetCounters>;\n /** 3 */\n concurrency: number;\n /** 5 */\n maxIncarnations: number;\n };\n loop: {\n maxFixRounds: number;\n noProgressWindow: number;\n maxDeniedCallsPerAgent: number;\n leftovers: Record<'major' | 'minor' | 'info', 'fix' | 'park' | 'ask'>;\n };\n /** argv arrays */\n checks: { typecheck?: string[]; lint?: string[]; test?: string[]; timeoutMs: number };\n provision: {\n argv?: string[];\n network: boolean;\n cacheDirs: string[];\n lockfiles: string[];\n env: Partial<Record<ProvisionEnvName, string>>;\n // default: every node_modules directory; read-only for agent commands and checks\n dependencyDirs: string[];\n /** writable, excluded from the dependency manifest, wiped before every check sequence */\n writableCaches: string[];\n };\n policy: {\n commands: { allow: CommandRule[]; ask: CommandRule[]; deny: CommandRule[] };\n dangerousCommands: CommandRule[];\n symlinks: SymlinkPolicy;\n approvals: ApprovalsConfig;\n /** default ask: an in-doubt effect needs a human ack before the agent continues (DESIGN 4.4) */\n inDoubt: 'ask' | 'continue';\n skip: ActivePipelineState[];\n steer: { enabled: boolean };\n admin: { runTool: boolean };\n quota: { autoResume: boolean };\n };\n host: { idleExitMinutes: number; pauseKeepAliveMinutes: number; pollMs: number };\n /** forward HTTP(S)_PROXY to the brain; default false */\n network: { proxyEnv: boolean };\n /** `require` absent = the computed default of DESIGN 2.6.6 */\n sandbox: { require?: 'native' | 'best-effort'; brain: 'os-if-available' | 'os' | 'process' };\n git: {\n worktreeRoot?: string;\n branchPrefix: string;\n commitIdentity: 'user' | 'cohorte';\n keepWorktrees: 'on-failure' | 'always' | 'never';\n };\n retention: {\n transcriptsDays: number;\n eventsDays: number | 'forever';\n artifactsDays: number;\n compressAfterDays: number;\n };\n /** default false; `true` is rejected by the LOADER in 3.0 (configuration/telemetry-remote-unavailable, ADR-0013) */\n telemetry: { remote: boolean };\n}\n\nconst oneOf = <const V extends readonly string[]>(values: V): TUnsafe<V[number]> =>\n Type.Unsafe<V[number]>({ type: 'string', enum: [...values] });\nconst count = (minimum = 0) => Type.Integer({ minimum });\nconst argv = () => Type.Array(Type.String(), { minItems: 1 });\nconst strings = () => Type.Array(Type.String({ minLength: 1 }));\nconst rules = () => Type.Array(CommandRule);\n// Explicit return types: a `Static<TRecord>` that Biome has to infer overflows its stack (docs/v3/requests/U0.03.md R1).\nconst budgetMap = (): TUnsafe<Record<string, BudgetCounters>> =>\n Type.Unsafe<Record<string, BudgetCounters>>(Type.Record(Type.String(), BudgetCounters));\nconst roleDefaults = (): TUnsafe<Partial<Record<CohorteRole, ModelCapability>>> =>\n Type.Unsafe<Partial<Record<CohorteRole, ModelCapability>>>(Type.Record(Type.String(), ModelCapability));\nconst tier = () => Type.Optional(Type.Object({ ref: ModelRef, thinking: ThinkingLevel }, closed));\nconst envValue = () => Type.Optional(Type.String({ minLength: 1 }));\nconst leftover = () => oneOf(['fix', 'park', 'ask']);\n\nconst CohorteConfigSchema = Type.Object(\n {\n schemaVersion: Type.Literal(1),\n project: Type.Object(\n {\n id: Type.String({ pattern: ID_PATTERN }),\n defaultBranch: Type.String({ minLength: 1 }),\n protectedBranches: strings(),\n },\n closed,\n ),\n runtime: Type.Object(\n {\n id: Type.String({ minLength: 1 }),\n pi: Type.Optional(Type.Object({ loadFrom: oneOf(['package', 'bundle']) }, closed)),\n },\n closed,\n ),\n authentication: Type.Object(\n {\n mode: AuthMode,\n allowApiKeys: Type.Boolean(),\n anthropicSubscriptionViaPi: Type.Optional(\n Type.Object(\n {\n enabled: Type.Boolean(),\n acknowledgePerTokenBilling: Type.Boolean(),\n acknowledgeProviderTermsRisk: Type.Boolean(),\n },\n closed,\n ),\n ),\n },\n closed,\n ),\n routing: Type.Object(\n {\n allowedProviders: strings(),\n defaults: roleDefaults(),\n tiers: Type.Object({ fast: tier(), coding: tier(), reasoning: tier(), vision: tier(), cheap: tier() }, closed),\n escalation: EscalationPolicy,\n fallback: Type.Object({ enabled: Type.Boolean() }, closed),\n },\n closed,\n ),\n budgets: Type.Object(\n {\n run: BudgetCounters,\n phase: BudgetCounters,\n agent: BudgetCounters,\n provider: budgetMap(),\n tool: budgetMap(),\n concurrency: count(1),\n maxIncarnations: count(1),\n },\n closed,\n ),\n loop: Type.Object(\n {\n maxFixRounds: count(),\n noProgressWindow: count(1),\n maxDeniedCallsPerAgent: count(),\n leftovers: Type.Object({ major: leftover(), minor: leftover(), info: leftover() }, closed),\n },\n closed,\n ),\n checks: Type.Object(\n {\n typecheck: Type.Optional(argv()),\n lint: Type.Optional(argv()),\n test: Type.Optional(argv()),\n timeoutMs: count(1),\n },\n closed,\n ),\n provision: Type.Object(\n {\n argv: Type.Optional(argv()),\n network: Type.Boolean(),\n cacheDirs: strings(),\n lockfiles: strings(),\n env: Type.Object(\n {\n npm_config_store_dir: envValue(),\n npm_config_cache: envValue(),\n YARN_CACHE_FOLDER: envValue(),\n COREPACK_HOME: envValue(),\n },\n closed,\n ),\n dependencyDirs: strings(),\n writableCaches: strings(),\n },\n closed,\n ),\n policy: Type.Object(\n {\n commands: Type.Object({ allow: rules(), ask: rules(), deny: rules() }, closed),\n dangerousCommands: rules(),\n symlinks: SymlinkPolicy,\n approvals: Type.Object(\n {\n unattended: oneOf(['deny', 'wait']),\n expiryMinutes: Type.Optional(count(1)),\n parkAfterMinutes: count(),\n ship: oneOf(['human', 'auto']),\n notify: Type.Boolean(),\n autoResume: Type.Boolean(),\n },\n closed,\n ),\n inDoubt: oneOf(['ask', 'continue']),\n skip: Type.Array(ActivePipelineState),\n steer: Type.Object({ enabled: Type.Boolean() }, closed),\n admin: Type.Object({ runTool: Type.Boolean() }, closed),\n quota: Type.Object({ autoResume: Type.Boolean() }, closed),\n },\n closed,\n ),\n host: Type.Object({ idleExitMinutes: count(), pauseKeepAliveMinutes: count(), pollMs: count(1) }, closed),\n network: Type.Object({ proxyEnv: Type.Boolean() }, closed),\n sandbox: Type.Object(\n {\n require: Type.Optional(oneOf(['native', 'best-effort'])),\n brain: oneOf(['os-if-available', 'os', 'process']),\n },\n closed,\n ),\n git: Type.Object(\n {\n worktreeRoot: Type.Optional(Type.String({ minLength: 1 })),\n branchPrefix: Type.String({ minLength: 1 }),\n commitIdentity: oneOf(['user', 'cohorte']),\n keepWorktrees: oneOf(['on-failure', 'always', 'never']),\n },\n closed,\n ),\n retention: Type.Object(\n {\n transcriptsDays: count(),\n eventsDays: Type.Union([count(), Type.Literal('forever')]),\n artifactsDays: count(),\n compressAfterDays: count(),\n },\n closed,\n ),\n telemetry: Type.Object({ remote: Type.Boolean() }, closed),\n },\n closed,\n);\n\n/** [S]. Annotated on purpose: Biome must not infer this type (docs/v3/requests/U0.02.md R1, U0.05.md R1). */\nexport const CohorteConfig: TUnsafe<CohorteConfig> = Type.Unsafe<CohorteConfig>(CohorteConfigSchema);\n\nfunction deepFreeze<T>(value: T): T {\n if (typeof value === 'object' && value !== null && !Object.isFrozen(value)) {\n Object.freeze(value);\n for (const member of Object.values(value)) deepFreeze(member);\n }\n return value;\n}\n\nconst MINUTE = 60_000;\n\n/**\n * The lowest layer of the load order (DESIGN 2.10): shipped defaults < user file < project file < CLI flags.\n * `project.id` is a placeholder that `cohorte init` always replaces. DESIGN gives the numbers it cares about\n * (concurrency 3, maxIncarnations 5, loop 5/3/5, host 30/30/250, parkAfterMinutes 10); the budget and retention\n * figures are provisional defaults of this file.\n */\nexport const DEFAULT_CONFIG: CohorteConfig = deepFreeze<CohorteConfig>({\n schemaVersion: 1,\n project: { id: 'project', defaultBranch: 'main', protectedBranches: ['main', 'master'] },\n runtime: { id: 'pi', pi: { loadFrom: 'package' } },\n authentication: { mode: 'subscription', allowApiKeys: false },\n routing: {\n allowedProviders: ['openai-codex'],\n defaults: { implementer: 'coding', fixer: 'coding', reviewer: 'reasoning', 'security-reviewer': 'reasoning' },\n tiers: {\n coding: { ref: { provider: 'openai-codex', model: 'gpt-5.5', capability: 'coding' }, thinking: 'medium' },\n reasoning: { ref: { provider: 'openai-codex', model: 'gpt-5.5', capability: 'reasoning' }, thinking: 'high' },\n fast: { ref: { provider: 'openai-codex', model: 'gpt-5.4-mini', capability: 'fast' }, thinking: 'low' },\n cheap: { ref: { provider: 'openai-codex', model: 'gpt-5.4-mini', capability: 'cheap' }, thinking: 'low' },\n },\n escalation: { sameFailureCount: 2, ladder: [{ kind: 'human' }], maxPerRun: 2 },\n fallback: { enabled: false },\n },\n budgets: {\n run: { modelRequests: 2000, toolCalls: 10_000, wallClockMs: 360 * MINUTE },\n phase: { wallClockMs: 120 * MINUTE },\n agent: { modelRequests: 200, toolCalls: 400, wallClockMs: 45 * MINUTE, contextTokens: 200_000 },\n provider: {},\n tool: {},\n concurrency: 3,\n maxIncarnations: 5,\n },\n loop: {\n maxFixRounds: 5,\n noProgressWindow: 3,\n maxDeniedCallsPerAgent: 5,\n leftovers: { major: 'fix', minor: 'park', info: 'park' },\n },\n checks: { timeoutMs: 10 * MINUTE },\n provision: {\n network: false,\n cacheDirs: [],\n lockfiles: ['pnpm-lock.yaml', 'package-lock.json', 'yarn.lock'],\n env: {},\n dependencyDirs: ['**/node_modules'],\n writableCaches: ['node_modules/.cache', 'node_modules/.vite', 'node_modules/.vitest', 'node_modules/.vite-temp'],\n },\n policy: {\n commands: { allow: [], ask: [], deny: [] },\n dangerousCommands: [],\n symlinks: { ...DEFAULT_SYMLINK_POLICY },\n approvals: { unattended: 'deny', parkAfterMinutes: 10, ship: 'human', notify: false, autoResume: false },\n inDoubt: 'ask',\n skip: [],\n steer: { enabled: false },\n admin: { runTool: false },\n quota: { autoResume: false },\n },\n host: { idleExitMinutes: 30, pauseKeepAliveMinutes: 30, pollMs: 250 },\n network: { proxyEnv: false },\n sandbox: { brain: 'os-if-available' },\n git: { branchPrefix: 'cohorte/', commitIdentity: 'user', keepWorktrees: 'on-failure' },\n retention: { transcriptsDays: 30, eventsDays: 'forever', artifactsDays: 90, compressAfterDays: 7 },\n telemetry: { remote: false },\n});\n","// `.cohorte/manifest.yaml` (DESIGN 2.10): the detection marker and the previous-hash guard of spec 14.\nimport { Sha256 } from '@cohorte/base';\nimport { type Static, Type } from 'typebox';\n\nconst closed = { additionalProperties: false } as const;\n\nexport const GeneratedFile = Type.Object(\n {\n /** `.cohorte`-relative POSIX path */\n path: Type.String({ minLength: 1 }),\n templateId: Type.String({ minLength: 1 }),\n templateSha256: Sha256,\n /** a generated file is replaced only if its CURRENT hash equals this one */\n renderedSha256: Sha256,\n },\n closed,\n);\nexport type GeneratedFile = Static<typeof GeneratedFile>;\n\n/** [S] */\nexport const Manifest = Type.Object(\n {\n schemaVersion: Type.Literal(1),\n cohorteVersion: Type.String({ minLength: 1 }),\n createdWith: Type.String({ minLength: 1 }),\n protocol: Type.Object({ min: Type.String({ minLength: 1 }), max: Type.String({ minLength: 1 }) }, closed),\n stateSchemaVersion: Type.Integer({ minimum: 0 }),\n generated: Type.Array(GeneratedFile),\n },\n closed,\n);\nexport type Manifest = Static<typeof Manifest>;\n","// `.cohorte/ownership.yaml` (DESIGN 2.10): surfaces, their paths, owners and reviewers.\nimport { ID_PATTERN } from '@cohorte/base';\nimport { type TUnsafe, Type } from 'typebox';\n\nconst closed = { additionalProperties: false } as const;\n\n/** The one surface whose paths may overlap any other surface's (DESIGN 2.10, 5.6). */\nexport const SHARED_SURFACE_ID = 'shared';\n\nexport interface Surface {\n /** worktree-relative POSIX globs */\n paths: string[];\n /** role ids allowed to WRITE the surface */\n owners: string[];\n reviewers: string[];\n /** a write to one of these paths is an `ask` (DESIGN 5.6) */\n approval?: 'human';\n}\nexport interface Ownership {\n surfaces: Record<string, Surface>;\n}\n\nconst names = () => Type.Array(Type.String({ minLength: 1 }));\nconst SurfaceSchema = Type.Object(\n {\n paths: Type.Array(Type.String({ minLength: 1 }), { minItems: 1 }),\n owners: names(),\n reviewers: names(),\n approval: Type.Optional(Type.Literal('human')),\n },\n closed,\n);\nconst OwnershipSchema = Type.Object(\n { surfaces: Type.Record(Type.String({ pattern: ID_PATTERN }), SurfaceSchema) },\n closed,\n);\n\n/** [S]. Annotated: a `Static<TRecord>` inferred by Biome overflows its stack (docs/v3/requests/U0.03.md R1). */\nexport const Ownership: TUnsafe<Ownership> = Type.Unsafe<Ownership>(OwnershipSchema);\n\nconst GLOB_META = /[*?[\\]{}()!]/;\n\n/** The literal prefix of a glob, by path SEGMENT: the segments before the first one holding a glob metacharacter (DESIGN 5.6). */\nexport function literalPrefixOf(pattern: string): string[] {\n const prefix: string[] = [];\n for (const segment of pattern.split('/')) {\n if (segment === '' || segment === '.') continue;\n if (GLOB_META.test(segment)) break;\n prefix.push(segment);\n }\n return prefix;\n}\n\nconst isSegmentAncestorOrEqual = (a: readonly string[], b: readonly string[]): boolean =>\n a.length <= b.length && a.every((segment, index) => segment === b[index]);\n\n/** Two patterns overlap when one literal prefix is a segment-ancestor of (or equal to) the other; no literal prefix overlaps everything. */\nexport function patternsOverlap(a: string, b: string): boolean {\n const left = literalPrefixOf(a);\n const right = literalPrefixOf(b);\n return isSegmentAncestorOrEqual(left, right) || isSegmentAncestorOrEqual(right, left);\n}\n\nexport interface OwnershipProblem {\n /** JSON pointer into the ownership document */\n path: string;\n message: string;\n}\n\n/**\n * The rule a JSON Schema cannot say: every surface path is DISJOINT from the paths of every other surface, unless\n * one of the two surfaces is `shared`. Conservative on purpose (prefix overlap, not glob intersection): a false\n * \"overlap\" costs an edit of ownership.yaml, a missed one lets two agents write the same file.\n */\nexport function ownershipProblems(ownership: Ownership): OwnershipProblem[] {\n const problems: OwnershipProblem[] = [];\n const entries = Object.entries(ownership.surfaces).filter(([id]) => id !== SHARED_SURFACE_ID);\n entries.forEach(([id, surface], at) => {\n for (const [otherId, other] of entries.slice(at + 1)) {\n surface.paths.forEach((path, index) => {\n const clash = other.paths.find((candidate) => patternsOverlap(path, candidate));\n if (clash !== undefined) {\n problems.push({\n path: `/surfaces/${id}/paths/${index}`,\n message: `\"${path}\" of surface \"${id}\" overlaps \"${clash}\" of surface \"${otherId}\": make them disjoint or move the path to the \"${SHARED_SURFACE_ID}\" surface`,\n });\n }\n });\n }\n });\n return problems;\n}\n","// `.cohorte/skills/<id>/skill.yaml` (DESIGN 2.10, ADR-0011). Spec 8 with ONE change: `checks[].command`, a shell\n// string, becomes `argv` (D-25, I3). Checks are declarative in V3.0: never run, and they create no CommandRule.\nimport { ID_PATTERN } from '@cohorte/base';\nimport { type Static, Type } from 'typebox';\n\nconst closed = { additionalProperties: false } as const;\nconst names = () => Type.Optional(Type.Array(Type.String({ minLength: 1 })));\n\n/** [S] schemas/skill.schema.json */\nexport const SkillManifest = Type.Object(\n {\n id: Type.String({ pattern: ID_PATTERN }),\n version: Type.String({ minLength: 1 }),\n /** matched against the Project Model, deterministically */\n appliesWhen: Type.Object(\n { languages: names(), frameworks: names(), packageManagers: names(), roles: names() },\n closed,\n ),\n /** relative path of the Markdown, inside the skill directory */\n prompt: Type.String({ minLength: 1 }),\n checks: Type.Optional(\n Type.Array(\n Type.Object(\n { name: Type.Optional(Type.String({ minLength: 1 })), argv: Type.Array(Type.String(), { minItems: 1 }) },\n closed,\n ),\n ),\n ),\n /** reserved (ADR-0011): no signature is verified in V3.0 */\n signature: Type.Optional(Type.String()),\n /** reserved (ADR-0011) */\n source: Type.Optional(Type.String()),\n },\n closed,\n);\nexport type SkillManifest = Static<typeof SkillManifest>;\n","// `.cohorte/specs/<id>.yaml` (DESIGN 2.10): a feature or a patch, draft or frozen; immutable once frozen.\nimport { canonicalJson, ID_PATTERN, type JsonValue, Sha256, sha256Hex } from '@cohorte/base';\nimport { type TUnsafe, Type } from 'typebox';\n\nconst closed = { additionalProperties: false } as const;\n\ninterface SpecBody {\n id: string;\n kind: 'feature' | 'patch';\n title: string;\n acceptance: string[];\n surfaces: Record<string, { tasks: string[] }>;\n /** worktree-relative path of the contract file */\n contract?: string;\n openQuestions: string[];\n patch?: { repro: string; regressionTest: string; causeConfirmed: boolean };\n}\nexport interface DraftSpec extends SpecBody {\n status: 'draft';\n}\nexport interface FrozenSpec extends SpecBody {\n status: 'frozen';\n /** sha256 of the canonical JSON of the spec WITHOUT `status` and `sha256`: see {@link specContentSha256} */\n sha256: Sha256;\n}\nexport type Spec = DraftSpec | FrozenSpec;\n\nconst texts = () => Type.Array(Type.String({ minLength: 1 }));\nconst body = {\n id: Type.String({ pattern: ID_PATTERN }),\n kind: Type.Union([Type.Literal('feature'), Type.Literal('patch')]),\n title: Type.String({ minLength: 1 }),\n acceptance: texts(),\n surfaces: Type.Record(Type.String({ pattern: ID_PATTERN }), Type.Object({ tasks: texts() }, closed)),\n contract: Type.Optional(Type.String({ minLength: 1 })),\n openQuestions: texts(),\n patch: Type.Optional(\n Type.Object({ repro: Type.String(), regressionTest: Type.String(), causeConfirmed: Type.Boolean() }, closed),\n ),\n};\nconst SpecSchema = Type.Union([\n Type.Object({ ...body, status: Type.Literal('draft') }, closed),\n Type.Object({ ...body, status: Type.Literal('frozen'), sha256: Sha256 }, closed),\n]);\n\n/** [S]. A frozen spec WITHOUT a sha256, and a draft WITH one, are both invalid. */\nexport const Spec: TUnsafe<Spec> = Type.Unsafe<Spec>(SpecSchema);\n\n/** What freezing signs: everything a human wrote, nothing the freeze itself adds. */\nexport function specContentSha256(spec: Spec): Sha256 {\n const content: Record<string, JsonValue> = {};\n for (const [key, value] of Object.entries(spec)) {\n if (key !== 'status' && key !== 'sha256' && value !== undefined) content[key] = value as JsonValue;\n }\n return sha256Hex(canonicalJson(content));\n}\n\nexport interface SpecProblem {\n path: string;\n message: string;\n}\n\n/** A frozen spec rejects edits: its content must still hash to the sha256 it was frozen with. A draft has nothing to prove. */\nexport function frozenSpecProblems(spec: Spec): SpecProblem[] {\n if (spec.status !== 'frozen') return [];\n const actual = specContentSha256(spec);\n if (actual === spec.sha256) return [];\n return [\n {\n path: '/sha256',\n message: `spec \"${spec.id}\" is frozen and was edited: content hashes to ${actual}, frozen as ${spec.sha256}. Revert the edit, or write a new spec`,\n },\n ];\n}\n","// What the repository may decide, and what only the local user may decide (DESIGN 2.10.1, ADR-0026): the key-trust\n// classification as frozen DATA, the trust record, and the TrustStore PORT that `security` implements and the\n// loader consumes (`config` may not import `security`).\nimport { IsoInstant, type JsonValue, Sha256 } from '@cohorte/base';\nimport { type TUnsafe, Type } from 'typebox';\n\nexport const TRUST_CLASSES = ['tighten-only', 'loosen', 'neutral'] as const;\nexport type TrustClass = (typeof TRUST_CLASSES)[number];\n\nexport interface ConfigKeyTrustRule {\n /**\n * JSON pointer into `CohorteConfig`. A rule covers the key it names AND its whole subtree. Rules are prefix-disjoint:\n * no pointer is an ancestor of another one, so a key has exactly one class.\n */\n pointer: string;\n class: TrustClass;\n /**\n * Only on a `loosen` rule whose class depends on the VALUE (DESIGN 2.10.1: `sandbox.require: best-effort`,\n * `policy.symlinks` towards `allow`, ...): the values that loosen. Every other value of the key is `tighten-only`.\n */\n loosenOnly?: readonly JsonValue[];\n}\n\nconst tighten = (pointer: string): ConfigKeyTrustRule => Object.freeze({ pointer, class: 'tighten-only' });\nconst neutral = (pointer: string): ConfigKeyTrustRule => Object.freeze({ pointer, class: 'neutral' });\nconst loosen = (pointer: string, ...loosenOnly: JsonValue[]): ConfigKeyTrustRule =>\n Object.freeze(\n loosenOnly.length === 0\n ? { pointer, class: 'loosen' }\n : { pointer, class: 'loosen', loosenOnly: Object.freeze(loosenOnly) },\n );\n\n/** DESIGN 2.10.1, as data. TOTAL over `CohorteConfig` (a unit test enumerates the schema). */\nexport const CONFIG_KEY_TRUST: readonly ConfigKeyTrustRule[] = Object.freeze([\n neutral('/schemaVersion'),\n neutral('/project'),\n neutral('/runtime/id'),\n loosen('/runtime/pi'),\n neutral('/authentication/mode'),\n loosen('/authentication/allowApiKeys'),\n loosen('/authentication/anthropicSubscriptionViaPi'),\n loosen('/routing/allowedProviders'),\n neutral('/routing/defaults'),\n neutral('/routing/tiers'),\n neutral('/routing/escalation'),\n loosen('/routing/fallback'),\n tighten('/budgets'),\n tighten('/loop'),\n loosen('/checks'),\n loosen('/provision/argv'),\n loosen('/provision/network'),\n loosen('/provision/cacheDirs'),\n neutral('/provision/lockfiles'),\n loosen('/provision/env'),\n loosen('/provision/dependencyDirs'),\n loosen('/provision/writableCaches'),\n loosen('/policy/commands/allow'),\n tighten('/policy/commands/ask'),\n tighten('/policy/commands/deny'),\n loosen('/policy/dangerousCommands'),\n loosen('/policy/symlinks/mode', 'allow'),\n loosen('/policy/symlinks/hardlinksOnWrite', 'allow'),\n loosen('/policy/approvals/unattended', 'wait'),\n tighten('/policy/approvals/expiryMinutes'),\n tighten('/policy/approvals/parkAfterMinutes'),\n loosen('/policy/approvals/ship', 'auto'),\n neutral('/policy/approvals/notify'),\n loosen('/policy/approvals/autoResume'),\n loosen('/policy/inDoubt', 'continue'),\n loosen('/policy/skip'),\n loosen('/policy/steer'),\n loosen('/policy/admin'),\n neutral('/policy/quota'),\n neutral('/host'),\n loosen('/network/proxyEnv'),\n loosen('/sandbox/require', 'best-effort'),\n loosen('/sandbox/brain', 'process'),\n loosen('/git/worktreeRoot'),\n neutral('/git/branchPrefix'),\n neutral('/git/commitIdentity'),\n neutral('/git/keepWorktrees'),\n tighten('/retention'),\n neutral('/telemetry'),\n]);\n\nconst covers = (rule: ConfigKeyTrustRule, pointer: string): boolean =>\n pointer === rule.pointer || pointer.startsWith(`${rule.pointer}/`);\n\n/** Every rule that covers `pointer`. The data is total and prefix-disjoint, so this has exactly one member for a real key. */\nexport function trustRulesFor(pointer: string): ConfigKeyTrustRule[] {\n return CONFIG_KEY_TRUST.filter((rule) => covers(rule, pointer));\n}\n\n/**\n * The class of one key of the PROJECT file. `value` decides for the keys classed by value; without it such a key is\n * reported `loosen` (fail closed). An unknown key is `loosen` too: nothing unclassified is ever honoured silently.\n */\nexport function trustClassOf(pointer: string, value?: JsonValue): TrustClass {\n const [rule, ...others] = trustRulesFor(pointer);\n if (rule === undefined || others.length > 0) return 'loosen';\n if (rule.class !== 'loosen' || rule.loosenOnly === undefined || value === undefined) return rule.class;\n if (pointer !== rule.pointer) return 'loosen';\n return rule.loosenOnly.some((candidate) => candidate === value) ? 'loosen' : 'tighten-only';\n}\n\n/** One file per project: `~/.cohorte/trust/<projectKeyId>.json`, `0600` in a `0700` directory, a protected root. */\nexport interface TrustRecord {\n /** sha256(canonicalJson(the project file's values for every loosen-class key + ownership.yaml)) */\n policySha256: Sha256;\n /** JSON pointers of the loosening keys the user saw and accepted */\n loosenedKeys: string[];\n grantedAt: IsoInstant;\n /** a label for the audit trail (the OS user name); the MAC proves \"a key holder\", never which one (ADR-0022) */\n grantedBy: string;\n /** HMAC-SHA256 with the project key over the canonical JSON of the record minus `mac` */\n mac: string;\n}\n\n/**\n * [S]. The type is written by hand and the const annotated: a `Promise<Static<...>>` that Biome has to resolve for\n * nursery/noFloatingPromises overflows its stack, and a crashed Biome exits 0 (docs/v3/requests/U0.02.md R1).\n */\nexport const TrustRecord: TUnsafe<TrustRecord> = Type.Unsafe<TrustRecord>(\n Type.Object(\n {\n policySha256: Sha256,\n loosenedKeys: Type.Array(Type.String()),\n grantedAt: IsoInstant,\n grantedBy: Type.String({ minLength: 1 }),\n mac: Type.String({ minLength: 1 }),\n },\n { additionalProperties: false },\n ),\n);\n\nexport interface TrustGrant {\n policySha256: Sha256;\n loosenedKeys: string[];\n grantedBy: string;\n}\n\n/**\n * PORT (file implementation: `@cohorte/security/auth`, `createTrustStore`). A record with a bad MAC or wrong file\n * modes is ABSENT: `lookup` fails closed.\n */\nexport interface TrustStore {\n /** The record, only if it is authentic AND was granted for exactly this policy hash. */\n lookup(projectKeyId: string, policySha256: Sha256): Promise<TrustRecord | undefined>;\n grant(projectKeyId: string, grant: TrustGrant): Promise<TrustRecord>;\n /** false = there was nothing to revoke */\n revoke(projectKeyId: string): Promise<boolean>;\n}\n"],"mappings":";;;;;AAGA,MAAMA,WAAS,EAAE,sBAAsB,MAAM;AAC7C,MAAM,eAAe,KAAK,MAAM,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;AA0B7D,MAAM,YAAY,KAAK,QAAQ,EAAE,SAAS,EAAE,CAAC;AAE7C,MAAM,oBAAoB,KAAK,OAC7B;CACE,IAAI,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CAEhC,SAAS,KAAK,OAAO,EAAE,SAAS,iBAAiB,CAAC;CAClD,YAAY,KAAK,SAAS,OAAO,CAAC;CAClC,OAAO,KAAK,SAAS,KAAK,OAAO;EAAE,OAAO,OAAO;EAAG,MAAM,KAAK,SAAS,OAAO,CAAC;CAAE,GAAGA,QAAM,CAAC;CAC5F,aAAa,KAAK,SAChB,KAAK,MAAM;EACT,KAAK,OAAO,EAAE,MAAM,KAAK,QAAQ,MAAM,EAAE,GAAGA,QAAM;EAClD,KAAK,OAAO;GAAE,MAAM,KAAK,QAAQ,mBAAmB;GAAG,KAAK,IAAI;EAAE,GAAGA,QAAM;EAC3E,KAAK,OAAO;GAAE,MAAM,KAAK,QAAQ,MAAM;GAAG,QAAQ,OAAO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ACf,OAAO,mBAAmB;CAC1B,OAAO,oBAAoB,aAAa;CACxC,OAAO,kBAAkB,SAAS;CAClC,OAAO,mBAAmB;CAC1B,QAAQ,mBAAmB;CAC3B,QAAQ,qBAAqB;CAC7B,QAAQ,oBAAoB;CAC5B,QAAQ,YAAY;CACpB,QAAQ,YAAY;AACtB,CAAC;AAuCgD,KAAK,OACpD,KAAK,OACH;CACE,cAAc;CACd,cAAc,KAAK,MAAM,KAAK,OAAO,CAAC;CACtC,WAAW;CACX,WAAW,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CACvC,KAAK,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AACnC,GACA,EAAE,sBAAsB,MAAM,CAChC,CACF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//#region src/commands/ship/index.ts
|
|
2
|
-
const ship = {
|
|
3
|
-
verb: "ship",
|
|
4
|
-
async run(ctx, args) {
|
|
5
|
-
const [runId, approvalId] = args.positionals;
|
|
6
|
-
if (!runId || !approvalId) return 2;
|
|
7
|
-
const result = await ctx.controller.send("approve", {
|
|
8
|
-
approvalId,
|
|
9
|
-
scope: "run",
|
|
10
|
-
answer: "ship"
|
|
11
|
-
}, { runId });
|
|
12
|
-
ctx.stdio.stdout.write(`${JSON.stringify(result)}\n`);
|
|
13
|
-
return result.status === "rejected" ? 3 : result.status === "pending" ? 4 : 0;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
//#endregion
|
|
17
|
-
export { ship as default };
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=ship-DTuLGoaJ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ship-DTuLGoaJ.mjs","names":[],"sources":["../../../../apps/cli/src/commands/ship/index.ts"],"sourcesContent":["// apps/cli/src/commands/ship/index.ts — DESIGN §9 verb `ship` (PLAN §3 rule 3 \"later units fill\n// stub files that lie inside their owned paths; they never edit ... the registry\"). Wave-0 stub: exits with the\n// documented not-available error (spec 24 `configuration/phase-not-available`); filled by the Wave-4/5\n// unit that owns `apps/cli/src/commands/ship/**`.\nimport type { CommandModule } from '../../contract/index.ts';\n\nconst ship: CommandModule = {\n verb: 'ship',\n async run(ctx, args) {\n const [runId, approvalId] = args.positionals;\n if (!runId || !approvalId) return 2;\n const result = await ctx.controller.send(\n 'approve',\n { approvalId: approvalId as never, scope: 'run', answer: 'ship' },\n { runId },\n );\n ctx.stdio.stdout.write(`${JSON.stringify(result)}\\n`);\n return result.status === 'rejected' ? 3 : result.status === 'pending' ? 4 : 0;\n },\n};\n\nexport default ship;\n"],"mappings":";AAMA,MAAM,OAAsB;CAC1B,MAAM;CACN,MAAM,IAAI,KAAK,MAAM;EACnB,MAAM,CAAC,OAAO,cAAc,KAAK;EACjC,IAAI,CAAC,SAAS,CAAC,YAAY,OAAO;EAClC,MAAM,SAAS,MAAM,IAAI,WAAW,KAClC,WACA;GAAc;GAAqB,OAAO;GAAO,QAAQ;EAAO,GAChE,EAAE,MAAM,CACV;EACA,IAAI,MAAM,OAAO,MAAM,GAAG,KAAK,UAAU,MAAM,EAAE,GAAG;EACpD,OAAO,OAAO,WAAW,aAAa,IAAI,OAAO,WAAW,YAAY,IAAI;CAC9E;AACF"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { r as loadSpec, t as freezeSpec } from "./src-DcU4IXMe.mjs";
|
|
2
|
-
import { writeFile } from "node:fs/promises";
|
|
3
|
-
import { stringify } from "yaml";
|
|
4
|
-
//#region src/commands/spec/index.ts
|
|
5
|
-
const spec = {
|
|
6
|
-
verb: "spec",
|
|
7
|
-
async run(ctx, args) {
|
|
8
|
-
const file = args.positionals.find((value) => !value.startsWith("--"));
|
|
9
|
-
if (!file) return 2;
|
|
10
|
-
const frozen = args.subVerb === "freeze";
|
|
11
|
-
const value = frozen ? await freezeSpec(file) : await loadSpec(file);
|
|
12
|
-
if (frozen) await writeFile(file, stringify(value));
|
|
13
|
-
ctx.stdio.stdout.write(`${JSON.stringify(value)}\n`);
|
|
14
|
-
return 0;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
//#endregion
|
|
18
|
-
export { spec as default };
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=spec-Bq0P3jVh.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spec-Bq0P3jVh.mjs","names":[],"sources":["../../../../apps/cli/src/commands/spec/index.ts"],"sourcesContent":["// apps/cli/src/commands/spec/index.ts — DESIGN §9 verb `spec` (PLAN §3 rule 3 \"later units fill\n// stub files that lie inside their owned paths; they never edit ... the registry\"). Wave-0 stub: exits with the\n// documented not-available error (spec 24 `configuration/phase-not-available`); filled by the Wave-4/5\n// unit that owns `apps/cli/src/commands/spec/**`.\nimport { writeFile } from 'node:fs/promises';\nimport { freezeSpec, loadSpec } from '@cohorte/config';\nimport { stringify } from 'yaml';\nimport type { CommandModule } from '../../contract/index.ts';\n\nconst spec: CommandModule = {\n verb: 'spec',\n async run(ctx, args) {\n const file = args.positionals.find((value) => !value.startsWith('--'));\n if (!file) return 2;\n const frozen = args.subVerb === 'freeze';\n const value = frozen ? await freezeSpec(file) : await loadSpec(file);\n if (frozen) await writeFile(file, stringify(value));\n ctx.stdio.stdout.write(`${JSON.stringify(value)}\\n`);\n return 0;\n },\n};\n\nexport default spec;\n"],"mappings":";;;;AASA,MAAM,OAAsB;CAC1B,MAAM;CACN,MAAM,IAAI,KAAK,MAAM;EACnB,MAAM,OAAO,KAAK,YAAY,MAAM,UAAU,CAAC,MAAM,WAAW,IAAI,CAAC;EACrE,IAAI,CAAC,MAAM,OAAO;EAClB,MAAM,SAAS,KAAK,YAAY;EAChC,MAAM,QAAQ,SAAS,MAAM,WAAW,IAAI,IAAI,MAAM,SAAS,IAAI;EACnE,IAAI,QAAQ,MAAM,UAAU,MAAM,UAAU,KAAK,CAAC;EAClD,IAAI,MAAM,OAAO,MAAM,GAAG,KAAK,UAAU,KAAK,EAAE,GAAG;EACnD,OAAO;CACT;AACF"}
|