@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.
Files changed (210) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +22 -0
  3. package/dist/adapters/claude-code/binding.d.ts +5 -0
  4. package/dist/adapters/claude-code/binding.js +14 -0
  5. package/dist/adapters/claude-code/guard.d.ts +54 -0
  6. package/dist/adapters/claude-code/guard.js +295 -0
  7. package/dist/adapters/claude-code/install.d.ts +67 -0
  8. package/dist/adapters/claude-code/install.js +231 -0
  9. package/dist/adapters/claude-code/observer.d.ts +38 -0
  10. package/dist/adapters/claude-code/observer.js +77 -0
  11. package/dist/adapters/claude-code/probe.d.ts +53 -0
  12. package/dist/adapters/claude-code/probe.js +129 -0
  13. package/dist/adapters/claude-code/skill.d.ts +8 -0
  14. package/dist/adapters/claude-code/skill.js +267 -0
  15. package/dist/adapters/fixture-work/index.d.ts +34 -0
  16. package/dist/adapters/fixture-work/index.js +78 -0
  17. package/dist/adapters/github/adapter.d.ts +32 -0
  18. package/dist/adapters/github/adapter.js +95 -0
  19. package/dist/adapters/github/client.d.ts +30 -0
  20. package/dist/adapters/github/client.js +90 -0
  21. package/dist/adapters/github/context.d.ts +44 -0
  22. package/dist/adapters/github/context.js +170 -0
  23. package/dist/adapters/github/event-source.d.ts +55 -0
  24. package/dist/adapters/github/event-source.js +183 -0
  25. package/dist/adapters/github/scm.d.ts +50 -0
  26. package/dist/adapters/github/scm.js +104 -0
  27. package/dist/adapters/gitlab/adapter.d.ts +36 -0
  28. package/dist/adapters/gitlab/adapter.js +117 -0
  29. package/dist/adapters/gitlab/client.d.ts +30 -0
  30. package/dist/adapters/gitlab/client.js +47 -0
  31. package/dist/adapters/gitlab/ports.d.ts +40 -0
  32. package/dist/adapters/gitlab/ports.js +186 -0
  33. package/dist/adapters/jam/adapter.d.ts +53 -0
  34. package/dist/adapters/jam/adapter.js +144 -0
  35. package/dist/adapters/jam/event-source.d.ts +28 -0
  36. package/dist/adapters/jam/event-source.js +65 -0
  37. package/dist/adapters/jam/mcp-client.d.ts +50 -0
  38. package/dist/adapters/jam/mcp-client.js +218 -0
  39. package/dist/adapters/jam/ports.d.ts +51 -0
  40. package/dist/adapters/jam/ports.js +167 -0
  41. package/dist/adapters/local/identity.d.ts +27 -0
  42. package/dist/adapters/local/identity.js +40 -0
  43. package/dist/adapters/local/presentation.d.ts +14 -0
  44. package/dist/adapters/local/presentation.js +42 -0
  45. package/dist/adapters/markdown/layout.d.ts +15 -0
  46. package/dist/adapters/markdown/layout.js +49 -0
  47. package/dist/adapters/markdown/serialize.d.ts +9 -0
  48. package/dist/adapters/markdown/serialize.js +120 -0
  49. package/dist/adapters/markdown/state-store.d.ts +23 -0
  50. package/dist/adapters/markdown/state-store.js +316 -0
  51. package/dist/adapters/mattermost/client.d.ts +23 -0
  52. package/dist/adapters/mattermost/client.js +54 -0
  53. package/dist/adapters/mattermost/presentation.d.ts +43 -0
  54. package/dist/adapters/mattermost/presentation.js +88 -0
  55. package/dist/adapters/memory/mocks.d.ts +87 -0
  56. package/dist/adapters/memory/mocks.js +163 -0
  57. package/dist/adapters/memory/runtime-binding.d.ts +23 -0
  58. package/dist/adapters/memory/runtime-binding.js +118 -0
  59. package/dist/adapters/memory/state-store.d.ts +17 -0
  60. package/dist/adapters/memory/state-store.js +125 -0
  61. package/dist/adapters/text/renderer.d.ts +7 -0
  62. package/dist/adapters/text/renderer.js +81 -0
  63. package/dist/adapters/webhook/ingress.d.ts +103 -0
  64. package/dist/adapters/webhook/ingress.js +150 -0
  65. package/dist/cli/asc.d.ts +16 -0
  66. package/dist/cli/asc.js +2914 -0
  67. package/dist/cli/identity-config.d.ts +7 -0
  68. package/dist/cli/identity-config.js +31 -0
  69. package/dist/composition/observe.d.ts +21 -0
  70. package/dist/composition/observe.js +72 -0
  71. package/dist/composition/registry.d.ts +33 -0
  72. package/dist/composition/registry.js +62 -0
  73. package/dist/composition/runtime.d.ts +63 -0
  74. package/dist/composition/runtime.js +155 -0
  75. package/dist/core/approval/service.d.ts +17 -0
  76. package/dist/core/approval/service.js +129 -0
  77. package/dist/core/attach/bootstrap.d.ts +102 -0
  78. package/dist/core/attach/bootstrap.js +178 -0
  79. package/dist/core/attach/init.d.ts +29 -0
  80. package/dist/core/attach/init.js +100 -0
  81. package/dist/core/attach/setup-plan.d.ts +125 -0
  82. package/dist/core/attach/setup-plan.js +177 -0
  83. package/dist/core/attach/setup.d.ts +40 -0
  84. package/dist/core/attach/setup.js +140 -0
  85. package/dist/core/binding/types.d.ts +93 -0
  86. package/dist/core/binding/types.js +74 -0
  87. package/dist/core/distribution/release.d.ts +15 -0
  88. package/dist/core/distribution/release.js +27 -0
  89. package/dist/core/distribution/runtime-install.d.ts +50 -0
  90. package/dist/core/distribution/runtime-install.js +90 -0
  91. package/dist/core/distribution/runtime-select.d.ts +74 -0
  92. package/dist/core/distribution/runtime-select.js +149 -0
  93. package/dist/core/execution/executor.d.ts +51 -0
  94. package/dist/core/execution/executor.js +106 -0
  95. package/dist/core/execution/grant.d.ts +42 -0
  96. package/dist/core/execution/grant.js +78 -0
  97. package/dist/core/model/entities.d.ts +872 -0
  98. package/dist/core/model/entities.js +285 -0
  99. package/dist/core/model/ids.d.ts +41 -0
  100. package/dist/core/model/ids.js +50 -0
  101. package/dist/core/model/transitions.d.ts +26 -0
  102. package/dist/core/model/transitions.js +124 -0
  103. package/dist/core/monitor/coverage.d.ts +111 -0
  104. package/dist/core/monitor/coverage.js +129 -0
  105. package/dist/core/monitor/engine.d.ts +134 -0
  106. package/dist/core/monitor/engine.js +574 -0
  107. package/dist/core/monitor/health-alerts.d.ts +35 -0
  108. package/dist/core/monitor/health-alerts.js +88 -0
  109. package/dist/core/monitor/investigation.d.ts +82 -0
  110. package/dist/core/monitor/investigation.js +232 -0
  111. package/dist/core/monitor/observation.d.ts +79 -0
  112. package/dist/core/monitor/observation.js +110 -0
  113. package/dist/core/monitor/relevance.d.ts +47 -0
  114. package/dist/core/monitor/relevance.js +100 -0
  115. package/dist/core/monitor/signals.d.ts +59 -0
  116. package/dist/core/monitor/signals.js +105 -0
  117. package/dist/core/operator/local-operator.d.ts +60 -0
  118. package/dist/core/operator/local-operator.js +82 -0
  119. package/dist/core/operator/preflight.d.ts +60 -0
  120. package/dist/core/operator/preflight.js +139 -0
  121. package/dist/core/operator/proceed.d.ts +98 -0
  122. package/dist/core/operator/proceed.js +167 -0
  123. package/dist/core/operator/progress.d.ts +124 -0
  124. package/dist/core/operator/progress.js +135 -0
  125. package/dist/core/operator/render.d.ts +34 -0
  126. package/dist/core/operator/render.js +170 -0
  127. package/dist/core/operator/runtime-binding.d.ts +61 -0
  128. package/dist/core/operator/runtime-binding.js +22 -0
  129. package/dist/core/policy/ownership.d.ts +44 -0
  130. package/dist/core/policy/ownership.js +46 -0
  131. package/dist/core/policy/policy.d.ts +99 -0
  132. package/dist/core/policy/policy.js +147 -0
  133. package/dist/core/policy/remote-freeze.d.ts +101 -0
  134. package/dist/core/policy/remote-freeze.js +151 -0
  135. package/dist/core/policy/scope.d.ts +23 -0
  136. package/dist/core/policy/scope.js +93 -0
  137. package/dist/core/presentation/digest.d.ts +98 -0
  138. package/dist/core/presentation/digest.js +160 -0
  139. package/dist/core/resolver/load.d.ts +121 -0
  140. package/dist/core/resolver/load.js +246 -0
  141. package/dist/core/resolver/render.d.ts +4 -0
  142. package/dist/core/resolver/render.js +62 -0
  143. package/dist/core/resolver/resolve.d.ts +42 -0
  144. package/dist/core/resolver/resolve.js +51 -0
  145. package/dist/core/resolver/version.d.ts +22 -0
  146. package/dist/core/resolver/version.js +49 -0
  147. package/dist/core/runtime/audit.d.ts +374 -0
  148. package/dist/core/runtime/audit.js +454 -0
  149. package/dist/core/runtime/claims.d.ts +115 -0
  150. package/dist/core/runtime/claims.js +153 -0
  151. package/dist/core/runtime/closure.d.ts +73 -0
  152. package/dist/core/runtime/closure.js +162 -0
  153. package/dist/core/runtime/controller.d.ts +40 -0
  154. package/dist/core/runtime/controller.js +121 -0
  155. package/dist/core/runtime/escalation.d.ts +188 -0
  156. package/dist/core/runtime/escalation.js +322 -0
  157. package/dist/core/runtime/execution-state.d.ts +43 -0
  158. package/dist/core/runtime/execution-state.js +81 -0
  159. package/dist/core/runtime/front.d.ts +95 -0
  160. package/dist/core/runtime/front.js +144 -0
  161. package/dist/core/runtime/orchestrator.d.ts +54 -0
  162. package/dist/core/runtime/orchestrator.js +98 -0
  163. package/dist/core/runtime/query.d.ts +184 -0
  164. package/dist/core/runtime/query.js +213 -0
  165. package/dist/core/runtime/report.d.ts +33 -0
  166. package/dist/core/runtime/report.js +108 -0
  167. package/dist/core/runtime/session.d.ts +156 -0
  168. package/dist/core/runtime/session.js +281 -0
  169. package/dist/core/runtime/store-ops.d.ts +22 -0
  170. package/dist/core/runtime/store-ops.js +26 -0
  171. package/dist/core/view/build-view.d.ts +36 -0
  172. package/dist/core/view/build-view.js +131 -0
  173. package/dist/core/view/decision-view.d.ts +564 -0
  174. package/dist/core/view/decision-view.js +103 -0
  175. package/dist/core/workspace/identity.d.ts +82 -0
  176. package/dist/core/workspace/identity.js +133 -0
  177. package/dist/core/workspace/index-store.d.ts +140 -0
  178. package/dist/core/workspace/index-store.js +125 -0
  179. package/dist/core/workspace/migrate.d.ts +73 -0
  180. package/dist/core/workspace/migrate.js +123 -0
  181. package/dist/core/workspace/resolve.d.ts +34 -0
  182. package/dist/core/workspace/resolve.js +89 -0
  183. package/dist/ports/adapter.d.ts +35 -0
  184. package/dist/ports/adapter.js +12 -0
  185. package/dist/ports/approval.d.ts +98 -0
  186. package/dist/ports/approval.js +7 -0
  187. package/dist/ports/change-context.d.ts +22 -0
  188. package/dist/ports/change-context.js +8 -0
  189. package/dist/ports/event-source.d.ts +42 -0
  190. package/dist/ports/event-source.js +6 -0
  191. package/dist/ports/inventory.d.ts +53 -0
  192. package/dist/ports/inventory.js +12 -0
  193. package/dist/ports/presentation.d.ts +62 -0
  194. package/dist/ports/presentation.js +13 -0
  195. package/dist/ports/renderer.d.ts +23 -0
  196. package/dist/ports/renderer.js +7 -0
  197. package/dist/ports/resource-context.d.ts +51 -0
  198. package/dist/ports/resource-context.js +9 -0
  199. package/dist/ports/scm.d.ts +40 -0
  200. package/dist/ports/scm.js +6 -0
  201. package/dist/ports/state-store.d.ts +97 -0
  202. package/dist/ports/state-store.js +12 -0
  203. package/dist/presets/balanced.json +8 -0
  204. package/dist/presets/conservative.json +9 -0
  205. package/dist/presets/lightweight.json +8 -0
  206. package/dist/profiles/example-team/profile.json +101 -0
  207. package/dist/profiles/pilot-local/profile.json +56 -0
  208. package/dist/schemas/profile.d.ts +631 -0
  209. package/dist/schemas/profile.js +287 -0
  210. package/package.json +55 -0
