@asc-agent/runtime 0.1.0
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/LICENSE +15 -0
- package/README.md +22 -0
- package/dist/adapters/claude-code/binding.d.ts +5 -0
- package/dist/adapters/claude-code/binding.js +14 -0
- package/dist/adapters/claude-code/guard.d.ts +54 -0
- package/dist/adapters/claude-code/guard.js +295 -0
- package/dist/adapters/claude-code/install.d.ts +67 -0
- package/dist/adapters/claude-code/install.js +231 -0
- package/dist/adapters/claude-code/observer.d.ts +38 -0
- package/dist/adapters/claude-code/observer.js +77 -0
- package/dist/adapters/claude-code/probe.d.ts +53 -0
- package/dist/adapters/claude-code/probe.js +129 -0
- package/dist/adapters/claude-code/skill.d.ts +8 -0
- package/dist/adapters/claude-code/skill.js +267 -0
- package/dist/adapters/fixture-work/index.d.ts +34 -0
- package/dist/adapters/fixture-work/index.js +78 -0
- package/dist/adapters/github/adapter.d.ts +32 -0
- package/dist/adapters/github/adapter.js +95 -0
- package/dist/adapters/github/client.d.ts +30 -0
- package/dist/adapters/github/client.js +90 -0
- package/dist/adapters/github/context.d.ts +44 -0
- package/dist/adapters/github/context.js +170 -0
- package/dist/adapters/github/event-source.d.ts +55 -0
- package/dist/adapters/github/event-source.js +183 -0
- package/dist/adapters/github/scm.d.ts +50 -0
- package/dist/adapters/github/scm.js +104 -0
- package/dist/adapters/gitlab/adapter.d.ts +36 -0
- package/dist/adapters/gitlab/adapter.js +117 -0
- package/dist/adapters/gitlab/client.d.ts +30 -0
- package/dist/adapters/gitlab/client.js +47 -0
- package/dist/adapters/gitlab/ports.d.ts +40 -0
- package/dist/adapters/gitlab/ports.js +186 -0
- package/dist/adapters/jam/adapter.d.ts +53 -0
- package/dist/adapters/jam/adapter.js +144 -0
- package/dist/adapters/jam/event-source.d.ts +28 -0
- package/dist/adapters/jam/event-source.js +65 -0
- package/dist/adapters/jam/mcp-client.d.ts +50 -0
- package/dist/adapters/jam/mcp-client.js +218 -0
- package/dist/adapters/jam/ports.d.ts +51 -0
- package/dist/adapters/jam/ports.js +167 -0
- package/dist/adapters/local/identity.d.ts +27 -0
- package/dist/adapters/local/identity.js +40 -0
- package/dist/adapters/local/presentation.d.ts +14 -0
- package/dist/adapters/local/presentation.js +42 -0
- package/dist/adapters/markdown/layout.d.ts +15 -0
- package/dist/adapters/markdown/layout.js +49 -0
- package/dist/adapters/markdown/serialize.d.ts +9 -0
- package/dist/adapters/markdown/serialize.js +120 -0
- package/dist/adapters/markdown/state-store.d.ts +23 -0
- package/dist/adapters/markdown/state-store.js +316 -0
- package/dist/adapters/mattermost/client.d.ts +23 -0
- package/dist/adapters/mattermost/client.js +54 -0
- package/dist/adapters/mattermost/presentation.d.ts +43 -0
- package/dist/adapters/mattermost/presentation.js +88 -0
- package/dist/adapters/memory/mocks.d.ts +87 -0
- package/dist/adapters/memory/mocks.js +163 -0
- package/dist/adapters/memory/runtime-binding.d.ts +23 -0
- package/dist/adapters/memory/runtime-binding.js +118 -0
- package/dist/adapters/memory/state-store.d.ts +17 -0
- package/dist/adapters/memory/state-store.js +125 -0
- package/dist/adapters/text/renderer.d.ts +7 -0
- package/dist/adapters/text/renderer.js +81 -0
- package/dist/adapters/webhook/ingress.d.ts +103 -0
- package/dist/adapters/webhook/ingress.js +150 -0
- package/dist/cli/asc.d.ts +16 -0
- package/dist/cli/asc.js +2914 -0
- package/dist/cli/identity-config.d.ts +7 -0
- package/dist/cli/identity-config.js +31 -0
- package/dist/composition/observe.d.ts +21 -0
- package/dist/composition/observe.js +72 -0
- package/dist/composition/registry.d.ts +33 -0
- package/dist/composition/registry.js +62 -0
- package/dist/composition/runtime.d.ts +63 -0
- package/dist/composition/runtime.js +155 -0
- package/dist/core/approval/service.d.ts +17 -0
- package/dist/core/approval/service.js +129 -0
- package/dist/core/attach/bootstrap.d.ts +102 -0
- package/dist/core/attach/bootstrap.js +178 -0
- package/dist/core/attach/init.d.ts +29 -0
- package/dist/core/attach/init.js +100 -0
- package/dist/core/attach/setup-plan.d.ts +125 -0
- package/dist/core/attach/setup-plan.js +177 -0
- package/dist/core/attach/setup.d.ts +40 -0
- package/dist/core/attach/setup.js +140 -0
- package/dist/core/binding/types.d.ts +93 -0
- package/dist/core/binding/types.js +74 -0
- package/dist/core/distribution/release.d.ts +15 -0
- package/dist/core/distribution/release.js +27 -0
- package/dist/core/distribution/runtime-install.d.ts +50 -0
- package/dist/core/distribution/runtime-install.js +90 -0
- package/dist/core/distribution/runtime-select.d.ts +74 -0
- package/dist/core/distribution/runtime-select.js +149 -0
- package/dist/core/execution/executor.d.ts +51 -0
- package/dist/core/execution/executor.js +106 -0
- package/dist/core/execution/grant.d.ts +42 -0
- package/dist/core/execution/grant.js +78 -0
- package/dist/core/model/entities.d.ts +872 -0
- package/dist/core/model/entities.js +285 -0
- package/dist/core/model/ids.d.ts +41 -0
- package/dist/core/model/ids.js +50 -0
- package/dist/core/model/transitions.d.ts +26 -0
- package/dist/core/model/transitions.js +124 -0
- package/dist/core/monitor/coverage.d.ts +111 -0
- package/dist/core/monitor/coverage.js +129 -0
- package/dist/core/monitor/engine.d.ts +134 -0
- package/dist/core/monitor/engine.js +574 -0
- package/dist/core/monitor/health-alerts.d.ts +35 -0
- package/dist/core/monitor/health-alerts.js +88 -0
- package/dist/core/monitor/investigation.d.ts +82 -0
- package/dist/core/monitor/investigation.js +232 -0
- package/dist/core/monitor/observation.d.ts +79 -0
- package/dist/core/monitor/observation.js +110 -0
- package/dist/core/monitor/relevance.d.ts +47 -0
- package/dist/core/monitor/relevance.js +100 -0
- package/dist/core/monitor/signals.d.ts +59 -0
- package/dist/core/monitor/signals.js +105 -0
- package/dist/core/operator/local-operator.d.ts +60 -0
- package/dist/core/operator/local-operator.js +82 -0
- package/dist/core/operator/preflight.d.ts +60 -0
- package/dist/core/operator/preflight.js +139 -0
- package/dist/core/operator/proceed.d.ts +98 -0
- package/dist/core/operator/proceed.js +167 -0
- package/dist/core/operator/progress.d.ts +124 -0
- package/dist/core/operator/progress.js +135 -0
- package/dist/core/operator/render.d.ts +34 -0
- package/dist/core/operator/render.js +170 -0
- package/dist/core/operator/runtime-binding.d.ts +61 -0
- package/dist/core/operator/runtime-binding.js +22 -0
- package/dist/core/policy/ownership.d.ts +44 -0
- package/dist/core/policy/ownership.js +46 -0
- package/dist/core/policy/policy.d.ts +99 -0
- package/dist/core/policy/policy.js +147 -0
- package/dist/core/policy/remote-freeze.d.ts +101 -0
- package/dist/core/policy/remote-freeze.js +151 -0
- package/dist/core/policy/scope.d.ts +23 -0
- package/dist/core/policy/scope.js +93 -0
- package/dist/core/presentation/digest.d.ts +98 -0
- package/dist/core/presentation/digest.js +160 -0
- package/dist/core/resolver/load.d.ts +121 -0
- package/dist/core/resolver/load.js +246 -0
- package/dist/core/resolver/render.d.ts +4 -0
- package/dist/core/resolver/render.js +62 -0
- package/dist/core/resolver/resolve.d.ts +42 -0
- package/dist/core/resolver/resolve.js +51 -0
- package/dist/core/resolver/version.d.ts +22 -0
- package/dist/core/resolver/version.js +49 -0
- package/dist/core/runtime/audit.d.ts +374 -0
- package/dist/core/runtime/audit.js +454 -0
- package/dist/core/runtime/claims.d.ts +115 -0
- package/dist/core/runtime/claims.js +153 -0
- package/dist/core/runtime/closure.d.ts +73 -0
- package/dist/core/runtime/closure.js +162 -0
- package/dist/core/runtime/controller.d.ts +40 -0
- package/dist/core/runtime/controller.js +121 -0
- package/dist/core/runtime/escalation.d.ts +188 -0
- package/dist/core/runtime/escalation.js +322 -0
- package/dist/core/runtime/execution-state.d.ts +43 -0
- package/dist/core/runtime/execution-state.js +81 -0
- package/dist/core/runtime/front.d.ts +95 -0
- package/dist/core/runtime/front.js +144 -0
- package/dist/core/runtime/orchestrator.d.ts +54 -0
- package/dist/core/runtime/orchestrator.js +98 -0
- package/dist/core/runtime/query.d.ts +184 -0
- package/dist/core/runtime/query.js +213 -0
- package/dist/core/runtime/report.d.ts +33 -0
- package/dist/core/runtime/report.js +108 -0
- package/dist/core/runtime/session.d.ts +156 -0
- package/dist/core/runtime/session.js +281 -0
- package/dist/core/runtime/store-ops.d.ts +22 -0
- package/dist/core/runtime/store-ops.js +26 -0
- package/dist/core/view/build-view.d.ts +36 -0
- package/dist/core/view/build-view.js +131 -0
- package/dist/core/view/decision-view.d.ts +564 -0
- package/dist/core/view/decision-view.js +103 -0
- package/dist/core/workspace/identity.d.ts +82 -0
- package/dist/core/workspace/identity.js +133 -0
- package/dist/core/workspace/index-store.d.ts +140 -0
- package/dist/core/workspace/index-store.js +125 -0
- package/dist/core/workspace/migrate.d.ts +73 -0
- package/dist/core/workspace/migrate.js +123 -0
- package/dist/core/workspace/resolve.d.ts +34 -0
- package/dist/core/workspace/resolve.js +89 -0
- package/dist/ports/adapter.d.ts +35 -0
- package/dist/ports/adapter.js +12 -0
- package/dist/ports/approval.d.ts +98 -0
- package/dist/ports/approval.js +7 -0
- package/dist/ports/change-context.d.ts +22 -0
- package/dist/ports/change-context.js +8 -0
- package/dist/ports/event-source.d.ts +42 -0
- package/dist/ports/event-source.js +6 -0
- package/dist/ports/inventory.d.ts +53 -0
- package/dist/ports/inventory.js +12 -0
- package/dist/ports/presentation.d.ts +62 -0
- package/dist/ports/presentation.js +13 -0
- package/dist/ports/renderer.d.ts +23 -0
- package/dist/ports/renderer.js +7 -0
- package/dist/ports/resource-context.d.ts +51 -0
- package/dist/ports/resource-context.js +9 -0
- package/dist/ports/scm.d.ts +40 -0
- package/dist/ports/scm.js +6 -0
- package/dist/ports/state-store.d.ts +97 -0
- package/dist/ports/state-store.js +12 -0
- package/dist/presets/balanced.json +8 -0
- package/dist/presets/conservative.json +9 -0
- package/dist/presets/lightweight.json +8 -0
- package/dist/profiles/example-team/profile.json +101 -0
- package/dist/profiles/pilot-local/profile.json +56 -0
- package/dist/schemas/profile.d.ts +631 -0
- package/dist/schemas/profile.js +287 -0
- package/package.json +55 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ScopedStore } from '../../ports/state-store.ts';
|
|
3
|
+
/**
|
|
4
|
+
* principal 신고 수준 (C-10 §3).
|
|
5
|
+
*
|
|
6
|
+
* ASC는 신고를 검증할 수단이 없다. Host attestation이 없는 상태에서 "검증했다"고 쓰는 것이
|
|
7
|
+
* 검증하지 않는 것보다 나쁘므로, 검증 대신 **신고 수준을 기록**한다.
|
|
8
|
+
*/
|
|
9
|
+
export declare const PrincipalSource: z.ZodEnum<["declared", "derived"]>;
|
|
10
|
+
export type PrincipalSource = z.infer<typeof PrincipalSource>;
|
|
11
|
+
export declare const ExecutionStatus: z.ZodEnum<["RUNNING", "RELEASED", "SUPERSEDED"]>;
|
|
12
|
+
export type ExecutionStatus = z.infer<typeof ExecutionStatus>;
|
|
13
|
+
export declare const DelegationRecord: z.ZodObject<{
|
|
14
|
+
delegationId: z.ZodString;
|
|
15
|
+
/** 위임한 세션. 없으면 최상위 발급이다 — 없는 부모를 지어내지 않는다. */
|
|
16
|
+
parentSessionId: z.ZodOptional<z.ZodString>;
|
|
17
|
+
childSessionId: z.ZodString;
|
|
18
|
+
role: z.ZodString;
|
|
19
|
+
goal: z.ZodString;
|
|
20
|
+
/** 세션 계약의 사본이 아니라 발급 시점 요약. 정본은 Session entity다. */
|
|
21
|
+
scope: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
22
|
+
doneCriteria: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
23
|
+
issuedBy: z.ZodString;
|
|
24
|
+
issuedAt: z.ZodString;
|
|
25
|
+
/** 결과를 누구에게 돌려야 하는가. 보통 parentSessionId. */
|
|
26
|
+
expectedReturnTo: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
role: string;
|
|
29
|
+
goal: string;
|
|
30
|
+
doneCriteria: string[];
|
|
31
|
+
issuedBy: string;
|
|
32
|
+
issuedAt: string;
|
|
33
|
+
scope: string[];
|
|
34
|
+
delegationId: string;
|
|
35
|
+
childSessionId: string;
|
|
36
|
+
parentSessionId?: string | undefined;
|
|
37
|
+
expectedReturnTo?: string | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
role: string;
|
|
40
|
+
goal: string;
|
|
41
|
+
issuedBy: string;
|
|
42
|
+
issuedAt: string;
|
|
43
|
+
delegationId: string;
|
|
44
|
+
childSessionId: string;
|
|
45
|
+
doneCriteria?: string[] | undefined;
|
|
46
|
+
scope?: string[] | undefined;
|
|
47
|
+
parentSessionId?: string | undefined;
|
|
48
|
+
expectedReturnTo?: string | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
export type DelegationRecord = z.infer<typeof DelegationRecord>;
|
|
51
|
+
export declare const ExecutionEvidence: z.ZodObject<{
|
|
52
|
+
executionId: z.ZodString;
|
|
53
|
+
logicalSessionId: z.ZodString;
|
|
54
|
+
/** 어느 Host가 관찰했는가. provider 이름이 아니라 adapter id다. */
|
|
55
|
+
hostAdapter: z.ZodString;
|
|
56
|
+
principal: z.ZodString;
|
|
57
|
+
principalSource: z.ZodEnum<["declared", "derived"]>;
|
|
58
|
+
/** Host가 아는 실행 참조(physical session id 등). 같은 사람이 여럿 가질 수 있다. */
|
|
59
|
+
physicalReference: z.ZodString;
|
|
60
|
+
startedAt: z.ZodString;
|
|
61
|
+
finishedAt: z.ZodOptional<z.ZodString>;
|
|
62
|
+
status: z.ZodEnum<["RUNNING", "RELEASED", "SUPERSEDED"]>;
|
|
63
|
+
/** 이 사실이 어디서 왔는가 — 선언인가 관찰인가. */
|
|
64
|
+
evidenceSource: z.ZodString;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
status: "RUNNING" | "RELEASED" | "SUPERSEDED";
|
|
67
|
+
logicalSessionId: string;
|
|
68
|
+
executionId: string;
|
|
69
|
+
hostAdapter: string;
|
|
70
|
+
principal: string;
|
|
71
|
+
principalSource: "declared" | "derived";
|
|
72
|
+
physicalReference: string;
|
|
73
|
+
startedAt: string;
|
|
74
|
+
evidenceSource: string;
|
|
75
|
+
finishedAt?: string | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
status: "RUNNING" | "RELEASED" | "SUPERSEDED";
|
|
78
|
+
logicalSessionId: string;
|
|
79
|
+
executionId: string;
|
|
80
|
+
hostAdapter: string;
|
|
81
|
+
principal: string;
|
|
82
|
+
principalSource: "declared" | "derived";
|
|
83
|
+
physicalReference: string;
|
|
84
|
+
startedAt: string;
|
|
85
|
+
evidenceSource: string;
|
|
86
|
+
finishedAt?: string | undefined;
|
|
87
|
+
}>;
|
|
88
|
+
export type ExecutionEvidence = z.infer<typeof ExecutionEvidence>;
|
|
89
|
+
declare const ExecutionEnd: z.ZodObject<{
|
|
90
|
+
finishedAt: z.ZodString;
|
|
91
|
+
status: z.ZodEnum<["RELEASED", "SUPERSEDED"]>;
|
|
92
|
+
}, "strip", z.ZodTypeAny, {
|
|
93
|
+
status: "RELEASED" | "SUPERSEDED";
|
|
94
|
+
finishedAt: string;
|
|
95
|
+
}, {
|
|
96
|
+
status: "RELEASED" | "SUPERSEDED";
|
|
97
|
+
finishedAt: string;
|
|
98
|
+
}>;
|
|
99
|
+
type ExecutionEnd = z.infer<typeof ExecutionEnd>;
|
|
100
|
+
export declare const ReclaimEvidence: z.ZodObject<{
|
|
101
|
+
sessionId: z.ZodString;
|
|
102
|
+
/** 회수 주체. 모르면 기록하지 않는다 — 익명 회수는 감사 공백이다 (C-10 §2.4 불변식 ⑥). */
|
|
103
|
+
reclaimedBy: z.ZodString;
|
|
104
|
+
reclaimedAt: z.ZodString;
|
|
105
|
+
/** 무엇을 받았는가. Handoff 시각으로 가리킨다 — 본문을 복제하지 않는다. */
|
|
106
|
+
handoffRef: z.ZodOptional<z.ZodString>;
|
|
107
|
+
/** 회수 시점에 살아 있던 실행들. archive 뒤에는 세션에서 복원되지 않는다. */
|
|
108
|
+
executionRefs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
sessionId: string;
|
|
111
|
+
reclaimedBy: string;
|
|
112
|
+
reclaimedAt: string;
|
|
113
|
+
executionRefs: string[];
|
|
114
|
+
handoffRef?: string | undefined;
|
|
115
|
+
}, {
|
|
116
|
+
sessionId: string;
|
|
117
|
+
reclaimedBy: string;
|
|
118
|
+
reclaimedAt: string;
|
|
119
|
+
handoffRef?: string | undefined;
|
|
120
|
+
executionRefs?: string[] | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
export type ReclaimEvidence = z.infer<typeof ReclaimEvidence>;
|
|
123
|
+
/**
|
|
124
|
+
* 독립성 등급 (C-10 §4.2).
|
|
125
|
+
*
|
|
126
|
+
* ASC는 principal 신고를 검증하지 못한다. 그래서 "다르다"고 말할 수 있는 조건을
|
|
127
|
+
* 좁게 잡는다 — 양쪽 모두 선언됐고 실제로 다를 때만 독립이다.
|
|
128
|
+
*/
|
|
129
|
+
export declare const Independence: z.ZodEnum<["INDEPENDENT", "SELF_REPORTED", "UNVERIFIED"]>;
|
|
130
|
+
export type Independence = z.infer<typeof Independence>;
|
|
131
|
+
export declare const ValidationRecord: z.ZodObject<{
|
|
132
|
+
validationId: z.ZodString;
|
|
133
|
+
validatorSessionId: z.ZodString;
|
|
134
|
+
/** 그 검증을 실제로 수행한 실행. 없으면 검증 세션이 있다는 주장뿐이다. */
|
|
135
|
+
validatorExecutionId: z.ZodString;
|
|
136
|
+
principal: z.ZodString;
|
|
137
|
+
principalSource: z.ZodEnum<["declared", "derived"]>;
|
|
138
|
+
targetSessionId: z.ZodString;
|
|
139
|
+
/** 무엇을 보고 판정했는가. Handoff 시각·리비전으로 가리킨다. */
|
|
140
|
+
targetHandoffRef: z.ZodOptional<z.ZodString>;
|
|
141
|
+
targetRevision: z.ZodOptional<z.ZodString>;
|
|
142
|
+
result: z.ZodEnum<["PASS", "FAIL"]>;
|
|
143
|
+
/** 무엇을 봤는가. 결과만 남기면 다음 사람이 다시 볼 수 없다. */
|
|
144
|
+
findings: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
145
|
+
verifiedAt: z.ZodString;
|
|
146
|
+
independence: z.ZodEnum<["INDEPENDENT", "SELF_REPORTED", "UNVERIFIED"]>;
|
|
147
|
+
/** 왜 그 등급인가. 등급만 있으면 뒤집을 근거가 없다. */
|
|
148
|
+
independenceDetail: z.ZodString;
|
|
149
|
+
}, "strip", z.ZodTypeAny, {
|
|
150
|
+
findings: string[];
|
|
151
|
+
result: "PASS" | "FAIL";
|
|
152
|
+
principal: string;
|
|
153
|
+
principalSource: "declared" | "derived";
|
|
154
|
+
validationId: string;
|
|
155
|
+
validatorSessionId: string;
|
|
156
|
+
validatorExecutionId: string;
|
|
157
|
+
targetSessionId: string;
|
|
158
|
+
verifiedAt: string;
|
|
159
|
+
independence: "INDEPENDENT" | "SELF_REPORTED" | "UNVERIFIED";
|
|
160
|
+
independenceDetail: string;
|
|
161
|
+
targetHandoffRef?: string | undefined;
|
|
162
|
+
targetRevision?: string | undefined;
|
|
163
|
+
}, {
|
|
164
|
+
result: "PASS" | "FAIL";
|
|
165
|
+
principal: string;
|
|
166
|
+
principalSource: "declared" | "derived";
|
|
167
|
+
validationId: string;
|
|
168
|
+
validatorSessionId: string;
|
|
169
|
+
validatorExecutionId: string;
|
|
170
|
+
targetSessionId: string;
|
|
171
|
+
verifiedAt: string;
|
|
172
|
+
independence: "INDEPENDENT" | "SELF_REPORTED" | "UNVERIFIED";
|
|
173
|
+
independenceDetail: string;
|
|
174
|
+
findings?: string[] | undefined;
|
|
175
|
+
targetHandoffRef?: string | undefined;
|
|
176
|
+
targetRevision?: string | undefined;
|
|
177
|
+
}>;
|
|
178
|
+
export type ValidationRecord = z.infer<typeof ValidationRecord>;
|
|
179
|
+
/**
|
|
180
|
+
* 승인 없이 내린 결정의 갈래 (C-13 §4.1).
|
|
181
|
+
*
|
|
182
|
+
* 앞 넷은 자율 판단의 자리이고, 뒤 다섯은 escalation predicate와 짝을 이룬다 —
|
|
183
|
+
* 뒤쪽 class로 결정을 내렸는데 상신이 없으면 그 자체가 이상 신호다.
|
|
184
|
+
*/
|
|
185
|
+
export declare const DecisionClass: z.ZodEnum<["implementation_detail", "owned_contract_consumption", "local_test_strategy", "local_refactor", "external_boundary", "shared_contract", "acceptance", "permission", "irreversible"]>;
|
|
186
|
+
export type DecisionClass = z.infer<typeof DecisionClass>;
|
|
187
|
+
/**
|
|
188
|
+
* 승인 없이 갔다는 것이 기록이 없어도 된다는 뜻은 아니다 (C-13 §4).
|
|
189
|
+
*
|
|
190
|
+
* **부여받은 authority 안에서의 자율 판단임을 감사 가능하게** 남긴다. 무엇과 견줬는지
|
|
191
|
+
* (alternatives)가 없으면 비교 없이 고른 것과 구분되지 않는다.
|
|
192
|
+
*/
|
|
193
|
+
export declare const DecisionEvidence: z.ZodObject<{
|
|
194
|
+
decisionId: z.ZodString;
|
|
195
|
+
sessionId: z.ZodString;
|
|
196
|
+
actor: z.ZodString;
|
|
197
|
+
/** 어느 권한 안에서 내렸는가. 비어 있으면 권한을 대지 못한 결정이다. */
|
|
198
|
+
ownership: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
199
|
+
class: z.ZodEnum<["implementation_detail", "owned_contract_consumption", "local_test_strategy", "local_refactor", "external_boundary", "shared_contract", "acceptance", "permission", "irreversible"]>;
|
|
200
|
+
evidenceRefs: z.ZodArray<z.ZodString, "atleastone">;
|
|
201
|
+
selectedOption: z.ZodString;
|
|
202
|
+
alternatives: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
203
|
+
/** 왜 경계가 아니었는가. 이것이 없으면 자율 판단이 아니라 그냥 안 물어본 것이다. */
|
|
204
|
+
whyNoApproval: z.ZodArray<z.ZodString, "atleastone">;
|
|
205
|
+
verification: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
206
|
+
decidedAt: z.ZodString;
|
|
207
|
+
}, "strip", z.ZodTypeAny, {
|
|
208
|
+
evidenceRefs: [string, ...string[]];
|
|
209
|
+
actor: string;
|
|
210
|
+
decidedAt: string;
|
|
211
|
+
sessionId: string;
|
|
212
|
+
verification: string[];
|
|
213
|
+
ownership: string[];
|
|
214
|
+
decisionId: string;
|
|
215
|
+
class: "implementation_detail" | "owned_contract_consumption" | "local_test_strategy" | "local_refactor" | "external_boundary" | "shared_contract" | "acceptance" | "permission" | "irreversible";
|
|
216
|
+
selectedOption: string;
|
|
217
|
+
alternatives: string[];
|
|
218
|
+
whyNoApproval: [string, ...string[]];
|
|
219
|
+
}, {
|
|
220
|
+
evidenceRefs: [string, ...string[]];
|
|
221
|
+
actor: string;
|
|
222
|
+
decidedAt: string;
|
|
223
|
+
sessionId: string;
|
|
224
|
+
decisionId: string;
|
|
225
|
+
class: "implementation_detail" | "owned_contract_consumption" | "local_test_strategy" | "local_refactor" | "external_boundary" | "shared_contract" | "acceptance" | "permission" | "irreversible";
|
|
226
|
+
selectedOption: string;
|
|
227
|
+
whyNoApproval: [string, ...string[]];
|
|
228
|
+
verification?: string[] | undefined;
|
|
229
|
+
ownership?: string[] | undefined;
|
|
230
|
+
alternatives?: string[] | undefined;
|
|
231
|
+
}>;
|
|
232
|
+
export type DecisionEvidence = z.infer<typeof DecisionEvidence>;
|
|
233
|
+
export type DecisionOutcome = {
|
|
234
|
+
ok: true;
|
|
235
|
+
decision: DecisionEvidence;
|
|
236
|
+
};
|
|
237
|
+
export type DelegationOutcome = {
|
|
238
|
+
ok: true;
|
|
239
|
+
record: DelegationRecord;
|
|
240
|
+
} | {
|
|
241
|
+
ok: false;
|
|
242
|
+
reason: 'ALREADY_RECORDED';
|
|
243
|
+
detail: string;
|
|
244
|
+
existing: DelegationRecord;
|
|
245
|
+
};
|
|
246
|
+
export type ExecutionOutcome = {
|
|
247
|
+
ok: true;
|
|
248
|
+
evidence: ExecutionEvidence;
|
|
249
|
+
};
|
|
250
|
+
export type EndOutcome = {
|
|
251
|
+
ok: true;
|
|
252
|
+
evidence: ExecutionEvidence;
|
|
253
|
+
} | {
|
|
254
|
+
ok: false;
|
|
255
|
+
reason: 'NOT_FOUND' | 'ALREADY_ENDED';
|
|
256
|
+
detail: string;
|
|
257
|
+
};
|
|
258
|
+
export type ValidationOutcome = {
|
|
259
|
+
ok: true;
|
|
260
|
+
record: ValidationRecord;
|
|
261
|
+
} | {
|
|
262
|
+
ok: false;
|
|
263
|
+
reason: 'NO_VALIDATOR_EXECUTION';
|
|
264
|
+
detail: string;
|
|
265
|
+
} | {
|
|
266
|
+
ok: false;
|
|
267
|
+
reason: 'ALREADY_RECORDED';
|
|
268
|
+
detail: string;
|
|
269
|
+
};
|
|
270
|
+
export type ReclaimOutcome = {
|
|
271
|
+
ok: true;
|
|
272
|
+
record: ReclaimEvidence;
|
|
273
|
+
} | {
|
|
274
|
+
ok: false;
|
|
275
|
+
reason: 'ALREADY_RECLAIMED';
|
|
276
|
+
detail: string;
|
|
277
|
+
};
|
|
278
|
+
export declare class AuditLedger {
|
|
279
|
+
#private;
|
|
280
|
+
constructor(scope: ScopedStore, now?: () => string);
|
|
281
|
+
/**
|
|
282
|
+
* 위임을 선언으로 기록한다.
|
|
283
|
+
*
|
|
284
|
+
* **상태 전이를 일으키지 않는다** (C-10 §1.2 불변식 ②). 전이는 전이표만 한다.
|
|
285
|
+
* 두 번째 위임 선언은 조용히 덮지 않고 거부한다 — 같은 세션을 두 번 맡겼다면
|
|
286
|
+
* 그건 기록이 아니라 사고이므로 사람이 봐야 한다.
|
|
287
|
+
*/
|
|
288
|
+
delegate(input: Omit<DelegationRecord, 'delegationId' | 'issuedAt'> & {
|
|
289
|
+
issuedAt?: string;
|
|
290
|
+
}): Promise<DelegationOutcome>;
|
|
291
|
+
delegationOf(childSessionId: string): Promise<DelegationRecord | null>;
|
|
292
|
+
/** 이 세션이 위임한 것들. parent 축으로 본다. */
|
|
293
|
+
delegationsFrom(parentSessionId: string): Promise<DelegationRecord[]>;
|
|
294
|
+
/**
|
|
295
|
+
* 실행이 실제로 시작됐다는 사실을 남긴다.
|
|
296
|
+
*
|
|
297
|
+
* 순번은 setIfAbsent가 성공할 때까지 올린다 — 읽고-고쳐-쓰기를 하면 두 실행이 동시에
|
|
298
|
+
* 붙을 때 하나가 조용히 사라진다. 실패는 경쟁이지 오류가 아니므로 다음 번호로 간다.
|
|
299
|
+
*/
|
|
300
|
+
execute(input: Omit<ExecutionEvidence, 'executionId' | 'status' | 'finishedAt' | 'startedAt'> & {
|
|
301
|
+
startedAt?: string;
|
|
302
|
+
}): Promise<ExecutionOutcome>;
|
|
303
|
+
/**
|
|
304
|
+
* 실행이 끝났다. **시작 기록을 고치지 않고 끝 마커를 따로 남긴다** —
|
|
305
|
+
* 현재 소유권(Runtime Binding)은 사라져도 "그때 그 실행이 있었다"는 사실은 남아야 한다
|
|
306
|
+
* (C-10 §1.3 불변식 ④).
|
|
307
|
+
*/
|
|
308
|
+
endExecution(executionId: string, status: ExecutionEnd['status'], at?: string): Promise<EndOutcome>;
|
|
309
|
+
/** 이 세션을 거쳐 간 실행 전부. 순서는 순번 순 — 회수 후에도 남는다. */
|
|
310
|
+
executionsOf(logicalSessionId: string): Promise<ExecutionEvidence[]>;
|
|
311
|
+
/**
|
|
312
|
+
* Controller가 실제로 회수했다는 별도 증거.
|
|
313
|
+
*
|
|
314
|
+
* 회수 시점에 살아 있던 실행을 함께 붙인다 — archive 이후에는 세션에서 그것을
|
|
315
|
+
* 되찾을 수 없기 때문이다 (C-10 §2.4).
|
|
316
|
+
*/
|
|
317
|
+
reclaim(input: Omit<ReclaimEvidence, 'executionRefs'>): Promise<ReclaimOutcome>;
|
|
318
|
+
reclaimOf(sessionId: string): Promise<ReclaimEvidence | null>;
|
|
319
|
+
/**
|
|
320
|
+
* 검증 결과를 기록한다.
|
|
321
|
+
*
|
|
322
|
+
* **검증자의 실행 증거가 없으면 기록하지 않는다** (C-10 §4). 세션 id만 만들어 두고
|
|
323
|
+
* "검증했다"고 적는 것이 정확히 이 계약이 막는 것이다.
|
|
324
|
+
*
|
|
325
|
+
* 독립성은 주장이 아니라 판정이다 — 여기서 계산해 넣고, 호출자가 정하지 못한다.
|
|
326
|
+
*/
|
|
327
|
+
validate(input: {
|
|
328
|
+
validatorSessionId: string;
|
|
329
|
+
targetSessionId: string;
|
|
330
|
+
result: 'PASS' | 'FAIL';
|
|
331
|
+
findings?: readonly string[];
|
|
332
|
+
targetHandoffRef?: string;
|
|
333
|
+
targetRevision?: string;
|
|
334
|
+
verifiedAt?: string;
|
|
335
|
+
}): Promise<ValidationOutcome>;
|
|
336
|
+
/** 이 세션에 대한 검증들. 없으면 빈 배열 — "검증 없음"도 사실이다. */
|
|
337
|
+
validationsOf(targetSessionId: string): Promise<ValidationRecord[]>;
|
|
338
|
+
/**
|
|
339
|
+
* 승인 없이 내린 결정을 남긴다.
|
|
340
|
+
*
|
|
341
|
+
* 순번은 setIfAbsent가 성공할 때까지 올린다 — 같은 세션의 두 결정이 겹쳐도 하나가
|
|
342
|
+
* 조용히 사라지지 않는다 (execute와 같은 형태).
|
|
343
|
+
*/
|
|
344
|
+
decide(input: Omit<DecisionEvidence, 'decisionId' | 'decidedAt'> & {
|
|
345
|
+
decidedAt?: string;
|
|
346
|
+
}): Promise<DecisionOutcome>;
|
|
347
|
+
/** 이 세션이 스스로 정한 것들. 승인 기록과 나란히 놓고 보는 것이 목적이다. */
|
|
348
|
+
decisionsOf(sessionId: string): Promise<DecisionEvidence[]>;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* 사람이 읽는 줄. **없는 단계를 비워 두지 않고 없다고 적는다** (C-10 §5 불변식 ⑩).
|
|
352
|
+
* "실행 증거 없음"은 감춰야 할 결함이 아니라 정상 출력이다.
|
|
353
|
+
*/
|
|
354
|
+
export declare function executionLines(evidence: readonly ExecutionEvidence[]): string[];
|
|
355
|
+
/**
|
|
356
|
+
* 검증자와 피검증자가 실제로 다른 주체인가 (C-10 §4.2).
|
|
357
|
+
*
|
|
358
|
+
* 대상 쪽 실행이 하나도 없으면 비교할 상대가 없다 — 그것도 UNVERIFIED다.
|
|
359
|
+
* "다른 실행이 없으니 독립이다"는 가장 위험한 오판이다.
|
|
360
|
+
*/
|
|
361
|
+
export declare function judgeIndependence(validator: ExecutionEvidence, targetRuns: readonly ExecutionEvidence[]): {
|
|
362
|
+
independence: Independence;
|
|
363
|
+
detail: string;
|
|
364
|
+
};
|
|
365
|
+
/** 사람이 읽는 검증 줄. **등급만 적고 이유를 빼지 않는다.** */
|
|
366
|
+
export declare function validationLines(records: readonly ValidationRecord[]): string[];
|
|
367
|
+
/**
|
|
368
|
+
* 사람이 읽는 결정 줄. **왜 승인이 필요 없었는지가 함께 온다** — 그 이유가 빠지면
|
|
369
|
+
* "그냥 안 물어봤다"와 구분되지 않는다.
|
|
370
|
+
*/
|
|
371
|
+
export declare function decisionLines(decisions: readonly DecisionEvidence[]): string[];
|
|
372
|
+
export declare function reclaimLine(record: ReclaimEvidence | null, sessionId: string): string;
|
|
373
|
+
export declare function delegationLine(record: DelegationRecord | null, childSessionId: string): string;
|
|
374
|
+
export {};
|