pakem-cli 0.0.0-stage → 1.2.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/CHANGELOG.md +271 -0
- package/LICENSE +21 -0
- package/README-ID.md +665 -0
- package/README.md +664 -2
- package/SKILL.md +264 -0
- package/adapters/git-worktree/v1/README.md +17 -0
- package/adapters/identity/v1/README.md +26 -0
- package/adapters/mcp/v1/README.md +56 -0
- package/adapters/storage-sqlite/v1/README.md +5 -0
- package/assets/banner.svg +275 -0
- package/assets/divider.svg +82 -0
- package/assets/footer.svg +174 -0
- package/assets/templates/BUG-HISTORY.md +18 -0
- package/assets/templates/CONTEXT.md +26 -0
- package/assets/templates/DECISIONS.md +8 -0
- package/assets/templates/MODULE-MAP.md +14 -0
- package/assets/templates/POLICY.json +15 -0
- package/assets/templates/PROJECT.md +42 -0
- package/conformance/v1/README.md +15 -0
- package/coordination/v1/README.md +14 -0
- package/coordination/v1/board.schema.json +59 -0
- package/coordination/v1/event.schema.json +26 -0
- package/coordination/v1/status.schema.json +49 -0
- package/evals/README.md +63 -0
- package/evals/evals.json +276 -0
- package/identity/v1/README.md +14 -0
- package/identity/v1/agent-identity.schema.json +95 -0
- package/identity/v1/identity-registry.schema.json +29 -0
- package/identity/v1/signed-payload.schema.json +42 -0
- package/intelligence/v1/README.md +19 -0
- package/intelligence/v1/dependency-graph.schema.json +82 -0
- package/intelligence/v1/impact-analysis.schema.json +51 -0
- package/intelligence/v1/reconciliation.schema.json +156 -0
- package/npm/bin/pakem.js +150 -0
- package/npm/check-version.js +26 -0
- package/package.json +55 -4
- package/policy/v1/README.md +15 -0
- package/policy/v1/policy.schema.json +20 -0
- package/protocol/v1/README.md +68 -0
- package/protocol/v1/capabilities.schema.json +17 -0
- package/protocol/v1/event.schema.json +114 -0
- package/protocol/v1/session.schema.json +51 -0
- package/references/artifacts.md +96 -0
- package/references/conventions.md +83 -0
- package/references/reviews.md +44 -0
- package/runtime/v1/README.md +21 -0
- package/runtime/v1/approval.schema.json +100 -0
- package/runtime/v1/checkpoint.schema.json +17 -0
- package/runtime/v1/hook-decision.schema.json +34 -0
- package/runtime/v1/hook-payload.schema.json +12 -0
- package/runtime/v1/task-evidence.schema.json +38 -0
- package/runtime/v1/work-report.schema.json +123 -0
- package/runtime/v1/workflow.schema.json +21 -0
- package/scripts/__pycache__/pakem.cpython-312.pyc +0 -0
- package/scripts/pakem.py +4911 -0
- package/scripts/pakem_core/__init__.py +3 -0
- package/scripts/pakem_core/__pycache__/__init__.cpython-312.pyc +0 -0
- package/scripts/pakem_core/__pycache__/coordination.cpython-312.pyc +0 -0
- package/scripts/pakem_core/__pycache__/git_worktree.cpython-312.pyc +0 -0
- package/scripts/pakem_core/__pycache__/identity.cpython-312.pyc +0 -0
- package/scripts/pakem_core/__pycache__/intelligence.cpython-312.pyc +0 -0
- package/scripts/pakem_core/__pycache__/mcp_server.cpython-312.pyc +0 -0
- package/scripts/pakem_core/__pycache__/protocol.cpython-312.pyc +0 -0
- package/scripts/pakem_core/__pycache__/reconcile.cpython-312.pyc +0 -0
- package/scripts/pakem_core/__pycache__/runtime.cpython-312.pyc +0 -0
- package/scripts/pakem_core/coordination.py +977 -0
- package/scripts/pakem_core/git_worktree.py +265 -0
- package/scripts/pakem_core/identity.py +494 -0
- package/scripts/pakem_core/intelligence.py +684 -0
- package/scripts/pakem_core/mcp_server.py +308 -0
- package/scripts/pakem_core/protocol.py +61 -0
- package/scripts/pakem_core/reconcile.py +119 -0
- package/scripts/pakem_core/runtime.py +457 -0
- package/scripts/run_evals.py +289 -0
- package/storage/v1/README.md +14 -0
- package/storage/v1/team-storage.schema.json +27 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "urn:pakem:runtime:v1:approval",
|
|
4
|
+
"title": "Pakem Policy Approval Store v1",
|
|
5
|
+
"description": "One-use approval records granted by an operator through a trusted host channel. Hosts must verify scope, expiry, and single use before acting.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"schemaVersion",
|
|
9
|
+
"approvals"
|
|
10
|
+
],
|
|
11
|
+
"properties": {
|
|
12
|
+
"schemaVersion": {
|
|
13
|
+
"const": 1
|
|
14
|
+
},
|
|
15
|
+
"approvals": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"maxItems": 500,
|
|
18
|
+
"items": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"required": [
|
|
21
|
+
"approvalId",
|
|
22
|
+
"category",
|
|
23
|
+
"risk",
|
|
24
|
+
"scopeHash",
|
|
25
|
+
"reason",
|
|
26
|
+
"grantedAt",
|
|
27
|
+
"expiresAt",
|
|
28
|
+
"consumedAt"
|
|
29
|
+
],
|
|
30
|
+
"properties": {
|
|
31
|
+
"approvalId": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"pattern": "^[a-f0-9]{32}$"
|
|
34
|
+
},
|
|
35
|
+
"category": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"enum": [
|
|
38
|
+
"read",
|
|
39
|
+
"write",
|
|
40
|
+
"command",
|
|
41
|
+
"destructive",
|
|
42
|
+
"deploy",
|
|
43
|
+
"security",
|
|
44
|
+
"policy_change",
|
|
45
|
+
"gate_change"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"risk": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"enum": [
|
|
51
|
+
"low",
|
|
52
|
+
"medium",
|
|
53
|
+
"high",
|
|
54
|
+
"critical"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"targetHash": {
|
|
58
|
+
"type": [
|
|
59
|
+
"string",
|
|
60
|
+
"null"
|
|
61
|
+
],
|
|
62
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
63
|
+
},
|
|
64
|
+
"scopeHash": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
67
|
+
},
|
|
68
|
+
"workflowId": {
|
|
69
|
+
"type": [
|
|
70
|
+
"string",
|
|
71
|
+
"null"
|
|
72
|
+
],
|
|
73
|
+
"minLength": 1
|
|
74
|
+
},
|
|
75
|
+
"reason": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"minLength": 1,
|
|
78
|
+
"maxLength": 500
|
|
79
|
+
},
|
|
80
|
+
"grantedAt": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"format": "date-time"
|
|
83
|
+
},
|
|
84
|
+
"expiresAt": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"format": "date-time"
|
|
87
|
+
},
|
|
88
|
+
"consumedAt": {
|
|
89
|
+
"type": [
|
|
90
|
+
"string",
|
|
91
|
+
"null"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"additionalProperties": false
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"additionalProperties": false
|
|
100
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "urn:pakem:runtime:v1:checkpoint",
|
|
4
|
+
"title": "Pakem Runtime Checkpoint v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["schemaVersion", "checkpointId", "workflowId", "label", "createdAt", "workflow", "repository"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"schemaVersion": {"const": 1},
|
|
9
|
+
"checkpointId": {"type": "string", "minLength": 1},
|
|
10
|
+
"workflowId": {"type": "string", "minLength": 1},
|
|
11
|
+
"label": {"type": "string"},
|
|
12
|
+
"createdAt": {"type": "string", "format": "date-time"},
|
|
13
|
+
"workflow": {"$ref": "urn:pakem:runtime:v1:workflow"},
|
|
14
|
+
"repository": {"type": "object", "required": ["head", "status"], "properties": {"head": {"type": ["string", "null"]}, "status": {"type": ["array", "null"], "items": {"type": "string"}}, "additionalProperties": true}}
|
|
15
|
+
},
|
|
16
|
+
"additionalProperties": false
|
|
17
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "urn:pakem:runtime:v1:hook-decision",
|
|
4
|
+
"title": "Pakem Lifecycle Hook Decision v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["protocol", "runtime_version", "hook", "decision", "allowed", "requiresApproval", "reason", "category", "risk", "receipt"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"protocol": {"const": "pakem"},
|
|
9
|
+
"runtime_version": {"const": 1},
|
|
10
|
+
"hook": {"enum": ["session.start", "task.before", "task.after", "verification.before", "session.finish", "handover"]},
|
|
11
|
+
"decision": {"enum": ["allow", "require_approval", "deny"]},
|
|
12
|
+
"allowed": {"type": "boolean"},
|
|
13
|
+
"requiresApproval": {"type": "boolean"},
|
|
14
|
+
"reason": {"type": "string"},
|
|
15
|
+
"category": {"enum": ["read", "write", "command", "destructive", "deploy", "security", "policy_change", "gate_change"]},
|
|
16
|
+
"risk": {"enum": ["low", "medium", "high", "critical"]},
|
|
17
|
+
"approvalId": {"type": "string"},
|
|
18
|
+
"receipt": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"required": ["hook", "occurredAt", "decision", "category", "risk", "reason"],
|
|
21
|
+
"properties": {
|
|
22
|
+
"hook": {"type": "string"},
|
|
23
|
+
"occurredAt": {"type": "string", "format": "date-time"},
|
|
24
|
+
"decision": {"enum": ["allow", "require_approval", "deny"]},
|
|
25
|
+
"category": {"type": "string"},
|
|
26
|
+
"risk": {"type": "string"},
|
|
27
|
+
"targetHash": {"type": ["string", "null"]},
|
|
28
|
+
"reason": {"type": "string"}
|
|
29
|
+
},
|
|
30
|
+
"additionalProperties": false
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"additionalProperties": false
|
|
34
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "urn:pakem:runtime:v1:hook-payload",
|
|
4
|
+
"title": "Pakem Lifecycle Hook Payload v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"category": {"enum": ["read", "write", "command", "destructive", "deploy", "security", "policy_change", "gate_change"]},
|
|
8
|
+
"risk": {"enum": ["low", "medium", "high", "critical"]},
|
|
9
|
+
"target": {"type": "string", "maxLength": 240}
|
|
10
|
+
},
|
|
11
|
+
"additionalProperties": true
|
|
12
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "urn:pakem:runtime:v1:task-evidence",
|
|
4
|
+
"title": "Pakem Task Evidence v1",
|
|
5
|
+
"description": "Verify evidence per task plan. One entry per task; `status: waived` means the task was finished without running verify and the reason is recorded.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["schema_version", "tasks"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schema_version": {"const": "pakem.task-evidence/v1"},
|
|
10
|
+
"tasks": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"maxProperties": 500,
|
|
13
|
+
"additionalProperties": {"$ref": "#/$defs/entry"}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"$defs": {
|
|
17
|
+
"entry": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"required": ["command", "status", "exit", "at", "files"],
|
|
20
|
+
"properties": {
|
|
21
|
+
"command": {"type": "string"},
|
|
22
|
+
"status": {"enum": ["pass", "fail", "waived"]},
|
|
23
|
+
"exit": {"type": ["integer", "null"]},
|
|
24
|
+
"at": {"type": "string"},
|
|
25
|
+
"reason": {"type": "string"},
|
|
26
|
+
"durationMs": {"type": "integer", "minimum": 0},
|
|
27
|
+
"outputHash": {"type": "string"},
|
|
28
|
+
"files": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"description": "Content fingerprint of scope files at the time verify ran; used to detect stale evidence.",
|
|
31
|
+
"additionalProperties": {"type": "string"}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"additionalProperties": false
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"additionalProperties": false
|
|
38
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "urn:pakem:runtime:v1:work-report",
|
|
4
|
+
"title": "Pakem Work Report v1",
|
|
5
|
+
"description": "Per-project work roll-up: sessions, tasks from PLAN.md, verify evidence per task, and event ledger status. The numbers come from artifacts that can be re-inspected, not from agent narration.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["schema_version", "generated_at", "scope", "sessions", "tasks", "ledger", "totals"],
|
|
8
|
+
"additionalProperties": false,
|
|
9
|
+
"properties": {
|
|
10
|
+
"schema_version": {"const": "pakem.work-report/v1"},
|
|
11
|
+
"generated_at": {"type": "string", "format": "date-time"},
|
|
12
|
+
"scope": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"required": ["session", "limit"],
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"properties": {
|
|
17
|
+
"session": {"type": ["string", "null"], "description": "Session filter applied; null when all sessions are included"},
|
|
18
|
+
"limit": {"type": ["integer", "null"], "minimum": 1}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"sessions": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"description": "Newest sessions first.",
|
|
24
|
+
"items": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"required": ["id", "goal", "agent", "status", "started_at", "finished_at",
|
|
27
|
+
"duration_ms", "steps", "events", "gate_failures", "warnings", "fabricated_verify"],
|
|
28
|
+
"additionalProperties": false,
|
|
29
|
+
"properties": {
|
|
30
|
+
"id": {"type": "string", "minLength": 1},
|
|
31
|
+
"goal": {"type": "string"},
|
|
32
|
+
"agent": {"type": "string"},
|
|
33
|
+
"status": {"type": "string"},
|
|
34
|
+
"started_at": {"type": ["string", "null"]},
|
|
35
|
+
"finished_at": {"type": ["string", "null"]},
|
|
36
|
+
"duration_ms": {
|
|
37
|
+
"type": ["integer", "null"],
|
|
38
|
+
"minimum": 0,
|
|
39
|
+
"description": "Wall-clock time of the session. Sessions not yet closed are counted up to generated_at."
|
|
40
|
+
},
|
|
41
|
+
"steps": {"type": "integer", "minimum": 0},
|
|
42
|
+
"events": {"type": "integer", "minimum": 0},
|
|
43
|
+
"gate_failures": {"type": "integer", "minimum": 0},
|
|
44
|
+
"warnings": {"type": "integer", "minimum": 0},
|
|
45
|
+
"fabricated_verify": {"type": "boolean"}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"tasks": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"description": "One entry per task in PLAN.md, including tasks that were dropped.",
|
|
52
|
+
"items": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"required": ["task_id", "state", "text", "scope", "verify_status",
|
|
55
|
+
"verify_duration_ms", "verified_at", "waived_reason", "evidence_files"],
|
|
56
|
+
"additionalProperties": false,
|
|
57
|
+
"properties": {
|
|
58
|
+
"task_id": {"type": "string", "minLength": 1},
|
|
59
|
+
"state": {"enum": ["open", "done", "dropped"]},
|
|
60
|
+
"text": {"type": "string"},
|
|
61
|
+
"scope": {"type": "array", "items": {"type": "string"}},
|
|
62
|
+
"verify_status": {"type": ["string", "null"], "enum": ["pass", "fail", "waived", null]},
|
|
63
|
+
"verify_duration_ms": {"type": ["integer", "null"], "minimum": 0},
|
|
64
|
+
"verified_at": {"type": ["string", "null"]},
|
|
65
|
+
"waived_reason": {"type": ["string", "null"]},
|
|
66
|
+
"evidence_files": {
|
|
67
|
+
"type": "array",
|
|
68
|
+
"items": {"type": "string"},
|
|
69
|
+
"description": "Files whose content fingerprint was recorded at the last verify."
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"ledger": {
|
|
75
|
+
"type": "object",
|
|
76
|
+
"required": ["files", "events", "seals", "head", "ok", "problems"],
|
|
77
|
+
"additionalProperties": false,
|
|
78
|
+
"properties": {
|
|
79
|
+
"files": {"type": "integer", "minimum": 0},
|
|
80
|
+
"events": {"type": "integer", "minimum": 0},
|
|
81
|
+
"seals": {"type": "integer", "minimum": 0},
|
|
82
|
+
"head": {"type": ["string", "null"]},
|
|
83
|
+
"ok": {"type": "boolean"},
|
|
84
|
+
"problems": {
|
|
85
|
+
"type": "array",
|
|
86
|
+
"items": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"required": ["file", "line", "reason"],
|
|
89
|
+
"additionalProperties": false,
|
|
90
|
+
"properties": {
|
|
91
|
+
"file": {"type": "string"},
|
|
92
|
+
"line": {"type": "integer", "minimum": 0},
|
|
93
|
+
"reason": {"type": "string"}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"totals": {
|
|
100
|
+
"type": "object",
|
|
101
|
+
"required": ["sessions", "duration_ms", "events", "tasks", "tasks_done", "tasks_open",
|
|
102
|
+
"tasks_dropped", "verified", "verify_failed", "waived", "unproven_done"],
|
|
103
|
+
"additionalProperties": false,
|
|
104
|
+
"properties": {
|
|
105
|
+
"sessions": {"type": "integer", "minimum": 0},
|
|
106
|
+
"duration_ms": {"type": "integer", "minimum": 0},
|
|
107
|
+
"events": {"type": "integer", "minimum": 0},
|
|
108
|
+
"tasks": {"type": "integer", "minimum": 0},
|
|
109
|
+
"tasks_done": {"type": "integer", "minimum": 0},
|
|
110
|
+
"tasks_open": {"type": "integer", "minimum": 0},
|
|
111
|
+
"tasks_dropped": {"type": "integer", "minimum": 0},
|
|
112
|
+
"verified": {"type": "integer", "minimum": 0},
|
|
113
|
+
"verify_failed": {"type": "integer", "minimum": 0},
|
|
114
|
+
"waived": {"type": "integer", "minimum": 0},
|
|
115
|
+
"unproven_done": {
|
|
116
|
+
"type": "integer",
|
|
117
|
+
"minimum": 0,
|
|
118
|
+
"description": "Tasks marked [x] without valid verify evidence — the task-verify gate rejects them."
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "urn:pakem:runtime:v1:workflow",
|
|
4
|
+
"title": "Pakem Runtime Workflow State v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["schemaVersion", "workflowId", "state", "revision", "createdAt", "updatedAt", "checkpointIds", "lastTransition"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"schemaVersion": {"const": 1},
|
|
9
|
+
"workflowId": {"type": "string", "minLength": 1},
|
|
10
|
+
"state": {"enum": ["initialized", "planning", "ready", "executing", "verifying", "blocked", "recovering", "completed", "failed"]},
|
|
11
|
+
"goal": {"type": "string"},
|
|
12
|
+
"revision": {"type": "integer", "minimum": 1},
|
|
13
|
+
"createdAt": {"type": "string", "format": "date-time"},
|
|
14
|
+
"updatedAt": {"type": "string", "format": "date-time"},
|
|
15
|
+
"activeSessionId": {"type": ["string", "null"]},
|
|
16
|
+
"currentTaskId": {"type": ["string", "null"]},
|
|
17
|
+
"checkpointIds": {"type": "array", "items": {"type": "string"}},
|
|
18
|
+
"lastTransition": {"type": "object", "required": ["from", "to", "reason", "at"], "properties": {"from": {"type": ["string", "null"]}, "to": {"type": "string"}, "reason": {"type": "string"}, "at": {"type": "string", "format": "date-time"}}, "additionalProperties": true}
|
|
19
|
+
},
|
|
20
|
+
"additionalProperties": true
|
|
21
|
+
}
|
|
Binary file
|