cohorte 2.10.1 → 3.0.0-dev.1
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/README.md +7 -0
- package/assets/manifest.json +193 -0
- package/assets/migrations/config/README.md +12 -0
- package/assets/migrations/state/0001_init.sql +154 -0
- package/assets/prompts/README.md +11 -0
- package/assets/prompts/agents/fixer.md +7 -0
- package/assets/prompts/agents/implementer.md +12 -0
- package/assets/prompts/agents/reviewer.md +8 -0
- package/assets/prompts/agents/security-reviewer.md +7 -0
- package/assets/prompts/phases/build.md +5 -0
- package/assets/prompts/phases/review.md +5 -0
- package/assets/prompts/phases/test.md +5 -0
- package/assets/prompts/system.md +11 -0
- package/assets/schemas/agent-output.schema.json +225 -0
- package/assets/schemas/auth-status.schema.json +87 -0
- package/assets/schemas/command-result.schema.json +192 -0
- package/assets/schemas/commands.schema.json +952 -0
- package/assets/schemas/config.schema.json +2259 -0
- package/assets/schemas/doctor-report.schema.json +104 -0
- package/assets/schemas/events.schema.json +8514 -0
- package/assets/schemas/fake-script.schema.json +549 -0
- package/assets/schemas/inspect.schema.json +3133 -0
- package/assets/schemas/manifest.schema.json +79 -0
- package/assets/schemas/ownership.schema.json +52 -0
- package/assets/schemas/policy-verdict.schema.json +282 -0
- package/assets/schemas/project-model.schema.json +783 -0
- package/assets/schemas/project-status.schema.json +217 -0
- package/assets/schemas/reconcile-plan.schema.json +154 -0
- package/assets/schemas/run-diff.schema.json +177 -0
- package/assets/schemas/run-snapshot-manifest.schema.json +2104 -0
- package/assets/schemas/run-state.schema.json +1755 -0
- package/assets/schemas/runtime-capabilities.schema.json +1545 -0
- package/assets/schemas/sandbox-capabilities.schema.json +116 -0
- package/assets/schemas/skill.schema.json +87 -0
- package/assets/schemas/spec.schema.json +202 -0
- package/assets/schemas/tool-catalogue.schema.json +655 -0
- package/assets/schemas/trust-record.schema.json +38 -0
- package/assets/skills/README.md +9 -0
- package/assets/skills/inspect-surface.md +4 -0
- package/dist/agent-host.mjs +2187 -0
- package/dist/agent-host.mjs.map +1 -0
- package/dist/bundle-manifest.json +104 -0
- package/dist/chunks/__host-DgGPyco9.mjs +18 -0
- package/dist/chunks/__host-DgGPyco9.mjs.map +1 -0
- package/dist/chunks/approve-Cv135UqI.mjs +19 -0
- package/dist/chunks/approve-Cv135UqI.mjs.map +1 -0
- package/dist/chunks/auth-BT5oVp76.mjs +132 -0
- package/dist/chunks/auth-BT5oVp76.mjs.map +1 -0
- package/dist/chunks/auth-CYOh60KG.mjs +93 -0
- package/dist/chunks/auth-CYOh60KG.mjs.map +1 -0
- package/dist/chunks/brainstorm-BwKA6yZP.mjs +7 -0
- package/dist/chunks/brainstorm-BwKA6yZP.mjs.map +1 -0
- package/dist/chunks/cancel-KV_cpsqS.mjs +15 -0
- package/dist/chunks/cancel-KV_cpsqS.mjs.map +1 -0
- package/dist/chunks/canonical-C8UxeEmB.mjs +57 -0
- package/dist/chunks/canonical-C8UxeEmB.mjs.map +1 -0
- package/dist/chunks/catalogue-BvwSrM_j.mjs +1549 -0
- package/dist/chunks/catalogue-BvwSrM_j.mjs.map +1 -0
- package/dist/chunks/compose-Dvxunpto.mjs +7307 -0
- package/dist/chunks/compose-Dvxunpto.mjs.map +1 -0
- package/dist/chunks/config-DefHA2Lw.mjs +96 -0
- package/dist/chunks/config-DefHA2Lw.mjs.map +1 -0
- package/dist/chunks/contract-BkMjU1kR.mjs +295 -0
- package/dist/chunks/contract-BkMjU1kR.mjs.map +1 -0
- package/dist/chunks/contract-bQ9FJl4N.mjs +123 -0
- package/dist/chunks/contract-bQ9FJl4N.mjs.map +1 -0
- package/dist/chunks/deny-ClTxSvHJ.mjs +15 -0
- package/dist/chunks/deny-ClTxSvHJ.mjs.map +1 -0
- package/dist/chunks/diff-Qw0II0sj.mjs +101 -0
- package/dist/chunks/diff-Qw0II0sj.mjs.map +1 -0
- package/dist/chunks/discover-eS01-me1.mjs +21 -0
- package/dist/chunks/discover-eS01-me1.mjs.map +1 -0
- package/dist/chunks/doctor-B-H2UK5e.mjs +222 -0
- package/dist/chunks/doctor-B-H2UK5e.mjs.map +1 -0
- package/dist/chunks/fix-D4Tj8RVA.mjs +18 -0
- package/dist/chunks/fix-D4Tj8RVA.mjs.map +1 -0
- package/dist/chunks/gc-BBXlBF5w.mjs +161 -0
- package/dist/chunks/gc-BBXlBF5w.mjs.map +1 -0
- package/dist/chunks/init-BUnzIkeE.mjs +63 -0
- package/dist/chunks/init-BUnzIkeE.mjs.map +1 -0
- package/dist/chunks/inspect-Buby4cQD.mjs +22 -0
- package/dist/chunks/inspect-Buby4cQD.mjs.map +1 -0
- package/dist/chunks/logs-Giq5sUau.mjs +25 -0
- package/dist/chunks/logs-Giq5sUau.mjs.map +1 -0
- package/dist/chunks/migrate-DybihKzZ.mjs +33 -0
- package/dist/chunks/migrate-DybihKzZ.mjs.map +1 -0
- package/dist/chunks/models-Btp6X2YZ.mjs +24 -0
- package/dist/chunks/models-Btp6X2YZ.mjs.map +1 -0
- package/dist/chunks/pause-BASBfKLO.mjs +16 -0
- package/dist/chunks/pause-BASBfKLO.mjs.map +1 -0
- package/dist/chunks/policy-DUIgzF3W.mjs +139 -0
- package/dist/chunks/policy-DUIgzF3W.mjs.map +1 -0
- package/dist/chunks/providers-Dx78imKj.mjs +19 -0
- package/dist/chunks/providers-Dx78imKj.mjs.map +1 -0
- package/dist/chunks/reconcile-Bhy3IIYo.mjs +50 -0
- package/dist/chunks/reconcile-Bhy3IIYo.mjs.map +1 -0
- package/dist/chunks/render-DyZr5Lgi.mjs +53 -0
- package/dist/chunks/render-DyZr5Lgi.mjs.map +1 -0
- package/dist/chunks/resume-GJQRb2Eb.mjs +15 -0
- package/dist/chunks/resume-GJQRb2Eb.mjs.map +1 -0
- package/dist/chunks/retry-CLrUem1H.mjs +15 -0
- package/dist/chunks/retry-CLrUem1H.mjs.map +1 -0
- package/dist/chunks/review-BDdjb6kB.mjs +17 -0
- package/dist/chunks/review-BDdjb6kB.mjs.map +1 -0
- package/dist/chunks/run-CgTWYlcd.mjs +82 -0
- package/dist/chunks/run-CgTWYlcd.mjs.map +1 -0
- package/dist/chunks/run-tool-C3rAv4XF.mjs +26 -0
- package/dist/chunks/run-tool-C3rAv4XF.mjs.map +1 -0
- package/dist/chunks/scan-8Gy_B6kI.mjs +122 -0
- package/dist/chunks/scan-8Gy_B6kI.mjs.map +1 -0
- package/dist/chunks/schema-C9QbUW4H.mjs +578 -0
- package/dist/chunks/schema-C9QbUW4H.mjs.map +1 -0
- package/dist/chunks/send-BdnJ85Nz.mjs +19 -0
- package/dist/chunks/send-BdnJ85Nz.mjs.map +1 -0
- package/dist/chunks/ship-DTuLGoaJ.mjs +19 -0
- package/dist/chunks/ship-DTuLGoaJ.mjs.map +1 -0
- package/dist/chunks/shutdown-BM92Iyv2.mjs +15 -0
- package/dist/chunks/shutdown-BM92Iyv2.mjs.map +1 -0
- package/dist/chunks/skip-DZG5kpcH.mjs +18 -0
- package/dist/chunks/skip-DZG5kpcH.mjs.map +1 -0
- package/dist/chunks/spec-Bq0P3jVh.mjs +20 -0
- package/dist/chunks/spec-Bq0P3jVh.mjs.map +1 -0
- package/dist/chunks/src-CId6kMsY.mjs +1689 -0
- package/dist/chunks/src-CId6kMsY.mjs.map +1 -0
- package/dist/chunks/src-CfAOde7C.mjs +5403 -0
- package/dist/chunks/src-CfAOde7C.mjs.map +1 -0
- package/dist/chunks/src-CmFjh4M0.mjs +928 -0
- package/dist/chunks/src-CmFjh4M0.mjs.map +1 -0
- package/dist/chunks/src-Cu3TxNob.mjs +783 -0
- package/dist/chunks/src-Cu3TxNob.mjs.map +1 -0
- package/dist/chunks/src-DcU4IXMe.mjs +117 -0
- package/dist/chunks/src-DcU4IXMe.mjs.map +1 -0
- package/dist/chunks/src-s7YRvk0t.mjs +2116 -0
- package/dist/chunks/src-s7YRvk0t.mjs.map +1 -0
- package/dist/chunks/status-SMjiOMYy.mjs +29 -0
- package/dist/chunks/status-SMjiOMYy.mjs.map +1 -0
- package/dist/chunks/tail-BuhT-2PH.mjs +25 -0
- package/dist/chunks/tail-BuhT-2PH.mjs.map +1 -0
- package/dist/chunks/update-BXIppsbi.mjs +16 -0
- package/dist/chunks/update-BXIppsbi.mjs.map +1 -0
- package/dist/cli.mjs +175 -0
- package/dist/cli.mjs.map +1 -0
- package/package.json +17 -32
- package/CHANGELOG.md +0 -1461
- package/bin/cli.js +0 -817
- package/bin/report.js +0 -141
- package/core/adapter/render.js +0 -415
- package/core/agents/implementer.template.md +0 -142
- package/core/agents/profile-reader.md +0 -50
- package/core/agents/release.md +0 -58
- package/core/agents/review.md +0 -179
- package/core/commands/cohorte-align-ds.md +0 -33
- package/core/commands/cohorte-audit.md +0 -58
- package/core/commands/cohorte-brainstorm.md +0 -70
- package/core/commands/cohorte-build.md +0 -219
- package/core/commands/cohorte-doctor.md +0 -194
- package/core/commands/cohorte-fix.md +0 -80
- package/core/commands/cohorte-fleet.md +0 -103
- package/core/commands/cohorte-init-pipeline.md +0 -31
- package/core/commands/cohorte-intake.md +0 -92
- package/core/commands/cohorte-patch.md +0 -118
- package/core/commands/cohorte-refactor.md +0 -59
- package/core/commands/cohorte-retro.md +0 -85
- package/core/commands/cohorte-review.md +0 -270
- package/core/commands/cohorte-ship.md +0 -122
- package/core/commands/cohorte-spec.md +0 -101
- package/core/commands/cohorte-update-pipeline.md +0 -165
- package/core/hooks/gate.py +0 -588
- package/core/runtimes/claude.json +0 -74
- package/core/runtimes/codex.json +0 -85
- package/core/runtimes/cursor.json +0 -76
- package/core/runtimes/gemini.json +0 -76
- package/core/runtimes/opencode.json +0 -73
- package/core/templates/agent-handoff.md +0 -34
- package/core/templates/brainstorm-return.md +0 -36
- package/core/templates/decisions.template.md +0 -42
- package/core/templates/design-brief.md +0 -44
- package/core/templates/patch.template.md +0 -86
- package/core/templates/pr-body.md +0 -25
- package/core/templates/review-feedback.md +0 -38
- package/core/templates/spec.template.md +0 -87
- package/core/templates/steps/init-pipeline/01-detect-stack.md +0 -44
- package/core/templates/steps/init-pipeline/02-interview-gaps.md +0 -55
- package/core/templates/steps/init-pipeline/03-draft-profile.md +0 -10
- package/core/templates/steps/init-pipeline/04-write-render.md +0 -145
- package/core/templates/steps/init-pipeline/05-report.md +0 -12
- package/core/workflows/audit.js +0 -240
- package/core/workflows/loop.js +0 -641
- package/core/workflows/refactor.js +0 -276
- package/core/workflows/review.js +0 -456
- package/install.ps1 +0 -103
- package/install.sh +0 -114
- package/lib/doctor.js +0 -534
- package/lib/runtime.js +0 -139
- package/lib/versions.js +0 -149
- package/lib/yaml.js +0 -129
- package/profile/PIPELINE.template.md +0 -259
- package/profile/SCHEMA.md +0 -735
- package/profile/cohorte.config.template.yaml +0 -43
- package/scripts/assert-gate-hook.mjs +0 -75
- package/scripts/kanban-move.sh +0 -313
- package/scripts/metrics/collect.mjs +0 -531
- package/scripts/metrics/prices.json +0 -42
- package/scripts/new-feature.sh.template +0 -98
- package/scripts/preflight.sh +0 -124
- package/scripts/remove-feature.sh.template +0 -56
- package/scripts/test-adapter.mjs +0 -437
- package/scripts/test-gate.mjs +0 -443
- package/scripts/test-kanban.mjs +0 -304
- package/scripts/test-lib.mjs +0 -356
- package/scripts/test-metrics.mjs +0 -156
- package/scripts/test-workflows.mjs +0 -758
- package/scripts/validate-core.mjs +0 -325
|
@@ -0,0 +1,578 @@
|
|
|
1
|
+
import { n as sha256Hex, t as canonicalJson } from "./canonical-C8UxeEmB.mjs";
|
|
2
|
+
import { S as IsoInstant, T as Sha256, d as ModelRef, l as AuthMode, p as ThinkingLevel, t as BudgetCounters, u as ModelCapability, x as ID_PATTERN } from "./src-Cu3TxNob.mjs";
|
|
3
|
+
import { d as EscalationPolicy, u as ActivePipelineState } from "./src-s7YRvk0t.mjs";
|
|
4
|
+
import { Type } from "typebox";
|
|
5
|
+
//#region ../../packages/config/src/schema/policy.ts
|
|
6
|
+
const closed$5 = { additionalProperties: false };
|
|
7
|
+
const tokens = () => Type.Array(Type.String({ minLength: 1 }));
|
|
8
|
+
const max = () => Type.Integer({ minimum: 0 });
|
|
9
|
+
const CommandRuleSchema = Type.Object({
|
|
10
|
+
id: Type.String({ minLength: 1 }),
|
|
11
|
+
program: Type.String({ pattern: "^[^/\\\\\\s]+$" }),
|
|
12
|
+
subcommand: Type.Optional(tokens()),
|
|
13
|
+
flags: Type.Optional(Type.Object({
|
|
14
|
+
allow: tokens(),
|
|
15
|
+
deny: Type.Optional(tokens())
|
|
16
|
+
}, closed$5)),
|
|
17
|
+
positionals: Type.Optional(Type.Union([
|
|
18
|
+
Type.Object({ kind: Type.Literal("none") }, closed$5),
|
|
19
|
+
Type.Object({
|
|
20
|
+
kind: Type.Literal("paths-in-worktree"),
|
|
21
|
+
max: max()
|
|
22
|
+
}, closed$5),
|
|
23
|
+
Type.Object({
|
|
24
|
+
kind: Type.Literal("enum"),
|
|
25
|
+
values: tokens(),
|
|
26
|
+
max: max()
|
|
27
|
+
}, closed$5),
|
|
28
|
+
Type.Object({
|
|
29
|
+
kind: Type.Literal("exact"),
|
|
30
|
+
values: Type.Array(Type.String())
|
|
31
|
+
}, closed$5)
|
|
32
|
+
])),
|
|
33
|
+
decision: Type.Union([
|
|
34
|
+
Type.Literal("allow"),
|
|
35
|
+
Type.Literal("ask"),
|
|
36
|
+
Type.Literal("deny")
|
|
37
|
+
]),
|
|
38
|
+
when: Type.Optional(Type.Object({
|
|
39
|
+
branch: Type.Optional(Type.Union([Type.Literal("any"), Type.Literal("unprotected-only")])),
|
|
40
|
+
roles: Type.Optional(tokens()),
|
|
41
|
+
phases: Type.Optional(tokens())
|
|
42
|
+
}, closed$5)),
|
|
43
|
+
replay: Type.Union([Type.Literal("idempotent"), Type.Literal("at-most-once")]),
|
|
44
|
+
network: Type.Boolean(),
|
|
45
|
+
origin: Type.Union([
|
|
46
|
+
Type.Literal("builtin"),
|
|
47
|
+
Type.Literal("project-config"),
|
|
48
|
+
Type.Literal("project-checks")
|
|
49
|
+
])
|
|
50
|
+
}, closed$5);
|
|
51
|
+
/** [S]. The explicit annotation keeps Biome's type inference out of the union (docs/v3/requests/U0.02.md R1). */
|
|
52
|
+
const CommandRule = Type.Unsafe(CommandRuleSchema);
|
|
53
|
+
/** [S] DESIGN 2.6.3. Default: deny-outgoing + deny. */
|
|
54
|
+
const SymlinkPolicy = Type.Object({
|
|
55
|
+
mode: Type.Union([
|
|
56
|
+
Type.Literal("deny-outgoing"),
|
|
57
|
+
Type.Literal("deny-all"),
|
|
58
|
+
Type.Literal("allow")
|
|
59
|
+
]),
|
|
60
|
+
hardlinksOnWrite: Type.Union([Type.Literal("deny"), Type.Literal("allow")])
|
|
61
|
+
}, closed$5);
|
|
62
|
+
Type.Object({ default: Type.Literal("deny") }, closed$5);
|
|
63
|
+
const DEFAULT_SYMLINK_POLICY = Object.freeze({
|
|
64
|
+
mode: "deny-outgoing",
|
|
65
|
+
hardlinksOnWrite: "deny"
|
|
66
|
+
});
|
|
67
|
+
const DEFAULT_NETWORK_POLICY = Object.freeze({ default: "deny" });
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region ../../packages/config/src/schema/config.ts
|
|
70
|
+
const closed$4 = { additionalProperties: false };
|
|
71
|
+
const oneOf = (values) => Type.Unsafe({
|
|
72
|
+
type: "string",
|
|
73
|
+
enum: [...values]
|
|
74
|
+
});
|
|
75
|
+
const count = (minimum = 0) => Type.Integer({ minimum });
|
|
76
|
+
const argv = () => Type.Array(Type.String(), { minItems: 1 });
|
|
77
|
+
const strings = () => Type.Array(Type.String({ minLength: 1 }));
|
|
78
|
+
const rules = () => Type.Array(CommandRule);
|
|
79
|
+
const budgetMap = () => Type.Unsafe(Type.Record(Type.String(), BudgetCounters));
|
|
80
|
+
const roleDefaults = () => Type.Unsafe(Type.Record(Type.String(), ModelCapability));
|
|
81
|
+
const tier = () => Type.Optional(Type.Object({
|
|
82
|
+
ref: ModelRef,
|
|
83
|
+
thinking: ThinkingLevel
|
|
84
|
+
}, closed$4));
|
|
85
|
+
const envValue = () => Type.Optional(Type.String({ minLength: 1 }));
|
|
86
|
+
const leftover = () => oneOf([
|
|
87
|
+
"fix",
|
|
88
|
+
"park",
|
|
89
|
+
"ask"
|
|
90
|
+
]);
|
|
91
|
+
const CohorteConfigSchema = Type.Object({
|
|
92
|
+
schemaVersion: Type.Literal(1),
|
|
93
|
+
project: Type.Object({
|
|
94
|
+
id: Type.String({ pattern: ID_PATTERN }),
|
|
95
|
+
defaultBranch: Type.String({ minLength: 1 }),
|
|
96
|
+
protectedBranches: strings()
|
|
97
|
+
}, closed$4),
|
|
98
|
+
runtime: Type.Object({
|
|
99
|
+
id: Type.String({ minLength: 1 }),
|
|
100
|
+
pi: Type.Optional(Type.Object({ loadFrom: oneOf(["package", "bundle"]) }, closed$4))
|
|
101
|
+
}, closed$4),
|
|
102
|
+
authentication: Type.Object({
|
|
103
|
+
mode: AuthMode,
|
|
104
|
+
allowApiKeys: Type.Boolean(),
|
|
105
|
+
anthropicSubscriptionViaPi: Type.Optional(Type.Object({
|
|
106
|
+
enabled: Type.Boolean(),
|
|
107
|
+
acknowledgePerTokenBilling: Type.Boolean(),
|
|
108
|
+
acknowledgeProviderTermsRisk: Type.Boolean()
|
|
109
|
+
}, closed$4))
|
|
110
|
+
}, closed$4),
|
|
111
|
+
routing: Type.Object({
|
|
112
|
+
allowedProviders: strings(),
|
|
113
|
+
defaults: roleDefaults(),
|
|
114
|
+
tiers: Type.Object({
|
|
115
|
+
fast: tier(),
|
|
116
|
+
coding: tier(),
|
|
117
|
+
reasoning: tier(),
|
|
118
|
+
vision: tier(),
|
|
119
|
+
cheap: tier()
|
|
120
|
+
}, closed$4),
|
|
121
|
+
escalation: EscalationPolicy,
|
|
122
|
+
fallback: Type.Object({ enabled: Type.Boolean() }, closed$4)
|
|
123
|
+
}, closed$4),
|
|
124
|
+
budgets: Type.Object({
|
|
125
|
+
run: BudgetCounters,
|
|
126
|
+
phase: BudgetCounters,
|
|
127
|
+
agent: BudgetCounters,
|
|
128
|
+
provider: budgetMap(),
|
|
129
|
+
tool: budgetMap(),
|
|
130
|
+
concurrency: count(1),
|
|
131
|
+
maxIncarnations: count(1)
|
|
132
|
+
}, closed$4),
|
|
133
|
+
loop: Type.Object({
|
|
134
|
+
maxFixRounds: count(),
|
|
135
|
+
noProgressWindow: count(1),
|
|
136
|
+
maxDeniedCallsPerAgent: count(),
|
|
137
|
+
leftovers: Type.Object({
|
|
138
|
+
major: leftover(),
|
|
139
|
+
minor: leftover(),
|
|
140
|
+
info: leftover()
|
|
141
|
+
}, closed$4)
|
|
142
|
+
}, closed$4),
|
|
143
|
+
checks: Type.Object({
|
|
144
|
+
typecheck: Type.Optional(argv()),
|
|
145
|
+
lint: Type.Optional(argv()),
|
|
146
|
+
test: Type.Optional(argv()),
|
|
147
|
+
timeoutMs: count(1)
|
|
148
|
+
}, closed$4),
|
|
149
|
+
provision: Type.Object({
|
|
150
|
+
argv: Type.Optional(argv()),
|
|
151
|
+
network: Type.Boolean(),
|
|
152
|
+
cacheDirs: strings(),
|
|
153
|
+
lockfiles: strings(),
|
|
154
|
+
env: Type.Object({
|
|
155
|
+
npm_config_store_dir: envValue(),
|
|
156
|
+
npm_config_cache: envValue(),
|
|
157
|
+
YARN_CACHE_FOLDER: envValue(),
|
|
158
|
+
COREPACK_HOME: envValue()
|
|
159
|
+
}, closed$4),
|
|
160
|
+
dependencyDirs: strings(),
|
|
161
|
+
writableCaches: strings()
|
|
162
|
+
}, closed$4),
|
|
163
|
+
policy: Type.Object({
|
|
164
|
+
commands: Type.Object({
|
|
165
|
+
allow: rules(),
|
|
166
|
+
ask: rules(),
|
|
167
|
+
deny: rules()
|
|
168
|
+
}, closed$4),
|
|
169
|
+
dangerousCommands: rules(),
|
|
170
|
+
symlinks: SymlinkPolicy,
|
|
171
|
+
approvals: Type.Object({
|
|
172
|
+
unattended: oneOf(["deny", "wait"]),
|
|
173
|
+
expiryMinutes: Type.Optional(count(1)),
|
|
174
|
+
parkAfterMinutes: count(),
|
|
175
|
+
ship: oneOf(["human", "auto"]),
|
|
176
|
+
notify: Type.Boolean(),
|
|
177
|
+
autoResume: Type.Boolean()
|
|
178
|
+
}, closed$4),
|
|
179
|
+
inDoubt: oneOf(["ask", "continue"]),
|
|
180
|
+
skip: Type.Array(ActivePipelineState),
|
|
181
|
+
steer: Type.Object({ enabled: Type.Boolean() }, closed$4),
|
|
182
|
+
admin: Type.Object({ runTool: Type.Boolean() }, closed$4),
|
|
183
|
+
quota: Type.Object({ autoResume: Type.Boolean() }, closed$4)
|
|
184
|
+
}, closed$4),
|
|
185
|
+
host: Type.Object({
|
|
186
|
+
idleExitMinutes: count(),
|
|
187
|
+
pauseKeepAliveMinutes: count(),
|
|
188
|
+
pollMs: count(1)
|
|
189
|
+
}, closed$4),
|
|
190
|
+
network: Type.Object({ proxyEnv: Type.Boolean() }, closed$4),
|
|
191
|
+
sandbox: Type.Object({
|
|
192
|
+
require: Type.Optional(oneOf(["native", "best-effort"])),
|
|
193
|
+
brain: oneOf([
|
|
194
|
+
"os-if-available",
|
|
195
|
+
"os",
|
|
196
|
+
"process"
|
|
197
|
+
])
|
|
198
|
+
}, closed$4),
|
|
199
|
+
git: Type.Object({
|
|
200
|
+
worktreeRoot: Type.Optional(Type.String({ minLength: 1 })),
|
|
201
|
+
branchPrefix: Type.String({ minLength: 1 }),
|
|
202
|
+
commitIdentity: oneOf(["user", "cohorte"]),
|
|
203
|
+
keepWorktrees: oneOf([
|
|
204
|
+
"on-failure",
|
|
205
|
+
"always",
|
|
206
|
+
"never"
|
|
207
|
+
])
|
|
208
|
+
}, closed$4),
|
|
209
|
+
retention: Type.Object({
|
|
210
|
+
transcriptsDays: count(),
|
|
211
|
+
eventsDays: Type.Union([count(), Type.Literal("forever")]),
|
|
212
|
+
artifactsDays: count(),
|
|
213
|
+
compressAfterDays: count()
|
|
214
|
+
}, closed$4),
|
|
215
|
+
telemetry: Type.Object({ remote: Type.Boolean() }, closed$4)
|
|
216
|
+
}, closed$4);
|
|
217
|
+
/** [S]. Annotated on purpose: Biome must not infer this type (docs/v3/requests/U0.02.md R1, U0.05.md R1). */
|
|
218
|
+
const CohorteConfig = Type.Unsafe(CohorteConfigSchema);
|
|
219
|
+
function deepFreeze(value) {
|
|
220
|
+
if (typeof value === "object" && value !== null && !Object.isFrozen(value)) {
|
|
221
|
+
Object.freeze(value);
|
|
222
|
+
for (const member of Object.values(value)) deepFreeze(member);
|
|
223
|
+
}
|
|
224
|
+
return value;
|
|
225
|
+
}
|
|
226
|
+
const MINUTE = 6e4;
|
|
227
|
+
/**
|
|
228
|
+
* The lowest layer of the load order (DESIGN 2.10): shipped defaults < user file < project file < CLI flags.
|
|
229
|
+
* `project.id` is a placeholder that `cohorte init` always replaces. DESIGN gives the numbers it cares about
|
|
230
|
+
* (concurrency 3, maxIncarnations 5, loop 5/3/5, host 30/30/250, parkAfterMinutes 10); the budget and retention
|
|
231
|
+
* figures are provisional defaults of this file.
|
|
232
|
+
*/
|
|
233
|
+
const DEFAULT_CONFIG = deepFreeze({
|
|
234
|
+
schemaVersion: 1,
|
|
235
|
+
project: {
|
|
236
|
+
id: "project",
|
|
237
|
+
defaultBranch: "main",
|
|
238
|
+
protectedBranches: ["main", "master"]
|
|
239
|
+
},
|
|
240
|
+
runtime: {
|
|
241
|
+
id: "pi",
|
|
242
|
+
pi: { loadFrom: "package" }
|
|
243
|
+
},
|
|
244
|
+
authentication: {
|
|
245
|
+
mode: "subscription",
|
|
246
|
+
allowApiKeys: false
|
|
247
|
+
},
|
|
248
|
+
routing: {
|
|
249
|
+
allowedProviders: ["openai-codex"],
|
|
250
|
+
defaults: {
|
|
251
|
+
implementer: "coding",
|
|
252
|
+
fixer: "coding",
|
|
253
|
+
reviewer: "reasoning",
|
|
254
|
+
"security-reviewer": "reasoning"
|
|
255
|
+
},
|
|
256
|
+
tiers: {
|
|
257
|
+
coding: {
|
|
258
|
+
ref: {
|
|
259
|
+
provider: "openai-codex",
|
|
260
|
+
model: "gpt-5.5",
|
|
261
|
+
capability: "coding"
|
|
262
|
+
},
|
|
263
|
+
thinking: "medium"
|
|
264
|
+
},
|
|
265
|
+
reasoning: {
|
|
266
|
+
ref: {
|
|
267
|
+
provider: "openai-codex",
|
|
268
|
+
model: "gpt-5.5",
|
|
269
|
+
capability: "reasoning"
|
|
270
|
+
},
|
|
271
|
+
thinking: "high"
|
|
272
|
+
},
|
|
273
|
+
fast: {
|
|
274
|
+
ref: {
|
|
275
|
+
provider: "openai-codex",
|
|
276
|
+
model: "gpt-5.4-mini",
|
|
277
|
+
capability: "fast"
|
|
278
|
+
},
|
|
279
|
+
thinking: "low"
|
|
280
|
+
},
|
|
281
|
+
cheap: {
|
|
282
|
+
ref: {
|
|
283
|
+
provider: "openai-codex",
|
|
284
|
+
model: "gpt-5.4-mini",
|
|
285
|
+
capability: "cheap"
|
|
286
|
+
},
|
|
287
|
+
thinking: "low"
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
escalation: {
|
|
291
|
+
sameFailureCount: 2,
|
|
292
|
+
ladder: [{ kind: "human" }],
|
|
293
|
+
maxPerRun: 2
|
|
294
|
+
},
|
|
295
|
+
fallback: { enabled: false }
|
|
296
|
+
},
|
|
297
|
+
budgets: {
|
|
298
|
+
run: {
|
|
299
|
+
modelRequests: 2e3,
|
|
300
|
+
toolCalls: 1e4,
|
|
301
|
+
wallClockMs: 360 * MINUTE
|
|
302
|
+
},
|
|
303
|
+
phase: { wallClockMs: 120 * MINUTE },
|
|
304
|
+
agent: {
|
|
305
|
+
modelRequests: 200,
|
|
306
|
+
toolCalls: 400,
|
|
307
|
+
wallClockMs: 45 * MINUTE,
|
|
308
|
+
contextTokens: 2e5
|
|
309
|
+
},
|
|
310
|
+
provider: {},
|
|
311
|
+
tool: {},
|
|
312
|
+
concurrency: 3,
|
|
313
|
+
maxIncarnations: 5
|
|
314
|
+
},
|
|
315
|
+
loop: {
|
|
316
|
+
maxFixRounds: 5,
|
|
317
|
+
noProgressWindow: 3,
|
|
318
|
+
maxDeniedCallsPerAgent: 5,
|
|
319
|
+
leftovers: {
|
|
320
|
+
major: "fix",
|
|
321
|
+
minor: "park",
|
|
322
|
+
info: "park"
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
checks: { timeoutMs: 10 * MINUTE },
|
|
326
|
+
provision: {
|
|
327
|
+
network: false,
|
|
328
|
+
cacheDirs: [],
|
|
329
|
+
lockfiles: [
|
|
330
|
+
"pnpm-lock.yaml",
|
|
331
|
+
"package-lock.json",
|
|
332
|
+
"yarn.lock"
|
|
333
|
+
],
|
|
334
|
+
env: {},
|
|
335
|
+
dependencyDirs: ["**/node_modules"],
|
|
336
|
+
writableCaches: [
|
|
337
|
+
"node_modules/.cache",
|
|
338
|
+
"node_modules/.vite",
|
|
339
|
+
"node_modules/.vitest",
|
|
340
|
+
"node_modules/.vite-temp"
|
|
341
|
+
]
|
|
342
|
+
},
|
|
343
|
+
policy: {
|
|
344
|
+
commands: {
|
|
345
|
+
allow: [],
|
|
346
|
+
ask: [],
|
|
347
|
+
deny: []
|
|
348
|
+
},
|
|
349
|
+
dangerousCommands: [],
|
|
350
|
+
symlinks: { ...DEFAULT_SYMLINK_POLICY },
|
|
351
|
+
approvals: {
|
|
352
|
+
unattended: "deny",
|
|
353
|
+
parkAfterMinutes: 10,
|
|
354
|
+
ship: "human",
|
|
355
|
+
notify: false,
|
|
356
|
+
autoResume: false
|
|
357
|
+
},
|
|
358
|
+
inDoubt: "ask",
|
|
359
|
+
skip: [],
|
|
360
|
+
steer: { enabled: false },
|
|
361
|
+
admin: { runTool: false },
|
|
362
|
+
quota: { autoResume: false }
|
|
363
|
+
},
|
|
364
|
+
host: {
|
|
365
|
+
idleExitMinutes: 30,
|
|
366
|
+
pauseKeepAliveMinutes: 30,
|
|
367
|
+
pollMs: 250
|
|
368
|
+
},
|
|
369
|
+
network: { proxyEnv: false },
|
|
370
|
+
sandbox: { brain: "os-if-available" },
|
|
371
|
+
git: {
|
|
372
|
+
branchPrefix: "cohorte/",
|
|
373
|
+
commitIdentity: "user",
|
|
374
|
+
keepWorktrees: "on-failure"
|
|
375
|
+
},
|
|
376
|
+
retention: {
|
|
377
|
+
transcriptsDays: 30,
|
|
378
|
+
eventsDays: "forever",
|
|
379
|
+
artifactsDays: 90,
|
|
380
|
+
compressAfterDays: 7
|
|
381
|
+
},
|
|
382
|
+
telemetry: { remote: false }
|
|
383
|
+
});
|
|
384
|
+
//#endregion
|
|
385
|
+
//#region ../../packages/config/src/schema/manifest.ts
|
|
386
|
+
const closed$3 = { additionalProperties: false };
|
|
387
|
+
const GeneratedFile = Type.Object({
|
|
388
|
+
/** `.cohorte`-relative POSIX path */
|
|
389
|
+
path: Type.String({ minLength: 1 }),
|
|
390
|
+
templateId: Type.String({ minLength: 1 }),
|
|
391
|
+
templateSha256: Sha256,
|
|
392
|
+
/** a generated file is replaced only if its CURRENT hash equals this one */
|
|
393
|
+
renderedSha256: Sha256
|
|
394
|
+
}, closed$3);
|
|
395
|
+
Type.Object({
|
|
396
|
+
schemaVersion: Type.Literal(1),
|
|
397
|
+
cohorteVersion: Type.String({ minLength: 1 }),
|
|
398
|
+
createdWith: Type.String({ minLength: 1 }),
|
|
399
|
+
protocol: Type.Object({
|
|
400
|
+
min: Type.String({ minLength: 1 }),
|
|
401
|
+
max: Type.String({ minLength: 1 })
|
|
402
|
+
}, closed$3),
|
|
403
|
+
stateSchemaVersion: Type.Integer({ minimum: 0 }),
|
|
404
|
+
generated: Type.Array(GeneratedFile)
|
|
405
|
+
}, closed$3);
|
|
406
|
+
//#endregion
|
|
407
|
+
//#region ../../packages/config/src/schema/ownership.ts
|
|
408
|
+
const closed$2 = { additionalProperties: false };
|
|
409
|
+
const names$1 = () => Type.Array(Type.String({ minLength: 1 }));
|
|
410
|
+
const SurfaceSchema = Type.Object({
|
|
411
|
+
paths: Type.Array(Type.String({ minLength: 1 }), { minItems: 1 }),
|
|
412
|
+
owners: names$1(),
|
|
413
|
+
reviewers: names$1(),
|
|
414
|
+
approval: Type.Optional(Type.Literal("human"))
|
|
415
|
+
}, closed$2);
|
|
416
|
+
const OwnershipSchema = Type.Object({ surfaces: Type.Record(Type.String({ pattern: ID_PATTERN }), SurfaceSchema) }, closed$2);
|
|
417
|
+
/** [S]. Annotated: a `Static<TRecord>` inferred by Biome overflows its stack (docs/v3/requests/U0.03.md R1). */
|
|
418
|
+
const Ownership = Type.Unsafe(OwnershipSchema);
|
|
419
|
+
const GLOB_META = /[*?[\]{}()!]/;
|
|
420
|
+
/** The literal prefix of a glob, by path SEGMENT: the segments before the first one holding a glob metacharacter (DESIGN 5.6). */
|
|
421
|
+
function literalPrefixOf(pattern) {
|
|
422
|
+
const prefix = [];
|
|
423
|
+
for (const segment of pattern.split("/")) {
|
|
424
|
+
if (segment === "" || segment === ".") continue;
|
|
425
|
+
if (GLOB_META.test(segment)) break;
|
|
426
|
+
prefix.push(segment);
|
|
427
|
+
}
|
|
428
|
+
return prefix;
|
|
429
|
+
}
|
|
430
|
+
//#endregion
|
|
431
|
+
//#region ../../packages/config/src/schema/skill.ts
|
|
432
|
+
const closed$1 = { additionalProperties: false };
|
|
433
|
+
const names = () => Type.Optional(Type.Array(Type.String({ minLength: 1 })));
|
|
434
|
+
Type.Object({
|
|
435
|
+
id: Type.String({ pattern: ID_PATTERN }),
|
|
436
|
+
version: Type.String({ minLength: 1 }),
|
|
437
|
+
/** matched against the Project Model, deterministically */
|
|
438
|
+
appliesWhen: Type.Object({
|
|
439
|
+
languages: names(),
|
|
440
|
+
frameworks: names(),
|
|
441
|
+
packageManagers: names(),
|
|
442
|
+
roles: names()
|
|
443
|
+
}, closed$1),
|
|
444
|
+
/** relative path of the Markdown, inside the skill directory */
|
|
445
|
+
prompt: Type.String({ minLength: 1 }),
|
|
446
|
+
checks: Type.Optional(Type.Array(Type.Object({
|
|
447
|
+
name: Type.Optional(Type.String({ minLength: 1 })),
|
|
448
|
+
argv: Type.Array(Type.String(), { minItems: 1 })
|
|
449
|
+
}, closed$1))),
|
|
450
|
+
/** reserved (ADR-0011): no signature is verified in V3.0 */
|
|
451
|
+
signature: Type.Optional(Type.String()),
|
|
452
|
+
/** reserved (ADR-0011) */
|
|
453
|
+
source: Type.Optional(Type.String())
|
|
454
|
+
}, closed$1);
|
|
455
|
+
//#endregion
|
|
456
|
+
//#region ../../packages/config/src/schema/spec.ts
|
|
457
|
+
const closed = { additionalProperties: false };
|
|
458
|
+
const texts = () => Type.Array(Type.String({ minLength: 1 }));
|
|
459
|
+
const body = {
|
|
460
|
+
id: Type.String({ pattern: ID_PATTERN }),
|
|
461
|
+
kind: Type.Union([Type.Literal("feature"), Type.Literal("patch")]),
|
|
462
|
+
title: Type.String({ minLength: 1 }),
|
|
463
|
+
acceptance: texts(),
|
|
464
|
+
surfaces: Type.Record(Type.String({ pattern: ID_PATTERN }), Type.Object({ tasks: texts() }, closed)),
|
|
465
|
+
contract: Type.Optional(Type.String({ minLength: 1 })),
|
|
466
|
+
openQuestions: texts(),
|
|
467
|
+
patch: Type.Optional(Type.Object({
|
|
468
|
+
repro: Type.String(),
|
|
469
|
+
regressionTest: Type.String(),
|
|
470
|
+
causeConfirmed: Type.Boolean()
|
|
471
|
+
}, closed))
|
|
472
|
+
};
|
|
473
|
+
const SpecSchema = Type.Union([Type.Object({
|
|
474
|
+
...body,
|
|
475
|
+
status: Type.Literal("draft")
|
|
476
|
+
}, closed), Type.Object({
|
|
477
|
+
...body,
|
|
478
|
+
status: Type.Literal("frozen"),
|
|
479
|
+
sha256: Sha256
|
|
480
|
+
}, closed)]);
|
|
481
|
+
/** [S]. A frozen spec WITHOUT a sha256, and a draft WITH one, are both invalid. */
|
|
482
|
+
const Spec = Type.Unsafe(SpecSchema);
|
|
483
|
+
/** What freezing signs: everything a human wrote, nothing the freeze itself adds. */
|
|
484
|
+
function specContentSha256(spec) {
|
|
485
|
+
const content = {};
|
|
486
|
+
for (const [key, value] of Object.entries(spec)) if (key !== "status" && key !== "sha256" && value !== void 0) content[key] = value;
|
|
487
|
+
return sha256Hex(canonicalJson(content));
|
|
488
|
+
}
|
|
489
|
+
/** A frozen spec rejects edits: its content must still hash to the sha256 it was frozen with. A draft has nothing to prove. */
|
|
490
|
+
function frozenSpecProblems(spec) {
|
|
491
|
+
if (spec.status !== "frozen") return [];
|
|
492
|
+
const actual = specContentSha256(spec);
|
|
493
|
+
if (actual === spec.sha256) return [];
|
|
494
|
+
return [{
|
|
495
|
+
path: "/sha256",
|
|
496
|
+
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`
|
|
497
|
+
}];
|
|
498
|
+
}
|
|
499
|
+
//#endregion
|
|
500
|
+
//#region ../../packages/config/src/schema/trust.ts
|
|
501
|
+
const tighten = (pointer) => Object.freeze({
|
|
502
|
+
pointer,
|
|
503
|
+
class: "tighten-only"
|
|
504
|
+
});
|
|
505
|
+
const neutral = (pointer) => Object.freeze({
|
|
506
|
+
pointer,
|
|
507
|
+
class: "neutral"
|
|
508
|
+
});
|
|
509
|
+
const loosen = (pointer, ...loosenOnly) => Object.freeze(loosenOnly.length === 0 ? {
|
|
510
|
+
pointer,
|
|
511
|
+
class: "loosen"
|
|
512
|
+
} : {
|
|
513
|
+
pointer,
|
|
514
|
+
class: "loosen",
|
|
515
|
+
loosenOnly: Object.freeze(loosenOnly)
|
|
516
|
+
});
|
|
517
|
+
Object.freeze([
|
|
518
|
+
neutral("/schemaVersion"),
|
|
519
|
+
neutral("/project"),
|
|
520
|
+
neutral("/runtime/id"),
|
|
521
|
+
loosen("/runtime/pi"),
|
|
522
|
+
neutral("/authentication/mode"),
|
|
523
|
+
loosen("/authentication/allowApiKeys"),
|
|
524
|
+
loosen("/authentication/anthropicSubscriptionViaPi"),
|
|
525
|
+
loosen("/routing/allowedProviders"),
|
|
526
|
+
neutral("/routing/defaults"),
|
|
527
|
+
neutral("/routing/tiers"),
|
|
528
|
+
neutral("/routing/escalation"),
|
|
529
|
+
loosen("/routing/fallback"),
|
|
530
|
+
tighten("/budgets"),
|
|
531
|
+
tighten("/loop"),
|
|
532
|
+
loosen("/checks"),
|
|
533
|
+
loosen("/provision/argv"),
|
|
534
|
+
loosen("/provision/network"),
|
|
535
|
+
loosen("/provision/cacheDirs"),
|
|
536
|
+
neutral("/provision/lockfiles"),
|
|
537
|
+
loosen("/provision/env"),
|
|
538
|
+
loosen("/provision/dependencyDirs"),
|
|
539
|
+
loosen("/provision/writableCaches"),
|
|
540
|
+
loosen("/policy/commands/allow"),
|
|
541
|
+
tighten("/policy/commands/ask"),
|
|
542
|
+
tighten("/policy/commands/deny"),
|
|
543
|
+
loosen("/policy/dangerousCommands"),
|
|
544
|
+
loosen("/policy/symlinks/mode", "allow"),
|
|
545
|
+
loosen("/policy/symlinks/hardlinksOnWrite", "allow"),
|
|
546
|
+
loosen("/policy/approvals/unattended", "wait"),
|
|
547
|
+
tighten("/policy/approvals/expiryMinutes"),
|
|
548
|
+
tighten("/policy/approvals/parkAfterMinutes"),
|
|
549
|
+
loosen("/policy/approvals/ship", "auto"),
|
|
550
|
+
neutral("/policy/approvals/notify"),
|
|
551
|
+
loosen("/policy/approvals/autoResume"),
|
|
552
|
+
loosen("/policy/inDoubt", "continue"),
|
|
553
|
+
loosen("/policy/skip"),
|
|
554
|
+
loosen("/policy/steer"),
|
|
555
|
+
loosen("/policy/admin"),
|
|
556
|
+
neutral("/policy/quota"),
|
|
557
|
+
neutral("/host"),
|
|
558
|
+
loosen("/network/proxyEnv"),
|
|
559
|
+
loosen("/sandbox/require", "best-effort"),
|
|
560
|
+
loosen("/sandbox/brain", "process"),
|
|
561
|
+
loosen("/git/worktreeRoot"),
|
|
562
|
+
neutral("/git/branchPrefix"),
|
|
563
|
+
neutral("/git/commitIdentity"),
|
|
564
|
+
neutral("/git/keepWorktrees"),
|
|
565
|
+
tighten("/retention"),
|
|
566
|
+
neutral("/telemetry")
|
|
567
|
+
]);
|
|
568
|
+
Type.Unsafe(Type.Object({
|
|
569
|
+
policySha256: Sha256,
|
|
570
|
+
loosenedKeys: Type.Array(Type.String()),
|
|
571
|
+
grantedAt: IsoInstant,
|
|
572
|
+
grantedBy: Type.String({ minLength: 1 }),
|
|
573
|
+
mac: Type.String({ minLength: 1 })
|
|
574
|
+
}, { additionalProperties: false }));
|
|
575
|
+
//#endregion
|
|
576
|
+
export { literalPrefixOf as a, CommandRule as c, Ownership as i, DEFAULT_NETWORK_POLICY as l, frozenSpecProblems as n, CohorteConfig as o, specContentSha256 as r, DEFAULT_CONFIG as s, Spec as t };
|
|
577
|
+
|
|
578
|
+
//# sourceMappingURL=schema-C9QbUW4H.mjs.map
|