blun-king-cli 9.1.66 → 9.1.68
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/LIESMICH.txt +17 -1
- package/README.md +14 -1
- package/blun.mjs +4 -4
- package/package.json +1 -1
- package/standard-skills/venture-flywheel/SKILL.md +32 -0
- package/standard-skills/venture-flywheel/identity/project-identity.cjs +146 -0
- package/standard-skills/venture-flywheel/policy/capability-engine.cjs +114 -0
- package/standard-skills/venture-flywheel/policy/repository-trust.cjs +229 -0
- package/standard-skills/venture-flywheel/references/BEISPIELE-phase0.md +146 -0
- package/standard-skills/venture-flywheel/references/CAPABILITY-MAP.md +34 -0
- package/standard-skills/venture-flywheel/references/SPEC-phase0-identity-trust.md +77 -0
- package/standard-skills/venture-flywheel/references/SPEC-phase0-state-events.md +93 -0
- package/standard-skills/venture-flywheel/schemas/capability-decision.schema.json +13 -0
- package/standard-skills/venture-flywheel/schemas/execution-event.schema.json +44 -0
- package/standard-skills/venture-flywheel/schemas/project-identity.schema.json +32 -0
- package/standard-skills/venture-flywheel/schemas/repository-trust.schema.json +57 -0
- package/standard-skills/venture-flywheel/schemas/run-transition.schema.json +59 -0
- package/standard-skills/venture-flywheel/state/execution-event.cjs +191 -0
- package/standard-skills/venture-flywheel/state/task-state-machine.cjs +190 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Venture Flywheel: Beispiele für Phase 0
|
|
2
|
+
|
|
3
|
+
Phase 0 stellt ausschließlich reine Verträge bereit. Sie führt keine
|
|
4
|
+
Repository-Befehle aus, verwendet kein Netzwerk und führt weder Deployments
|
|
5
|
+
noch Veröffentlichungen, Käufe oder ausgehende Nachrichten durch.
|
|
6
|
+
|
|
7
|
+
## Öffentliche Funktionen
|
|
8
|
+
|
|
9
|
+
- `deriveProjectIdentity` leitet aus Repository-Fakten und einem
|
|
10
|
+
authentifizierten Konto eine deterministische Projektidentität ab.
|
|
11
|
+
- `createRepositoryTrust` erzeugt den anfänglichen Datensatz mit `UNTRUSTED`.
|
|
12
|
+
- `transitionRepositoryTrust` wendet einen ausdrücklichen, versionierten
|
|
13
|
+
Trust-Wechsel an.
|
|
14
|
+
- `evaluateCapability` liefert `allow`, `deny` oder `approval_required` und
|
|
15
|
+
entscheidet bei Unklarheit ablehnend.
|
|
16
|
+
- `transitionRun` führt genau einen zulässigen, optimistisch versionierten
|
|
17
|
+
Zustandswechsel aus.
|
|
18
|
+
- `createExecutionEvent` erzeugt ein deterministisches, hash-verkettetes
|
|
19
|
+
Prüfereignis und weist geheimnisverdächtige Felder in Nutzdaten ab.
|
|
20
|
+
- `verifyEventChain` prüft Reihenfolge, Verknüpfungen und Hashes einer
|
|
21
|
+
vollständigen Ereigniskette.
|
|
22
|
+
|
|
23
|
+
## Vollständiges Beispiel
|
|
24
|
+
|
|
25
|
+
Das folgende CommonJS-Beispiel leitet eine Projektidentität ab, erzeugt lokalen
|
|
26
|
+
Trust, vergleicht die Ausführung im Repository mit der Ausführung in einem
|
|
27
|
+
isolierten Worktree, setzt einen Lauf fort, erzeugt zwei verkettete Ereignisse
|
|
28
|
+
und prüft anschließend die Kette.
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
const { deriveProjectIdentity } = require('./identity/project-identity.cjs');
|
|
32
|
+
const {
|
|
33
|
+
CAPABILITIES,
|
|
34
|
+
createRepositoryTrust,
|
|
35
|
+
transitionRepositoryTrust,
|
|
36
|
+
} = require('./policy/repository-trust.cjs');
|
|
37
|
+
const { evaluateCapability } = require('./policy/capability-engine.cjs');
|
|
38
|
+
const { transitionRun } = require('./state/task-state-machine.cjs');
|
|
39
|
+
const {
|
|
40
|
+
createExecutionEvent,
|
|
41
|
+
verifyEventChain,
|
|
42
|
+
} = require('./state/execution-event.cjs');
|
|
43
|
+
|
|
44
|
+
const identity = deriveProjectIdentity({
|
|
45
|
+
repository_host: 'github.com',
|
|
46
|
+
repository_owner: 'example',
|
|
47
|
+
repository_name: 'venture',
|
|
48
|
+
canonical_remote_url: 'git@github.com:example/venture.git',
|
|
49
|
+
local_repository_root: 'C:/Work/venture',
|
|
50
|
+
initial_repository_fingerprint: `sha256:${'a'.repeat(64)}`,
|
|
51
|
+
}, { account_id: 'account-123' });
|
|
52
|
+
|
|
53
|
+
const initialTrust = createRepositoryTrust(identity);
|
|
54
|
+
const localCapabilities = [
|
|
55
|
+
'network.none',
|
|
56
|
+
'repo.metadata.read',
|
|
57
|
+
'repo.read',
|
|
58
|
+
'sandbox.execute',
|
|
59
|
+
'workspace.write',
|
|
60
|
+
'worktree.create',
|
|
61
|
+
];
|
|
62
|
+
const granted = new Set(localCapabilities);
|
|
63
|
+
const localTrust = transitionRepositoryTrust(initialTrust, {
|
|
64
|
+
event_id: 'evt-trust-local',
|
|
65
|
+
expected_version: initialTrust.version,
|
|
66
|
+
from_trust_level: initialTrust.trust_level,
|
|
67
|
+
to_trust_level: 'TRUSTED_LOCAL',
|
|
68
|
+
granted_capabilities: [...granted].sort(),
|
|
69
|
+
denied_capabilities: CAPABILITIES.filter(
|
|
70
|
+
(capability) => !granted.has(capability),
|
|
71
|
+
),
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const deniedInRepository = evaluateCapability({
|
|
75
|
+
project_identity: identity,
|
|
76
|
+
repository_trust: localTrust,
|
|
77
|
+
capability: 'sandbox.execute',
|
|
78
|
+
execution_scope: 'repository',
|
|
79
|
+
});
|
|
80
|
+
const allowedInWorktree = evaluateCapability({
|
|
81
|
+
project_identity: identity,
|
|
82
|
+
repository_trust: localTrust,
|
|
83
|
+
capability: 'sandbox.execute',
|
|
84
|
+
execution_scope: 'isolated_worktree',
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
let run = { run_id: 'run-001', state: 'discovered', version: 0 };
|
|
88
|
+
run = transitionRun(run, {
|
|
89
|
+
event_id: 'evt-profiled',
|
|
90
|
+
expected_version: 0,
|
|
91
|
+
from_state: 'discovered',
|
|
92
|
+
to_state: 'profiled',
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const firstEvent = createExecutionEvent({
|
|
96
|
+
event_id: 'evt-profiled',
|
|
97
|
+
run_id: run.run_id,
|
|
98
|
+
project_id: identity.project_id,
|
|
99
|
+
actor: { type: 'agent', id: 'agent-1', session_id: 'session-1' },
|
|
100
|
+
event_type: 'run.profiled',
|
|
101
|
+
occurred_at: '2026-08-24T10:00:00.000Z',
|
|
102
|
+
payload: {
|
|
103
|
+
from_state: 'discovered',
|
|
104
|
+
to_state: 'profiled',
|
|
105
|
+
version: run.version,
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
const secondEvent = createExecutionEvent({
|
|
109
|
+
event_id: 'evt-policy',
|
|
110
|
+
run_id: run.run_id,
|
|
111
|
+
project_id: identity.project_id,
|
|
112
|
+
actor: { type: 'agent', id: 'agent-1', session_id: 'session-1' },
|
|
113
|
+
event_type: 'policy.checked',
|
|
114
|
+
occurred_at: '2026-08-24T10:01:00.000Z',
|
|
115
|
+
payload: { decision: allowedInWorktree.decision },
|
|
116
|
+
previous_event_hash: firstEvent.event_hash,
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
console.log(deniedInRepository);
|
|
120
|
+
console.log(allowedInWorktree);
|
|
121
|
+
console.log(verifyEventChain([firstEvent, secondEvent]));
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Erwartete Entscheidungen: Die Ausführung im Repository wird mit
|
|
125
|
+
`isolated_worktree_required` abgewiesen, die Ausführung im isolierten Worktree
|
|
126
|
+
wird erlaubt und die Kettenprüfung liefert `{ ok: true }`.
|
|
127
|
+
|
|
128
|
+
## Wichtige Schutzregeln
|
|
129
|
+
|
|
130
|
+
- Ein Repository beginnt mit `UNTRUSTED`; Trust-Hochstufungen müssen
|
|
131
|
+
nacheinander erfolgen.
|
|
132
|
+
- Jeder Trust- und Laufwechsel muss die aktuelle `expected_version` verwenden.
|
|
133
|
+
- `workspace.write` und `sandbox.execute` erfordern
|
|
134
|
+
`execution_scope: 'isolated_worktree'`.
|
|
135
|
+
- Externe oder irreversible Fähigkeiten liefern niemals `allow`, sondern
|
|
136
|
+
höchstens `approval_required`.
|
|
137
|
+
- `completed` erfordert `final_evidence_id`, `rolled_back` erfordert
|
|
138
|
+
`rollback_evidence_id` innerhalb von `evidence`.
|
|
139
|
+
- Ereignisnutzdaten mit Feldern wie `token`, `password`, `secret`, `api_key`
|
|
140
|
+
oder `access_token` werden vor dem Hashen abgewiesen.
|
|
141
|
+
- `no_action` ist ein gültiges Endergebnis.
|
|
142
|
+
|
|
143
|
+
## Prüfung
|
|
144
|
+
|
|
145
|
+
Führe `node --test test/venture-flywheel-state.test.js`,
|
|
146
|
+
`node --test test/venture-flywheel-trust.test.js` und `npm test` aus.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Capability Map: Universal Venture Flywheel
|
|
2
|
+
|
|
3
|
+
Source direction: UVF-Core RFC 2.0.0. This map keeps each rollout phase
|
|
4
|
+
independently testable and prevents the advisor, executor, and deployment gate
|
|
5
|
+
from becoming one authority.
|
|
6
|
+
|
|
7
|
+
| Module id | Responsibility | Depends on |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| contracts-trust | Schemas, project scope, trust, capabilities, event log, state machine | - |
|
|
10
|
+
| venture-advisor | Read-only discovery, metrics, baselines, proposals, strategic-authority bridge | contracts-trust |
|
|
11
|
+
| local-execution | Leases, isolated worktrees, sandbox, scoped execution, verification bundles | contracts-trust, venture-advisor |
|
|
12
|
+
| approval-deployment | Exact-state approval, adapter preflight, idempotency, staging, rollback | contracts-trust, local-execution |
|
|
13
|
+
| observation | Post-deployment metrics, guardrails, attribution, inconclusive outcomes | contracts-trust, approval-deployment |
|
|
14
|
+
| controlled-learning | Effectiveness history and human-approved bounded adaptation | observation |
|
|
15
|
+
|
|
16
|
+
Build order:
|
|
17
|
+
|
|
18
|
+
```text
|
|
19
|
+
contracts-trust
|
|
20
|
+
-> venture-advisor
|
|
21
|
+
-> local-execution
|
|
22
|
+
-> approval-deployment
|
|
23
|
+
-> observation
|
|
24
|
+
-> controlled-learning
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The first implementation slice inside `contracts-trust` is `state-events`:
|
|
28
|
+
canonical run transitions plus a hash-linked, secret-rejecting event envelope.
|
|
29
|
+
It has no execution capability.
|
|
30
|
+
|
|
31
|
+
The second slice is `identity-trust`: deterministic project identity from
|
|
32
|
+
repository facts plus authenticated host context, explicit repository trust
|
|
33
|
+
transitions, and deny-by-default capability decisions. It is also side-effect
|
|
34
|
+
free and grants no execution path by itself.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Spec: UVF Phase 0 Identity, Trust, and Capability Contracts
|
|
2
|
+
|
|
3
|
+
## Objective
|
|
4
|
+
|
|
5
|
+
Provide a deterministic policy boundary before any UVF repository action.
|
|
6
|
+
Project identity combines observed repository facts with a separately supplied
|
|
7
|
+
authenticated host context. Repository trust starts at `UNTRUSTED`, changes
|
|
8
|
+
only through versioned explicit transitions, and partitions every known
|
|
9
|
+
capability into granted or denied. Capability evaluation fails closed.
|
|
10
|
+
|
|
11
|
+
This slice does not inspect a repository, execute a command, create a worktree,
|
|
12
|
+
open a network connection, persist trust, or approve an external action.
|
|
13
|
+
|
|
14
|
+
## Public Contracts
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
const identity = deriveProjectIdentity(repositoryFacts, authenticatedHostContext);
|
|
18
|
+
const trust = createRepositoryTrust(identity);
|
|
19
|
+
const nextTrust = transitionRepositoryTrust(trust, request);
|
|
20
|
+
const decision = evaluateCapability({
|
|
21
|
+
project_identity: identity,
|
|
22
|
+
repository_trust: nextTrust,
|
|
23
|
+
capability: 'sandbox.execute',
|
|
24
|
+
execution_scope: 'isolated_worktree',
|
|
25
|
+
});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Repository facts cannot contain an account, user, or owner identity. The
|
|
29
|
+
authenticated account enters only through the second argument. Equivalent SSH
|
|
30
|
+
and HTTPS remotes produce the same canonical repository identity.
|
|
31
|
+
|
|
32
|
+
## Trust Levels
|
|
33
|
+
|
|
34
|
+
- `UNTRUSTED`: metadata and repository reads only.
|
|
35
|
+
- `TRUSTED_LOCAL`: explicit local capabilities may run later, but write and
|
|
36
|
+
execution capabilities require an isolated worktree.
|
|
37
|
+
- `TRUSTED_DEPLOY`: external capabilities may be requested, but they return
|
|
38
|
+
`approval_required`; this contract never approves them.
|
|
39
|
+
|
|
40
|
+
Upgrades are sequential. Downgrades may return directly to a lower trust level.
|
|
41
|
+
Every transition checks `expected_version`, records an event ID, and supplies a
|
|
42
|
+
complete non-overlapping grant/deny partition for the known capability set.
|
|
43
|
+
|
|
44
|
+
## Commands
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
node --test test/venture-flywheel-trust.test.js
|
|
48
|
+
node --check standard-skills/venture-flywheel/identity/project-identity.cjs
|
|
49
|
+
node --check standard-skills/venture-flywheel/policy/repository-trust.cjs
|
|
50
|
+
node --check standard-skills/venture-flywheel/policy/capability-engine.cjs
|
|
51
|
+
npm test
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Testing Strategy
|
|
55
|
+
|
|
56
|
+
- Equivalent repository observations must derive the same identity.
|
|
57
|
+
- A different authenticated account must derive a different project ID.
|
|
58
|
+
- Identity fields injected into repository facts must be rejected.
|
|
59
|
+
- Unknown repositories may read but cannot write, execute, or use network.
|
|
60
|
+
- Forged grants above a trust ceiling remain denied.
|
|
61
|
+
- Local write and execution require an isolated worktree.
|
|
62
|
+
- External and irreversible capabilities never return `allow`.
|
|
63
|
+
- Stale or skipped trust upgrades are rejected.
|
|
64
|
+
- Schemas are strict and all modules remain free of I/O primitives.
|
|
65
|
+
|
|
66
|
+
## Success Criteria
|
|
67
|
+
|
|
68
|
+
- Cross-account and cross-project evaluations fail closed.
|
|
69
|
+
- Capability decisions are one of `allow`, `deny`, or `approval_required`.
|
|
70
|
+
- Every known capability appears exactly once in a trust record.
|
|
71
|
+
- Exported collections and returned records are deeply immutable.
|
|
72
|
+
- Focused mutation probes and the complete package suite are green.
|
|
73
|
+
|
|
74
|
+
## Boundary
|
|
75
|
+
|
|
76
|
+
Persistence, repository detection, command execution, worktree creation,
|
|
77
|
+
network adapters, approval issuance, and deployment remain later slices.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Spec: UVF Phase 0 State and Event Contracts
|
|
2
|
+
|
|
3
|
+
## Objective
|
|
4
|
+
|
|
5
|
+
Provide the smallest deterministic foundation that makes every UVF run state
|
|
6
|
+
transition auditable. The module rejects illegal and stale transitions, gates
|
|
7
|
+
terminal states on required evidence, creates hash-linked event envelopes, and
|
|
8
|
+
rejects secret-shaped audit payloads.
|
|
9
|
+
|
|
10
|
+
This slice does not execute commands, inspect repositories, write event files,
|
|
11
|
+
open network connections, or expose a user-facing UVF command.
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
Focused test:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
node --test test/venture-flywheel-state.test.js
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Full suite:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
npm test
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Syntax checks:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
node --check standard-skills/venture-flywheel/state/task-state-machine.cjs
|
|
31
|
+
node --check standard-skills/venture-flywheel/state/execution-event.cjs
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Project Structure
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
standard-skills/venture-flywheel/
|
|
38
|
+
SKILL.md
|
|
39
|
+
references/
|
|
40
|
+
schemas/run-transition.schema.json
|
|
41
|
+
schemas/execution-event.schema.json
|
|
42
|
+
state/task-state-machine.cjs
|
|
43
|
+
state/execution-event.cjs
|
|
44
|
+
test/venture-flywheel-state.test.js
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Code Style
|
|
48
|
+
|
|
49
|
+
CommonJS, pure functions, frozen exported contracts, explicit machine-readable
|
|
50
|
+
error codes, no hidden I/O:
|
|
51
|
+
|
|
52
|
+
```js
|
|
53
|
+
const next = transitionRun(current, {
|
|
54
|
+
event_id: 'evt_01J...',
|
|
55
|
+
expected_version: current.version,
|
|
56
|
+
from_state: current.state,
|
|
57
|
+
to_state: 'profiled',
|
|
58
|
+
});
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Testing Strategy
|
|
62
|
+
|
|
63
|
+
- Small unit tests cover the canonical path and every guard direction.
|
|
64
|
+
- Mutation-style red probes attempt transition skipping, stale writes, missing
|
|
65
|
+
completion evidence, broken hash links, event mutation, and secret payloads.
|
|
66
|
+
- The standard-skill bootstrap test proves the contract ships with BLUN King.
|
|
67
|
+
- The full package suite protects unrelated console behavior.
|
|
68
|
+
|
|
69
|
+
## Boundaries
|
|
70
|
+
|
|
71
|
+
- Always: validate inputs strictly, reject unknown states and fields, preserve
|
|
72
|
+
deterministic hashes, keep transitions side-effect free.
|
|
73
|
+
- Ask first: change canonical transition topology, add persistence, expose a
|
|
74
|
+
CLI/MCP command, or connect repository identity.
|
|
75
|
+
- Never: execute repository code, grant capabilities, perform external action,
|
|
76
|
+
include secrets in audit data, or infer approval from an event.
|
|
77
|
+
|
|
78
|
+
## Success Criteria
|
|
79
|
+
|
|
80
|
+
- The documented canonical forward path is accepted.
|
|
81
|
+
- An illegal jump and a stale optimistic version are rejected.
|
|
82
|
+
- `completed` requires final evidence and `rolled_back` requires rollback
|
|
83
|
+
evidence.
|
|
84
|
+
- Every accepted transition increments the version and records its event ID.
|
|
85
|
+
- Event hashes are deterministic and a mutation or broken link is detected.
|
|
86
|
+
- Secret-shaped fields are rejected recursively before hashing.
|
|
87
|
+
- JSON schemas reject unknown top-level fields.
|
|
88
|
+
- Focused tests and the complete package suite are green.
|
|
89
|
+
|
|
90
|
+
## Open Questions
|
|
91
|
+
|
|
92
|
+
None inside this slice. Persistence, project identity, trust grants, and the
|
|
93
|
+
full schema set remain later `contracts-trust` tasks.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://blun.ai/schemas/uvf/capability-decision.schema.json",
|
|
4
|
+
"title": "UVF Capability Decision",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["capability", "decision", "reason"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"capability": { "type": "string", "minLength": 1 },
|
|
10
|
+
"decision": { "enum": ["allow", "deny", "approval_required"] },
|
|
11
|
+
"reason": { "type": "string", "minLength": 1 }
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://blun.ai/schemas/uvf/execution-event.schema.json",
|
|
4
|
+
"title": "UVF Execution Event",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"event_id",
|
|
9
|
+
"run_id",
|
|
10
|
+
"project_id",
|
|
11
|
+
"actor",
|
|
12
|
+
"event_type",
|
|
13
|
+
"occurred_at",
|
|
14
|
+
"payload",
|
|
15
|
+
"previous_event_hash",
|
|
16
|
+
"event_hash"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"event_id": { "type": "string", "minLength": 1 },
|
|
20
|
+
"run_id": { "type": "string", "minLength": 1 },
|
|
21
|
+
"project_id": { "type": "string", "minLength": 1 },
|
|
22
|
+
"actor": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": ["type", "id", "session_id"],
|
|
26
|
+
"properties": {
|
|
27
|
+
"type": { "enum": ["agent", "user", "system"] },
|
|
28
|
+
"id": { "type": "string", "minLength": 1 },
|
|
29
|
+
"session_id": { "type": "string", "minLength": 1 }
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"event_type": { "type": "string", "minLength": 1 },
|
|
33
|
+
"occurred_at": { "type": "string", "format": "date-time" },
|
|
34
|
+
"payload": { "type": "object" },
|
|
35
|
+
"previous_event_hash": {
|
|
36
|
+
"type": ["string", "null"],
|
|
37
|
+
"pattern": "^sha256:[a-f0-9]{64}$"
|
|
38
|
+
},
|
|
39
|
+
"event_hash": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"pattern": "^sha256:[a-f0-9]{64}$"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://blun.ai/schemas/uvf/project-identity.schema.json",
|
|
4
|
+
"title": "UVF Project Identity",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["project_id", "account_id", "repository"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"project_id": { "type": "string", "pattern": "^project:sha256:[a-f0-9]{64}$" },
|
|
10
|
+
"account_id": { "type": "string", "minLength": 1 },
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"additionalProperties": false,
|
|
14
|
+
"required": [
|
|
15
|
+
"host",
|
|
16
|
+
"owner",
|
|
17
|
+
"name",
|
|
18
|
+
"canonical_remote_url",
|
|
19
|
+
"local_repository_root",
|
|
20
|
+
"initial_repository_fingerprint"
|
|
21
|
+
],
|
|
22
|
+
"properties": {
|
|
23
|
+
"host": { "type": "string", "minLength": 1 },
|
|
24
|
+
"owner": { "type": "string", "minLength": 1 },
|
|
25
|
+
"name": { "type": "string", "minLength": 1 },
|
|
26
|
+
"canonical_remote_url": { "type": "string", "pattern": "^https://" },
|
|
27
|
+
"local_repository_root": { "type": "string", "minLength": 1 },
|
|
28
|
+
"initial_repository_fingerprint": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://blun.ai/schemas/uvf/repository-trust.schema.json",
|
|
4
|
+
"title": "UVF Repository Trust",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"project_id",
|
|
9
|
+
"account_id",
|
|
10
|
+
"trust_level",
|
|
11
|
+
"version",
|
|
12
|
+
"granted_capabilities",
|
|
13
|
+
"denied_capabilities",
|
|
14
|
+
"last_event_id"
|
|
15
|
+
],
|
|
16
|
+
"properties": {
|
|
17
|
+
"project_id": { "type": "string", "pattern": "^project:sha256:[a-f0-9]{64}$" },
|
|
18
|
+
"account_id": { "type": "string", "minLength": 1 },
|
|
19
|
+
"trust_level": { "enum": ["UNTRUSTED", "TRUSTED_LOCAL", "TRUSTED_DEPLOY"] },
|
|
20
|
+
"version": { "type": "integer", "minimum": 0 },
|
|
21
|
+
"granted_capabilities": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"uniqueItems": true,
|
|
24
|
+
"items": {
|
|
25
|
+
"enum": [
|
|
26
|
+
"deploy.production",
|
|
27
|
+
"network.external",
|
|
28
|
+
"network.none",
|
|
29
|
+
"network.registry.read",
|
|
30
|
+
"repo.metadata.read",
|
|
31
|
+
"repo.read",
|
|
32
|
+
"sandbox.execute",
|
|
33
|
+
"workspace.write",
|
|
34
|
+
"worktree.create"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"denied_capabilities": {
|
|
39
|
+
"type": "array",
|
|
40
|
+
"uniqueItems": true,
|
|
41
|
+
"items": {
|
|
42
|
+
"enum": [
|
|
43
|
+
"deploy.production",
|
|
44
|
+
"network.external",
|
|
45
|
+
"network.none",
|
|
46
|
+
"network.registry.read",
|
|
47
|
+
"repo.metadata.read",
|
|
48
|
+
"repo.read",
|
|
49
|
+
"sandbox.execute",
|
|
50
|
+
"workspace.write",
|
|
51
|
+
"worktree.create"
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"last_event_id": { "type": ["string", "null"], "minLength": 1 }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://blun.ai/schemas/uvf/run-transition.schema.json",
|
|
4
|
+
"title": "UVF Run Transition",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"event_id",
|
|
9
|
+
"expected_version",
|
|
10
|
+
"from_state",
|
|
11
|
+
"to_state"
|
|
12
|
+
],
|
|
13
|
+
"$defs": {
|
|
14
|
+
"state": {
|
|
15
|
+
"enum": [
|
|
16
|
+
"discovered",
|
|
17
|
+
"profiled",
|
|
18
|
+
"configured",
|
|
19
|
+
"baseline_measured",
|
|
20
|
+
"observing",
|
|
21
|
+
"evidence_ready",
|
|
22
|
+
"proposal_created",
|
|
23
|
+
"selected_by_strategic_authority",
|
|
24
|
+
"approved_for_local_execution",
|
|
25
|
+
"executing_local",
|
|
26
|
+
"verifying",
|
|
27
|
+
"blocked",
|
|
28
|
+
"aborted",
|
|
29
|
+
"no_action",
|
|
30
|
+
"locally_verified",
|
|
31
|
+
"completed_local",
|
|
32
|
+
"waiting_approval",
|
|
33
|
+
"denied",
|
|
34
|
+
"expired",
|
|
35
|
+
"approved_exact_state",
|
|
36
|
+
"deploying",
|
|
37
|
+
"post_deploy_observation",
|
|
38
|
+
"attribution_pending",
|
|
39
|
+
"completed",
|
|
40
|
+
"rolled_back",
|
|
41
|
+
"inconclusive"
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"properties": {
|
|
46
|
+
"event_id": { "type": "string", "minLength": 1 },
|
|
47
|
+
"expected_version": { "type": "integer", "minimum": 0 },
|
|
48
|
+
"from_state": { "$ref": "#/$defs/state" },
|
|
49
|
+
"to_state": { "$ref": "#/$defs/state" },
|
|
50
|
+
"evidence": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"additionalProperties": false,
|
|
53
|
+
"properties": {
|
|
54
|
+
"final_evidence_id": { "type": "string", "minLength": 1 },
|
|
55
|
+
"rollback_evidence_id": { "type": "string", "minLength": 1 }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|