@@ -0,0 +1,631 @@
1
+ import { z } from 'zod';
2
+ /** 정본 한 갈래. 프로젝트는 하나가 아니라 집합을 갖는다 (OM §8). */
3
+ export declare const CanonicalSourceSpec: z.ZodObject<{
4
+ id: z.ZodString;
5
+ provider: z.ZodEnum<["git", "github"]>;
6
+ remote: z.ZodOptional<z.ZodString>;
7
+ ref: z.ZodOptional<z.ZodString>;
8
+ paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
9
+ $comment: z.ZodOptional<z.ZodString>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ id: string;
12
+ paths: string[];
13
+ provider: "git" | "github";
14
+ remote?: string | undefined;
15
+ ref?: string | undefined;
16
+ $comment?: string | undefined;
17
+ }, {
18
+ id: string;
19
+ provider: "git" | "github";
20
+ paths?: string[] | undefined;
21
+ remote?: string | undefined;
22
+ ref?: string | undefined;
23
+ $comment?: string | undefined;
24
+ }>;
25
+ export declare const ProjectProfile: z.ZodPipeline<z.ZodEffects<z.ZodUnknown, unknown, unknown>, z.ZodObject<{
26
+ schemaVersion: z.ZodLiteral<1>;
27
+ $comment: z.ZodOptional<z.ZodString>;
28
+ id: z.ZodString;
29
+ requires: z.ZodDefault<z.ZodObject<{
30
+ asc: z.ZodOptional<z.ZodString>;
31
+ capabilities: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
32
+ }, "strip", z.ZodTypeAny, {
33
+ capabilities: string[];
34
+ asc?: string | undefined;
35
+ }, {
36
+ capabilities?: string[] | undefined;
37
+ asc?: string | undefined;
38
+ }>>;
39
+ optionalCapabilities: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
40
+ project: z.ZodObject<{
41
+ scm: z.ZodString;
42
+ repository: z.ZodString;
43
+ }, "strip", z.ZodTypeAny, {
44
+ scm: string;
45
+ repository: string;
46
+ }, {
47
+ scm: string;
48
+ repository: string;
49
+ }>;
50
+ /**
51
+ * 빈 집합은 "canonical 검증이 성립하지 않는 프로젝트"다 — 세션 발급·시작에서 정본
52
+ * 대조가 통째로 빠진다. fixture·로컬 실험 전용이며, 실 프로젝트는 반드시 선언하라.
53
+ */
54
+ canonical: z.ZodDefault<z.ZodObject<{
55
+ sources: z.ZodDefault<z.ZodArray<z.ZodObject<{
56
+ id: z.ZodString;
57
+ provider: z.ZodEnum<["git", "github"]>;
58
+ remote: z.ZodOptional<z.ZodString>;
59
+ ref: z.ZodOptional<z.ZodString>;
60
+ paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
61
+ $comment: z.ZodOptional<z.ZodString>;
62
+ }, "strip", z.ZodTypeAny, {
63
+ id: string;
64
+ paths: string[];
65
+ provider: "git" | "github";
66
+ remote?: string | undefined;
67
+ ref?: string | undefined;
68
+ $comment?: string | undefined;
69
+ }, {
70
+ id: string;
71
+ provider: "git" | "github";
72
+ paths?: string[] | undefined;
73
+ remote?: string | undefined;
74
+ ref?: string | undefined;
75
+ $comment?: string | undefined;
76
+ }>, "many">>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ sources: {
79
+ id: string;
80
+ paths: string[];
81
+ provider: "git" | "github";
82
+ remote?: string | undefined;
83
+ ref?: string | undefined;
84
+ $comment?: string | undefined;
85
+ }[];
86
+ }, {
87
+ sources?: {
88
+ id: string;
89
+ provider: "git" | "github";
90
+ paths?: string[] | undefined;
91
+ remote?: string | undefined;
92
+ ref?: string | undefined;
93
+ $comment?: string | undefined;
94
+ }[] | undefined;
95
+ }>>;
96
+ monitor: z.ZodDefault<z.ZodObject<{
97
+ /** provider 어휘 → Generic Signal. Adapter가 내놓는 표를 여기서 고른다 (OM §10.6). */
98
+ reasonSignals: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<["assigned_to_me", "mentioned_me", "direct_reply", "review_requested", "my_pr_reviewed", "participated_thread_changed", "active_canonical_changed", "open_change_touches_active_canonical", "priority_labels", "project_specific_signal"]>>>;
99
+ priorityLabels: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<["P0", "P1", "P2"]>>>;
100
+ escalationLabels: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
101
+ signalPriority: z.ZodDefault<z.ZodRecord<z.ZodEnum<["assigned_to_me", "mentioned_me", "direct_reply", "review_requested", "my_pr_reviewed", "participated_thread_changed", "active_canonical_changed", "open_change_touches_active_canonical", "priority_labels", "project_specific_signal"]>, z.ZodEnum<["P0", "P1", "P2"]>>>;
102
+ inboxSignals: z.ZodOptional<z.ZodArray<z.ZodEnum<["assigned_to_me", "mentioned_me", "direct_reply", "review_requested", "my_pr_reviewed", "participated_thread_changed", "active_canonical_changed", "open_change_touches_active_canonical", "priority_labels", "project_specific_signal"]>, "many">>;
103
+ }, "strip", z.ZodTypeAny, {
104
+ reasonSignals: Record<string, "assigned_to_me" | "mentioned_me" | "direct_reply" | "review_requested" | "my_pr_reviewed" | "participated_thread_changed" | "active_canonical_changed" | "open_change_touches_active_canonical" | "priority_labels" | "project_specific_signal">;
105
+ priorityLabels: Record<string, "P0" | "P1" | "P2">;
106
+ escalationLabels: string[];
107
+ signalPriority: Partial<Record<"assigned_to_me" | "mentioned_me" | "direct_reply" | "review_requested" | "my_pr_reviewed" | "participated_thread_changed" | "active_canonical_changed" | "open_change_touches_active_canonical" | "priority_labels" | "project_specific_signal", "P0" | "P1" | "P2">>;
108
+ inboxSignals?: ("assigned_to_me" | "mentioned_me" | "direct_reply" | "review_requested" | "my_pr_reviewed" | "participated_thread_changed" | "active_canonical_changed" | "open_change_touches_active_canonical" | "priority_labels" | "project_specific_signal")[] | undefined;
109
+ }, {
110
+ reasonSignals?: Record<string, "assigned_to_me" | "mentioned_me" | "direct_reply" | "review_requested" | "my_pr_reviewed" | "participated_thread_changed" | "active_canonical_changed" | "open_change_touches_active_canonical" | "priority_labels" | "project_specific_signal"> | undefined;
111
+ priorityLabels?: Record<string, "P0" | "P1" | "P2"> | undefined;
112
+ escalationLabels?: string[] | undefined;
113
+ signalPriority?: Partial<Record<"assigned_to_me" | "mentioned_me" | "direct_reply" | "review_requested" | "my_pr_reviewed" | "participated_thread_changed" | "active_canonical_changed" | "open_change_touches_active_canonical" | "priority_labels" | "project_specific_signal", "P0" | "P1" | "P2">> | undefined;
114
+ inboxSignals?: ("assigned_to_me" | "mentioned_me" | "direct_reply" | "review_requested" | "my_pr_reviewed" | "participated_thread_changed" | "active_canonical_changed" | "open_change_touches_active_canonical" | "priority_labels" | "project_specific_signal")[] | undefined;
115
+ }>>;
116
+ workflow: z.ZodDefault<z.ZodObject<{
117
+ blockSource: z.ZodOptional<z.ZodString>;
118
+ taskSource: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
119
+ $comment: z.ZodOptional<z.ZodString>;
120
+ }, "strip", z.ZodTypeAny, {
121
+ taskSource: string[];
122
+ $comment?: string | undefined;
123
+ blockSource?: string | undefined;
124
+ }, {
125
+ $comment?: string | undefined;
126
+ blockSource?: string | undefined;
127
+ taskSource?: string[] | undefined;
128
+ }>>;
129
+ policy: z.ZodDefault<z.ZodObject<{
130
+ hardDeny: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
131
+ softDeny: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
132
+ allow: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
133
+ roleScopes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
134
+ settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
135
+ lockedSettings: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
136
+ /**
137
+ * 계층마다 합집합으로 쌓이는 이름 목록. 병합은 Core에 이미 있는데 여기 선언이 없어
138
+ * Profile로 채울 길이 없었다. 관례 키 `closureChecklist` — 세션이 끝난 뒤 확인해야 할
139
+ * 프로젝트 마무리 항목 id (B-20).
140
+ *
141
+ * 항목 id 문법을 **여기서** 막는 이유: 잘못된 선언을 회수 시점까지 끌고 가면 세션이
142
+ * 끝나고 나서야 "이 항목은 쓸 수 없다"를 알게 된다. resolve는 선언이 들어오는 입구이고,
143
+ * 여기서 막으면 잘못된 값이 profile.lock에 고정되지도 않는다.
144
+ *
145
+ * default를 주지 않는 이유: 파싱 결과 객체가 바뀌면 profile digest가 달라져
146
+ * 기존 attach가 전부 LOCK_DRIFT로 멈춘다.
147
+ */
148
+ unionLists: z.ZodEffects<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>, Record<string, string[]> | undefined, Record<string, string[]> | undefined>;
149
+ }, "strip", z.ZodTypeAny, {
150
+ hardDeny: string[];
151
+ softDeny: string[];
152
+ allow: string[];
153
+ roleScopes: Record<string, string[]>;
154
+ settings: Record<string, string | number | boolean>;
155
+ lockedSettings: string[];
156
+ unionLists?: Record<string, string[]> | undefined;
157
+ }, {
158
+ hardDeny?: string[] | undefined;
159
+ softDeny?: string[] | undefined;
160
+ allow?: string[] | undefined;
161
+ roleScopes?: Record<string, string[]> | undefined;
162
+ settings?: Record<string, string | number | boolean> | undefined;
163
+ lockedSettings?: string[] | undefined;
164
+ unionLists?: Record<string, string[]> | undefined;
165
+ }>>;
166
+ /**
167
+ * 책임 지도 — 역할 → 쓰기 영역과 결정권 (C-04 §6). 매 세션 사람이 owner·authority를
168
+ * 손으로 적지 않아도 되게 하는 **선언**이며, 이것만으로는 아무것도 막지 않는다.
169
+ *
170
+ * Preset·Override에는 두지 않는다. 책임 지도는 팀의 사실이라 개인 설정이 이것을 바꾸면
171
+ * 사람마다 다른 결정권자를 보게 되고, 그때부터는 누구 말이 맞는지 정할 방법이 없다.
172
+ *
173
+ * default를 주지 않는 이유는 `unionLists`와 같다 — 파싱 결과 객체가 바뀌면 profile
174
+ * digest가 달라져 기존 attach가 전부 LOCK_DRIFT로 멈춘다. Session의 `.default([])`와
175
+ * 성격이 다르다: 저쪽은 이미 저장된 entity를 읽는 문제이고, 이쪽은 설정 identity를
176
+ * 보존하는 문제다.
177
+ */
178
+ ownership: z.ZodEffects<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
179
+ paths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
180
+ authorities: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
181
+ }, "strip", z.ZodTypeAny, {
182
+ paths: string[];
183
+ authorities: string[];
184
+ }, {
185
+ paths?: string[] | undefined;
186
+ authorities?: string[] | undefined;
187
+ }>>>, Record<string, {
188
+ paths: string[];
189
+ authorities: string[];
190
+ }> | undefined, Record<string, {
191
+ paths?: string[] | undefined;
192
+ authorities?: string[] | undefined;
193
+ }> | undefined>;
194
+ /**
195
+ * Resource Binding 역할 배정 (C-09 §3). 프로젝트는 외부 시스템을 하나만 쓰지 않는다 —
196
+ * 코드가 한 곳, 작업 항목이 다른 곳, 전달이 또 다른 곳일 수 있다.
197
+ *
198
+ * **역할은 사람이 정한다.** 어느 binding이 code-primary인지 ASC가 추론하지 않는다.
199
+ * adapter가 발견하는 것은 "여기 붙을 수 있다"까지이고, 그것이 무슨 역할인지는 정책이다.
200
+ *
201
+ * `project.scm`은 하위호환으로 남지만 runtime 조립의 중심이 아니다.
202
+ *
203
+ * ownership과 같은 이유로 default를 주지 않는다 — 파싱 결과가 바뀌면 profile digest가
204
+ * 달라져 기존 attach가 전부 LOCK_DRIFT로 멈춘다 (C-04 §6.3).
205
+ */
206
+ bindings: z.ZodEffects<z.ZodOptional<z.ZodArray<z.ZodObject<{
207
+ /** 'code-primary' | 'work' | 'presentation' … 자유 문자열이다. */
208
+ role: z.ZodString;
209
+ /** adapter id. Core는 이 값으로 분기하지 않는다 — 조립은 Composition의 몫이다. */
210
+ adapter: z.ZodString;
211
+ /** 문법은 adapter 소관. Core는 문자열로만 다룬다. */
212
+ resource: z.ZodString;
213
+ }, "strip", z.ZodTypeAny, {
214
+ role: string;
215
+ resource: string;
216
+ adapter: string;
217
+ }, {
218
+ role: string;
219
+ resource: string;
220
+ adapter: string;
221
+ }>, "many">>, {
222
+ role: string;
223
+ resource: string;
224
+ adapter: string;
225
+ }[] | undefined, {
226
+ role: string;
227
+ resource: string;
228
+ adapter: string;
229
+ }[] | undefined>;
230
+ /** 프로젝트 용어를 Core 개념에 붙인다. 사람이 읽는 문서에만 쓰인다. */
231
+ terminology: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
232
+ }, "strip", z.ZodTypeAny, {
233
+ monitor: {
234
+ reasonSignals: Record<string, "assigned_to_me" | "mentioned_me" | "direct_reply" | "review_requested" | "my_pr_reviewed" | "participated_thread_changed" | "active_canonical_changed" | "open_change_touches_active_canonical" | "priority_labels" | "project_specific_signal">;
235
+ priorityLabels: Record<string, "P0" | "P1" | "P2">;
236
+ escalationLabels: string[];
237
+ signalPriority: Partial<Record<"assigned_to_me" | "mentioned_me" | "direct_reply" | "review_requested" | "my_pr_reviewed" | "participated_thread_changed" | "active_canonical_changed" | "open_change_touches_active_canonical" | "priority_labels" | "project_specific_signal", "P0" | "P1" | "P2">>;
238
+ inboxSignals?: ("assigned_to_me" | "mentioned_me" | "direct_reply" | "review_requested" | "my_pr_reviewed" | "participated_thread_changed" | "active_canonical_changed" | "open_change_touches_active_canonical" | "priority_labels" | "project_specific_signal")[] | undefined;
239
+ };
240
+ id: string;
241
+ requires: {
242
+ capabilities: string[];
243
+ asc?: string | undefined;
244
+ };
245
+ canonical: {
246
+ sources: {
247
+ id: string;
248
+ paths: string[];
249
+ provider: "git" | "github";
250
+ remote?: string | undefined;
251
+ ref?: string | undefined;
252
+ $comment?: string | undefined;
253
+ }[];
254
+ };
255
+ project: {
256
+ scm: string;
257
+ repository: string;
258
+ };
259
+ policy: {
260
+ hardDeny: string[];
261
+ softDeny: string[];
262
+ allow: string[];
263
+ roleScopes: Record<string, string[]>;
264
+ settings: Record<string, string | number | boolean>;
265
+ lockedSettings: string[];
266
+ unionLists?: Record<string, string[]> | undefined;
267
+ };
268
+ schemaVersion: 1;
269
+ optionalCapabilities: string[];
270
+ workflow: {
271
+ taskSource: string[];
272
+ $comment?: string | undefined;
273
+ blockSource?: string | undefined;
274
+ };
275
+ terminology: Record<string, string>;
276
+ ownership?: Record<string, {
277
+ paths: string[];
278
+ authorities: string[];
279
+ }> | undefined;
280
+ bindings?: {
281
+ role: string;
282
+ resource: string;
283
+ adapter: string;
284
+ }[] | undefined;
285
+ $comment?: string | undefined;
286
+ }, {
287
+ id: string;
288
+ project: {
289
+ scm: string;
290
+ repository: string;
291
+ };
292
+ schemaVersion: 1;
293
+ monitor?: {
294
+ reasonSignals?: Record<string, "assigned_to_me" | "mentioned_me" | "direct_reply" | "review_requested" | "my_pr_reviewed" | "participated_thread_changed" | "active_canonical_changed" | "open_change_touches_active_canonical" | "priority_labels" | "project_specific_signal"> | undefined;
295
+ priorityLabels?: Record<string, "P0" | "P1" | "P2"> | undefined;
296
+ escalationLabels?: string[] | undefined;
297
+ signalPriority?: Partial<Record<"assigned_to_me" | "mentioned_me" | "direct_reply" | "review_requested" | "my_pr_reviewed" | "participated_thread_changed" | "active_canonical_changed" | "open_change_touches_active_canonical" | "priority_labels" | "project_specific_signal", "P0" | "P1" | "P2">> | undefined;
298
+ inboxSignals?: ("assigned_to_me" | "mentioned_me" | "direct_reply" | "review_requested" | "my_pr_reviewed" | "participated_thread_changed" | "active_canonical_changed" | "open_change_touches_active_canonical" | "priority_labels" | "project_specific_signal")[] | undefined;
299
+ } | undefined;
300
+ requires?: {
301
+ capabilities?: string[] | undefined;
302
+ asc?: string | undefined;
303
+ } | undefined;
304
+ canonical?: {
305
+ sources?: {
306
+ id: string;
307
+ provider: "git" | "github";
308
+ paths?: string[] | undefined;
309
+ remote?: string | undefined;
310
+ ref?: string | undefined;
311
+ $comment?: string | undefined;
312
+ }[] | undefined;
313
+ } | undefined;
314
+ ownership?: Record<string, {
315
+ paths?: string[] | undefined;
316
+ authorities?: string[] | undefined;
317
+ }> | undefined;
318
+ bindings?: {
319
+ role: string;
320
+ resource: string;
321
+ adapter: string;
322
+ }[] | undefined;
323
+ policy?: {
324
+ hardDeny?: string[] | undefined;
325
+ softDeny?: string[] | undefined;
326
+ allow?: string[] | undefined;
327
+ roleScopes?: Record<string, string[]> | undefined;
328
+ settings?: Record<string, string | number | boolean> | undefined;
329
+ lockedSettings?: string[] | undefined;
330
+ unionLists?: Record<string, string[]> | undefined;
331
+ } | undefined;
332
+ $comment?: string | undefined;
333
+ optionalCapabilities?: string[] | undefined;
334
+ workflow?: {
335
+ $comment?: string | undefined;
336
+ blockSource?: string | undefined;
337
+ taskSource?: string[] | undefined;
338
+ } | undefined;
339
+ terminology?: Record<string, string> | undefined;
340
+ }>>;
341
+ export type ProjectProfile = z.infer<typeof ProjectProfile>;
342
+ /** 운영 성향. HARD DENY는 여기서 풀 수 없다 (OM §4.3). */
343
+ export declare const OperationalPreset: z.ZodPipeline<z.ZodEffects<z.ZodUnknown, unknown, unknown>, z.ZodObject<{
344
+ schemaVersion: z.ZodLiteral<1>;
345
+ id: z.ZodString;
346
+ $comment: z.ZodOptional<z.ZodString>;
347
+ policy: z.ZodDefault<z.ZodObject<{
348
+ hardDeny: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
349
+ softDeny: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
350
+ allow: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
351
+ roleScopes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>>;
352
+ settings: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>>;
353
+ lockedSettings: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
354
+ unionLists: z.ZodOptional<z.ZodEffects<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>, Record<string, string[]> | undefined, Record<string, string[]> | undefined>>;
355
+ }, "strip", z.ZodTypeAny, {
356
+ hardDeny?: string[] | undefined;
357
+ softDeny?: string[] | undefined;
358
+ allow?: string[] | undefined;
359
+ roleScopes?: Record<string, string[]> | undefined;
360
+ settings?: Record<string, string | number | boolean> | undefined;
361
+ lockedSettings?: string[] | undefined;
362
+ unionLists?: Record<string, string[]> | undefined;
363
+ }, {
364
+ hardDeny?: string[] | undefined;
365
+ softDeny?: string[] | undefined;
366
+ allow?: string[] | undefined;
367
+ roleScopes?: Record<string, string[]> | undefined;
368
+ settings?: Record<string, string | number | boolean> | undefined;
369
+ lockedSettings?: string[] | undefined;
370
+ unionLists?: Record<string, string[]> | undefined;
371
+ }>>;
372
+ }, "strip", z.ZodTypeAny, {
373
+ id: string;
374
+ policy: {
375
+ hardDeny?: string[] | undefined;
376
+ softDeny?: string[] | undefined;
377
+ allow?: string[] | undefined;
378
+ roleScopes?: Record<string, string[]> | undefined;
379
+ settings?: Record<string, string | number | boolean> | undefined;
380
+ lockedSettings?: string[] | undefined;
381
+ unionLists?: Record<string, string[]> | undefined;
382
+ };
383
+ schemaVersion: 1;
384
+ $comment?: string | undefined;
385
+ }, {
386
+ id: string;
387
+ schemaVersion: 1;
388
+ policy?: {
389
+ hardDeny?: string[] | undefined;
390
+ softDeny?: string[] | undefined;
391
+ allow?: string[] | undefined;
392
+ roleScopes?: Record<string, string[]> | undefined;
393
+ settings?: Record<string, string | number | boolean> | undefined;
394
+ lockedSettings?: string[] | undefined;
395
+ unionLists?: Record<string, string[]> | undefined;
396
+ } | undefined;
397
+ $comment?: string | undefined;
398
+ }>>;
399
+ export type OperationalPreset = z.infer<typeof OperationalPreset>;
400
+ /**
401
+ * 개인 몫. 같은 Profile을 쓰는 팀원끼리 여기만 달라진다 (OM §4.4).
402
+ * 비밀은 값이 아니라 참조로만 적는다 — `tokenEnv` 는 이름이지 토큰이 아니다.
403
+ */
404
+ export declare const UserOverride: z.ZodPipeline<z.ZodEffects<z.ZodUnknown, unknown, unknown>, z.ZodObject<{
405
+ schemaVersion: z.ZodLiteral<1>;
406
+ $comment: z.ZodOptional<z.ZodString>;
407
+ identity: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
408
+ /** "나"로 인정할 계정들. Monitor의 신호 판정에 쓰인다. */
409
+ monitorIdentities: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
410
+ controller: z.ZodDefault<z.ZodObject<{
411
+ /** 승인 권한자 → `채널:actor` 목록 (OM §11.6). */
412
+ identities: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
413
+ }, "strip", z.ZodTypeAny, {
414
+ identities: Record<string, string[]>;
415
+ }, {
416
+ identities?: Record<string, string[]> | undefined;
417
+ }>>;
418
+ approval: z.ZodDefault<z.ZodObject<{
419
+ preferredChannel: z.ZodOptional<z.ZodString>;
420
+ messenger: z.ZodOptional<z.ZodObject<{
421
+ provider: z.ZodString;
422
+ tokenEnv: z.ZodString;
423
+ }, "strip", z.ZodTypeAny, {
424
+ provider: string;
425
+ tokenEnv: string;
426
+ }, {
427
+ provider: string;
428
+ tokenEnv: string;
429
+ }>>;
430
+ }, "strip", z.ZodTypeAny, {
431
+ preferredChannel?: string | undefined;
432
+ messenger?: {
433
+ provider: string;
434
+ tokenEnv: string;
435
+ } | undefined;
436
+ }, {
437
+ preferredChannel?: string | undefined;
438
+ messenger?: {
439
+ provider: string;
440
+ tokenEnv: string;
441
+ } | undefined;
442
+ }>>;
443
+ monitor: z.ZodDefault<z.ZodObject<{
444
+ realtime: z.ZodOptional<z.ZodBoolean>;
445
+ /**
446
+ * 내가 맡은 ownership 역할들 (C-04 §6의 역할 이름). 관련성 판정에서 "내 영역"의
447
+ * 기준이 된다 — 팀 공통 사실이 아니라 개인 사실이라 Profile이 아니라 여기 산다.
448
+ *
449
+ * `.optional()`인 이유: 기존 override 파일의 parse 결과를 바꾸지 않기 위해서다.
450
+ * 기본값을 주면 없던 키가 생겨 overrideDigest가 흔들리고, 아무것도 고치지
451
+ * 않은 사용자가 LOCK_DRIFT를 본다.
452
+ */
453
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
454
+ }, "strip", z.ZodTypeAny, {
455
+ realtime?: boolean | undefined;
456
+ roles?: string[] | undefined;
457
+ }, {
458
+ realtime?: boolean | undefined;
459
+ roles?: string[] | undefined;
460
+ }>>;
461
+ policy: z.ZodDefault<z.ZodObject<{
462
+ hardDeny: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
463
+ softDeny: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
464
+ allow: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
465
+ roleScopes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>>;
466
+ settings: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>>;
467
+ lockedSettings: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
468
+ unionLists: z.ZodOptional<z.ZodEffects<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>, Record<string, string[]> | undefined, Record<string, string[]> | undefined>>;
469
+ }, "strip", z.ZodTypeAny, {
470
+ hardDeny?: string[] | undefined;
471
+ softDeny?: string[] | undefined;
472
+ allow?: string[] | undefined;
473
+ roleScopes?: Record<string, string[]> | undefined;
474
+ settings?: Record<string, string | number | boolean> | undefined;
475
+ lockedSettings?: string[] | undefined;
476
+ unionLists?: Record<string, string[]> | undefined;
477
+ }, {
478
+ hardDeny?: string[] | undefined;
479
+ softDeny?: string[] | undefined;
480
+ allow?: string[] | undefined;
481
+ roleScopes?: Record<string, string[]> | undefined;
482
+ settings?: Record<string, string | number | boolean> | undefined;
483
+ lockedSettings?: string[] | undefined;
484
+ unionLists?: Record<string, string[]> | undefined;
485
+ }>>;
486
+ }, "strip", z.ZodTypeAny, {
487
+ controller: {
488
+ identities: Record<string, string[]>;
489
+ };
490
+ monitor: {
491
+ realtime?: boolean | undefined;
492
+ roles?: string[] | undefined;
493
+ };
494
+ approval: {
495
+ preferredChannel?: string | undefined;
496
+ messenger?: {
497
+ provider: string;
498
+ tokenEnv: string;
499
+ } | undefined;
500
+ };
501
+ policy: {
502
+ hardDeny?: string[] | undefined;
503
+ softDeny?: string[] | undefined;
504
+ allow?: string[] | undefined;
505
+ roleScopes?: Record<string, string[]> | undefined;
506
+ settings?: Record<string, string | number | boolean> | undefined;
507
+ lockedSettings?: string[] | undefined;
508
+ unionLists?: Record<string, string[]> | undefined;
509
+ };
510
+ schemaVersion: 1;
511
+ identity: Record<string, string>;
512
+ monitorIdentities: string[];
513
+ $comment?: string | undefined;
514
+ }, {
515
+ schemaVersion: 1;
516
+ controller?: {
517
+ identities?: Record<string, string[]> | undefined;
518
+ } | undefined;
519
+ monitor?: {
520
+ realtime?: boolean | undefined;
521
+ roles?: string[] | undefined;
522
+ } | undefined;
523
+ approval?: {
524
+ preferredChannel?: string | undefined;
525
+ messenger?: {
526
+ provider: string;
527
+ tokenEnv: string;
528
+ } | undefined;
529
+ } | undefined;
530
+ policy?: {
531
+ hardDeny?: string[] | undefined;
532
+ softDeny?: string[] | undefined;
533
+ allow?: string[] | undefined;
534
+ roleScopes?: Record<string, string[]> | undefined;
535
+ settings?: Record<string, string | number | boolean> | undefined;
536
+ lockedSettings?: string[] | undefined;
537
+ unionLists?: Record<string, string[]> | undefined;
538
+ } | undefined;
539
+ $comment?: string | undefined;
540
+ identity?: Record<string, string> | undefined;
541
+ monitorIdentities?: string[] | undefined;
542
+ }>>;
543
+ export type UserOverride = z.infer<typeof UserOverride>;
544
+ /** attach 재현성 metadata (OM §4.9). Resolver만 쓴다. */
545
+ export declare const ProfileLock: z.ZodObject<{
546
+ schemaVersion: z.ZodLiteral<1>;
547
+ ascCore: z.ZodObject<{
548
+ version: z.ZodString;
549
+ commit: z.ZodOptional<z.ZodString>;
550
+ }, "strip", z.ZodTypeAny, {
551
+ version: string;
552
+ commit?: string | undefined;
553
+ }, {
554
+ version: string;
555
+ commit?: string | undefined;
556
+ }>;
557
+ profile: z.ZodObject<{
558
+ id: z.ZodString;
559
+ source: z.ZodString;
560
+ digest: z.ZodString;
561
+ }, "strip", z.ZodTypeAny, {
562
+ id: string;
563
+ source: string;
564
+ digest: string;
565
+ }, {
566
+ id: string;
567
+ source: string;
568
+ digest: string;
569
+ }>;
570
+ preset: z.ZodOptional<z.ZodObject<{
571
+ id: z.ZodString;
572
+ source: z.ZodString;
573
+ digest: z.ZodString;
574
+ }, "strip", z.ZodTypeAny, {
575
+ id: string;
576
+ source: string;
577
+ digest: string;
578
+ }, {
579
+ id: string;
580
+ source: string;
581
+ digest: string;
582
+ }>>;
583
+ overrideDigest: z.ZodOptional<z.ZodString>;
584
+ adapters: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
585
+ capabilities: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
586
+ configurationDigest: z.ZodString;
587
+ generatedAt: z.ZodString;
588
+ }, "strip", z.ZodTypeAny, {
589
+ profile: {
590
+ id: string;
591
+ source: string;
592
+ digest: string;
593
+ };
594
+ capabilities: string[];
595
+ schemaVersion: 1;
596
+ ascCore: {
597
+ version: string;
598
+ commit?: string | undefined;
599
+ };
600
+ adapters: Record<string, string>;
601
+ configurationDigest: string;
602
+ generatedAt: string;
603
+ preset?: {
604
+ id: string;
605
+ source: string;
606
+ digest: string;
607
+ } | undefined;
608
+ overrideDigest?: string | undefined;
609
+ }, {
610
+ profile: {
611
+ id: string;
612
+ source: string;
613
+ digest: string;
614
+ };
615
+ schemaVersion: 1;
616
+ ascCore: {
617
+ version: string;
618
+ commit?: string | undefined;
619
+ };
620
+ configurationDigest: string;
621
+ generatedAt: string;
622
+ capabilities?: string[] | undefined;
623
+ preset?: {
624
+ id: string;
625
+ source: string;
626
+ digest: string;
627
+ } | undefined;
628
+ overrideDigest?: string | undefined;
629
+ adapters?: Record<string, string> | undefined;
630
+ }>;
631
+ export type ProfileLock = z.infer<typeof ProfileLock>;