@dailephd/my-centcom 0.1.0 → 0.3.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 (175) hide show
  1. package/README.md +10 -5
  2. package/apps/daemon/dist/artifacts/returnSnapshots.d.ts +12 -0
  3. package/apps/daemon/dist/artifacts/returnSnapshots.js +41 -0
  4. package/apps/daemon/dist/bootstrap/app.d.ts +21 -0
  5. package/apps/daemon/dist/bootstrap/app.js +27 -0
  6. package/apps/daemon/dist/bootstrap/installLayout.d.ts +81 -0
  7. package/apps/daemon/dist/bootstrap/installLayout.js +164 -0
  8. package/apps/daemon/dist/bootstrap/main.d.ts +14 -0
  9. package/apps/daemon/dist/bootstrap/main.js +141 -0
  10. package/apps/daemon/dist/bootstrap/operatorConsole.d.ts +75 -0
  11. package/apps/daemon/dist/bootstrap/operatorConsole.js +293 -0
  12. package/apps/daemon/dist/bootstrap/privateDataRoot.d.ts +38 -0
  13. package/apps/daemon/dist/bootstrap/privateDataRoot.js +204 -0
  14. package/apps/daemon/dist/bootstrap/secureMain.d.ts +118 -0
  15. package/apps/daemon/dist/bootstrap/secureMain.js +403 -0
  16. package/apps/daemon/dist/bootstrap/setup.d.ts +93 -0
  17. package/apps/daemon/dist/bootstrap/setup.js +738 -0
  18. package/apps/daemon/dist/context/changeProposal.d.ts +97 -0
  19. package/apps/daemon/dist/context/changeProposal.js +259 -0
  20. package/apps/daemon/dist/context/gitEvidence.d.ts +88 -0
  21. package/apps/daemon/dist/context/gitEvidence.js +332 -0
  22. package/apps/daemon/dist/context/gitObservation.d.ts +30 -0
  23. package/apps/daemon/dist/context/gitObservation.js +113 -0
  24. package/apps/daemon/dist/context/projectReadIssuer.d.ts +68 -0
  25. package/apps/daemon/dist/context/projectReadIssuer.js +158 -0
  26. package/apps/daemon/dist/context/projectReadService.d.ts +153 -0
  27. package/apps/daemon/dist/context/projectReadService.js +652 -0
  28. package/apps/daemon/dist/context/projectViewService.d.ts +85 -0
  29. package/apps/daemon/dist/context/projectViewService.js +332 -0
  30. package/apps/daemon/dist/context/proposalRecorder.d.ts +11 -0
  31. package/apps/daemon/dist/context/proposalRecorder.js +19 -0
  32. package/apps/daemon/dist/plugins/drivers/codexMcpConfig.d.ts +40 -0
  33. package/apps/daemon/dist/plugins/drivers/codexMcpConfig.js +73 -0
  34. package/apps/daemon/dist/plugins/drivers/codexModelCompatibility.d.ts +49 -0
  35. package/apps/daemon/dist/plugins/drivers/codexModelCompatibility.js +70 -0
  36. package/apps/daemon/dist/plugins/drivers/fakePluginDriver.d.ts +16 -0
  37. package/apps/daemon/dist/plugins/drivers/fakePluginDriver.js +115 -0
  38. package/apps/daemon/dist/plugins/drivers/finiteCliDriver.d.ts +153 -0
  39. package/apps/daemon/dist/plugins/drivers/finiteCliDriver.js +505 -0
  40. package/apps/daemon/dist/plugins/registry/operationCatalog.d.ts +23 -0
  41. package/apps/daemon/dist/plugins/registry/operationCatalog.js +41 -0
  42. package/apps/daemon/dist/plugins/registry/registryOperationCatalog.d.ts +14 -0
  43. package/apps/daemon/dist/plugins/registry/registryOperationCatalog.js +29 -0
  44. package/apps/daemon/dist/plugins/registry/verifiedCapabilityRegistry.d.ts +151 -0
  45. package/apps/daemon/dist/plugins/registry/verifiedCapabilityRegistry.js +579 -0
  46. package/apps/daemon/dist/projects/codingAuthority.d.ts +102 -0
  47. package/apps/daemon/dist/projects/codingAuthority.js +244 -0
  48. package/apps/daemon/dist/projects/fixtureAuthorization.d.ts +54 -0
  49. package/apps/daemon/dist/projects/fixtureAuthorization.js +172 -0
  50. package/apps/daemon/dist/projects/pairedAuthority.d.ts +158 -0
  51. package/apps/daemon/dist/projects/pairedAuthority.js +273 -0
  52. package/apps/daemon/dist/projects/trustedCliConsent.d.ts +47 -0
  53. package/apps/daemon/dist/projects/trustedCliConsent.js +84 -0
  54. package/apps/daemon/dist/runs/changeApplier.d.ts +59 -0
  55. package/apps/daemon/dist/runs/changeApplier.js +319 -0
  56. package/apps/daemon/dist/runs/codingWorkflowService.d.ts +283 -0
  57. package/apps/daemon/dist/runs/codingWorkflowService.js +785 -0
  58. package/apps/daemon/dist/runs/durableIntentCoordinator.d.ts +72 -0
  59. package/apps/daemon/dist/runs/durableIntentCoordinator.js +160 -0
  60. package/apps/daemon/dist/runs/inMemoryCoordinator.d.ts +55 -0
  61. package/apps/daemon/dist/runs/inMemoryCoordinator.js +375 -0
  62. package/apps/daemon/dist/runs/runExecutor.d.ts +154 -0
  63. package/apps/daemon/dist/runs/runExecutor.js +295 -0
  64. package/apps/daemon/dist/runs/workflowService.d.ts +185 -0
  65. package/apps/daemon/dist/runs/workflowService.js +300 -0
  66. package/apps/daemon/dist/runtime/boundedProcessHost.d.ts +111 -0
  67. package/apps/daemon/dist/runtime/boundedProcessHost.js +752 -0
  68. package/apps/daemon/dist/runtime/evidenceRedaction.d.ts +30 -0
  69. package/apps/daemon/dist/runtime/evidenceRedaction.js +79 -0
  70. package/apps/daemon/dist/runtime/executionDiagnostics.d.ts +134 -0
  71. package/apps/daemon/dist/runtime/executionDiagnostics.js +213 -0
  72. package/apps/daemon/dist/runtime/modelExecutionPolicy.d.ts +22 -0
  73. package/apps/daemon/dist/runtime/modelExecutionPolicy.js +19 -0
  74. package/apps/daemon/dist/runtime/mxcExecution.d.ts +12 -0
  75. package/apps/daemon/dist/runtime/mxcExecution.js +163 -0
  76. package/apps/daemon/dist/runtime/mxcIntegrity.d.ts +24 -0
  77. package/apps/daemon/dist/runtime/mxcIntegrity.js +81 -0
  78. package/apps/daemon/dist/runtime/mxcWorker.d.ts +2 -0
  79. package/apps/daemon/dist/runtime/mxcWorker.js +45 -0
  80. package/apps/daemon/dist/runtime/provisionedExecution.d.ts +150 -0
  81. package/apps/daemon/dist/runtime/provisionedExecution.js +653 -0
  82. package/apps/daemon/dist/runtime/testExecution.d.ts +76 -0
  83. package/apps/daemon/dist/runtime/testExecution.js +106 -0
  84. package/apps/daemon/dist/runtime/testProfiles.d.ts +10 -0
  85. package/apps/daemon/dist/runtime/testProfiles.js +4 -0
  86. package/apps/daemon/dist/runtime/trustedAgentStaging.d.ts +89 -0
  87. package/apps/daemon/dist/runtime/trustedAgentStaging.js +262 -0
  88. package/apps/daemon/dist/runtime/trustedCaBundle.d.ts +77 -0
  89. package/apps/daemon/dist/runtime/trustedCaBundle.js +125 -0
  90. package/apps/daemon/dist/runtime/windows/windowsJobSupervisor.d.ts +166 -0
  91. package/apps/daemon/dist/runtime/windows/windowsJobSupervisor.js +521 -0
  92. package/apps/daemon/dist/storage/diagnosticLog.d.ts +63 -0
  93. package/apps/daemon/dist/storage/diagnosticLog.js +136 -0
  94. package/apps/daemon/dist/storage/executionTelemetry.d.ts +63 -0
  95. package/apps/daemon/dist/storage/executionTelemetry.js +247 -0
  96. package/apps/daemon/dist/storage/protectedSecrets.d.ts +39 -0
  97. package/apps/daemon/dist/storage/protectedSecrets.js +106 -0
  98. package/apps/daemon/dist/storage/sqliteLedger.d.ts +786 -0
  99. package/apps/daemon/dist/storage/sqliteLedger.js +1303 -0
  100. package/apps/daemon/dist/transports/http/dispatch.d.ts +43 -0
  101. package/apps/daemon/dist/transports/http/dispatch.js +405 -0
  102. package/apps/daemon/dist/transports/http/secureRoutes.d.ts +40 -0
  103. package/apps/daemon/dist/transports/http/secureRoutes.js +332 -0
  104. package/apps/daemon/dist/transports/http/workflowRoutes.d.ts +41 -0
  105. package/apps/daemon/dist/transports/http/workflowRoutes.js +473 -0
  106. package/apps/daemon/dist/transports/mcp/localProjectReadServer.d.ts +182 -0
  107. package/apps/daemon/dist/transports/mcp/localProjectReadServer.js +221 -0
  108. package/apps/daemon/dist/transports/native/nativeHost.d.ts +24 -0
  109. package/apps/daemon/dist/transports/native/nativeHost.js +344 -0
  110. package/apps/daemon/package.json +24 -0
  111. package/apps/daemon/src/runtime/benign/referenceEcho.mjs +27 -0
  112. package/apps/daemon/src/runtime/windows/buildSupervisor.mjs +87 -0
  113. package/apps/daemon/src/runtime/windows/supervisorMain.cs +676 -0
  114. package/apps/extension/manifest.secure.json +25 -0
  115. package/apps/extension/scripts/build.mjs +173 -0
  116. package/apps/extension/src/background/secureWorker.ts +1595 -0
  117. package/apps/extension/src/background/serviceWorker.ts +892 -0
  118. package/apps/extension/src/content/captureSelection.ts +64 -0
  119. package/apps/extension/src/content/secureInsert.ts +207 -0
  120. package/apps/extension/src/probe/index.html +41 -0
  121. package/apps/extension/src/probe/main.ts +201 -0
  122. package/apps/extension/src/sidepanel/index.html +203 -0
  123. package/apps/extension/src/sidepanel/main.ts +903 -0
  124. package/package.json +19 -3
  125. package/packages/contracts/dist/artifacts.d.ts +66 -0
  126. package/packages/contracts/dist/artifacts.js +64 -0
  127. package/packages/contracts/dist/automation.d.ts +540 -0
  128. package/packages/contracts/dist/automation.js +191 -0
  129. package/packages/contracts/dist/browser.d.ts +251 -0
  130. package/packages/contracts/dist/browser.js +131 -0
  131. package/packages/contracts/dist/context.d.ts +71 -0
  132. package/packages/contracts/dist/context.js +73 -0
  133. package/packages/contracts/dist/diagnostics.d.ts +99 -0
  134. package/packages/contracts/dist/diagnostics.js +284 -0
  135. package/packages/contracts/dist/effects.d.ts +42 -0
  136. package/packages/contracts/dist/effects.js +42 -0
  137. package/packages/contracts/dist/errors.d.ts +75 -0
  138. package/packages/contracts/dist/errors.js +70 -0
  139. package/packages/contracts/dist/events.d.ts +50 -0
  140. package/packages/contracts/dist/events.js +34 -0
  141. package/packages/contracts/dist/executionDiagnostics.d.ts +212 -0
  142. package/packages/contracts/dist/executionDiagnostics.js +101 -0
  143. package/packages/contracts/dist/identity.d.ts +54 -0
  144. package/packages/contracts/dist/identity.js +40 -0
  145. package/packages/contracts/dist/index.d.ts +20 -0
  146. package/packages/contracts/dist/index.js +20 -0
  147. package/packages/contracts/dist/invocation.d.ts +90 -0
  148. package/packages/contracts/dist/invocation.js +77 -0
  149. package/packages/contracts/dist/lifecycle.d.ts +130 -0
  150. package/packages/contracts/dist/lifecycle.js +135 -0
  151. package/packages/contracts/dist/plugin.d.ts +214 -0
  152. package/packages/contracts/dist/plugin.js +117 -0
  153. package/packages/contracts/dist/projectRead.d.ts +205 -0
  154. package/packages/contracts/dist/projectRead.js +162 -0
  155. package/packages/contracts/dist/secure.d.ts +128 -0
  156. package/packages/contracts/dist/secure.js +99 -0
  157. package/packages/contracts/package.json +32 -0
  158. package/packages/contracts/src/artifacts.ts +83 -0
  159. package/packages/contracts/src/automation.ts +238 -0
  160. package/packages/contracts/src/browser.ts +164 -0
  161. package/packages/contracts/src/context.ts +91 -0
  162. package/packages/contracts/src/diagnostics.ts +318 -0
  163. package/packages/contracts/src/effects.ts +49 -0
  164. package/packages/contracts/src/errors.ts +83 -0
  165. package/packages/contracts/src/events.ts +46 -0
  166. package/packages/contracts/src/executionDiagnostics.ts +116 -0
  167. package/packages/contracts/src/identity.ts +68 -0
  168. package/packages/contracts/src/index.ts +20 -0
  169. package/packages/contracts/src/invocation.ts +96 -0
  170. package/packages/contracts/src/lifecycle.ts +169 -0
  171. package/packages/contracts/src/plugin.ts +174 -0
  172. package/packages/contracts/src/projectRead.ts +179 -0
  173. package/packages/contracts/src/secure.ts +136 -0
  174. package/provenance.json +179 -9
  175. package/source.zip +0 -0
@@ -0,0 +1,332 @@
1
+ import { spawnSync } from 'node:child_process';
2
+ import { createHash } from 'node:crypto';
3
+ import { existsSync, lstatSync, mkdirSync, readdirSync, realpathSync, readFileSync, openSync, closeSync, writeFileSync, renameSync, unlinkSync } from 'node:fs';
4
+ import { dirname, isAbsolute, join } from 'node:path';
5
+ import { PR_LIMITS, readProjectFileWhole, walkProjectPath } from './projectReadService.js';
6
+ /**
7
+ * C07 INDEPENDENT GIT EVIDENCE (SW-080). The trusted stage that establishes, WITHOUT asking the model, what a run actually changed:
8
+ * initial and final HEAD, working-tree status, the exact set of changed paths with the SHA-256 of their bytes, a digest of the tracked diff, and whether all of that equals the
9
+ * approved proposal. It also owns the two Git write operations of the workflow (creating the run workspace and the explicitly authorized commit).
10
+ *
11
+ * The pinned git executable comes only from trusted composition; every call is shell:false, windowsHide, time- and output-bounded, with a fresh environment (no user or global Git
12
+ * configuration, no prompts) and with filters, fsmonitor, hooks and line-ending conversion switched off so that the bytes on disk are the bytes that are compared.
13
+ * Nothing here reads a model's description of a change.
14
+ */
15
+ const WIN = process.platform === 'win32';
16
+ const sha = (b) => createHash('sha256').update(b).digest('hex');
17
+ const CONTROL = /[\u0000-\u001f\u007f-\u009f]/;
18
+ const sameFs = (a, b) => (WIN ? a.toLowerCase() === b.toLowerCase() : a === b);
19
+ export function createGitEvidence(cfg) {
20
+ const git = cfg.gitExecutablePath;
21
+ if (typeof git !== 'string' || !isAbsolute(git) || CONTROL.test(git) || git.split(/[\\/]+/).includes('..'))
22
+ throw new Error('GIT_EVIDENCE_CONFIG_INVALID');
23
+ try {
24
+ const st = lstatSync(git);
25
+ if (!st.isFile() || st.isSymbolicLink())
26
+ throw new Error('alias');
27
+ }
28
+ catch {
29
+ throw new Error('GIT_EVIDENCE_CONFIG_INVALID');
30
+ }
31
+ const timeout = cfg.timeoutMs ?? 30_000;
32
+ const env = { GIT_NO_REPLACE_OBJECTS: '1', GIT_OPTIONAL_LOCKS: '0', GIT_TERMINAL_PROMPT: '0', GIT_CONFIG_NOSYSTEM: '1', GIT_CONFIG_GLOBAL: WIN ? 'NUL' : '/dev/null' };
33
+ if (WIN && typeof process.env.SystemRoot === 'string')
34
+ env.SystemRoot = process.env.SystemRoot;
35
+ const SAFE = ['-c', 'core.fsmonitor=false', '-c', 'core.untrackedCache=false', '-c', 'core.hooksPath=' + (WIN ? 'NUL' : '/dev/null'), '-c', 'core.autocrlf=false', '-c', 'core.safecrlf=false', '-c', 'core.quotepath=false'];
36
+ const rawRun = (cwd, args) => {
37
+ const r = spawnSync(git, [...SAFE, ...args], { cwd, env, shell: false, windowsHide: true, timeout, maxBuffer: 32 * 1024 * 1024, encoding: 'utf8' });
38
+ if (r.error)
39
+ return { code: 'SPAWN', out: '' };
40
+ return { code: r.status ?? -1, out: r.stdout ?? '' };
41
+ };
42
+ const run = (cwd, args) => {
43
+ // Local attributes can select executable clean/smudge/textconv filters even for status/diff.
44
+ // Inspect configuration without includes before any Git inspection; never execute those filters.
45
+ const config = rawRun(cwd, ['config', '--local', '--no-includes', '--list']);
46
+ if (config.code === 0 && config.out.split(/\r?\n/).some(line => /^(filter\.|include\.|includeif\.|diff\..*\.(command|textconv)=|core\.worktree=)/i.test(line)))
47
+ return { code: -1, out: '' };
48
+ if (config.code !== 0 && existsSync(join(cwd, '.git')))
49
+ return { code: -1, out: '' };
50
+ return rawRun(cwd, args);
51
+ };
52
+ const canon = (root) => {
53
+ try {
54
+ if (typeof root !== 'string' || !isAbsolute(root) || CONTROL.test(root))
55
+ return undefined;
56
+ const st = lstatSync(root);
57
+ if (!st.isDirectory() || st.isSymbolicLink())
58
+ return undefined;
59
+ const real = realpathSync.native(root).replace(/[\\/]+$/, '');
60
+ return sameFs(real, root.replace(/[\\/]+$/, '')) ? real : undefined;
61
+ }
62
+ catch {
63
+ return undefined;
64
+ }
65
+ };
66
+ const headOf = (root) => { const r = run(root, ['rev-parse', '--verify', '--quiet', 'HEAD']); return r.code === 0 ? r.out.trim() : undefined; };
67
+ const statusOf = (root) => {
68
+ const c = canon(root);
69
+ if (!c)
70
+ return { ok: false, code: 'ROOT_INVALID' };
71
+ const r = run(c, ['status', '--porcelain=v1', '-z', '--untracked-files=all', '--no-renames', '--ignore-submodules=all']);
72
+ if (r.code === 'SPAWN')
73
+ return { ok: false, code: 'GIT_UNAVAILABLE' };
74
+ if (r.code !== 0)
75
+ return { ok: false, code: 'GIT_FAILED' };
76
+ const entries = [];
77
+ for (const e of r.out.split('\0')) {
78
+ if (e.length === 0)
79
+ continue;
80
+ if (e.length < 4 || e[2] !== ' ' || CONTROL.test(e.slice(3)))
81
+ return { ok: false, code: 'OUTPUT_INVALID' };
82
+ entries.push({ xy: e.slice(0, 2), path: e.slice(3) });
83
+ }
84
+ return { ok: true, entries };
85
+ };
86
+ /** Hash of one changed path's current bytes through the same no-link, no-alias walk the readers use. null = the path does not exist. */
87
+ const shaOf = (root, rel) => {
88
+ const segs = rel.split('/');
89
+ const n = walkProjectPath(root, segs, 'file');
90
+ if (!n.ok)
91
+ return n.code === 'PATH_NOT_FOUND' ? null : 'UNREADABLE';
92
+ const w = readProjectFileWhole(n.value, root, segs, PR_LIMITS.maxFileBytes);
93
+ return w.ok ? sha(w.value.bytes) : 'UNREADABLE';
94
+ };
95
+ function createWorkspace(srcRoot, destRoot) {
96
+ const src = canon(srcRoot);
97
+ if (!src)
98
+ return { ok: false, code: 'ROOT_INVALID' };
99
+ const st = statusOf(src);
100
+ if (!st.ok)
101
+ return st;
102
+ if (st.entries.length > 0)
103
+ return { ok: false, code: 'DIRTY' };
104
+ const head = headOf(src);
105
+ if (!head)
106
+ return { ok: false, code: 'GIT_FAILED' };
107
+ if (!isAbsolute(destRoot) || CONTROL.test(destRoot))
108
+ return { ok: false, code: 'ROOT_INVALID' };
109
+ if (existsSync(destRoot) && readdirSync(destRoot).length > 0)
110
+ return { ok: false, code: 'WORKSPACE_EXISTS' };
111
+ mkdirSync(dirname(destRoot), { recursive: true });
112
+ const c = run(dirname(destRoot), ['clone', '--local', '--no-hardlinks', '-q', '--', src, destRoot]);
113
+ if (c.code !== 0)
114
+ return { ok: false, code: c.code === 'SPAWN' ? 'GIT_UNAVAILABLE' : 'GIT_FAILED' };
115
+ run(destRoot, ['remote', 'remove', 'origin']); // the workspace has no way to reach the source repository again
116
+ const wh = headOf(destRoot);
117
+ return wh === head ? { ok: true, head } : { ok: false, code: 'HEAD_CHANGED' };
118
+ }
119
+ function observe(root, baseHead, proposal) {
120
+ const c = canon(root);
121
+ if (!c)
122
+ return { ok: false, code: 'ROOT_INVALID' };
123
+ const head = headOf(c);
124
+ if (!head)
125
+ return { ok: false, code: 'GIT_FAILED' };
126
+ const st = statusOf(c);
127
+ if (!st.ok)
128
+ return st;
129
+ const unreadable = [];
130
+ const changes = st.entries.map((e) => { const h = shaOf(c, e.path); if (h === 'UNREADABLE') {
131
+ unreadable.push(e.path);
132
+ return { path: e.path, sha256: null, xy: e.xy };
133
+ } return { path: e.path, sha256: h, xy: e.xy }; })
134
+ .sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0));
135
+ const d = run(c, ['diff', '--binary', '--no-color', '--no-ext-diff', '--no-textconv', '--ignore-submodules=all', 'HEAD']);
136
+ const diffSha256 = sha(d.code === 0 ? d.out : 'DIFF_UNAVAILABLE');
137
+ const treeSha256 = sha(baseHead + '\n' + changes.map((x) => `${x.path}\0${x.sha256 ?? 'ABSENT'}`).join('\n'));
138
+ const expectedMap = new Map();
139
+ if (proposal) {
140
+ for (const o of proposal.operations) {
141
+ if (o.op === 'create' || o.op === 'modify')
142
+ expectedMap.set(o.path, o.contentSha256 ?? null);
143
+ else if (o.op === 'delete')
144
+ expectedMap.set(o.path, null);
145
+ else {
146
+ expectedMap.set(o.path, null);
147
+ expectedMap.set(o.to, o.preimageSha256 ?? null);
148
+ }
149
+ }
150
+ }
151
+ const actualMap = new Map(changes.map((x) => [x.path, x.sha256]));
152
+ const unexpected = [...actualMap.keys()].filter((p) => proposal && !expectedMap.has(p));
153
+ const missing = [...expectedMap.keys()].filter((p) => !actualMap.has(p));
154
+ const mismatched = [...expectedMap.keys()].filter((p) => actualMap.has(p) && actualMap.get(p) !== expectedMap.get(p));
155
+ const headUnchanged = head === baseHead;
156
+ const evidence = {
157
+ baseHead, headNow: head, headUnchanged, clean: st.entries.length === 0, changes, diffSha256, treeSha256,
158
+ match: !!proposal && d.code === 0 && headUnchanged && changes.every(c => c.xy === '??' || c.xy[0] === ' ') && unexpected.length === 0 && missing.length === 0 && mismatched.length === 0 && unreadable.length === 0,
159
+ expected: [...expectedMap].map(([path, s]) => ({ path, sha256: s })), unexpected, missing, mismatched, unreadable,
160
+ };
161
+ return { ok: true, evidence };
162
+ }
163
+ function commit(i) {
164
+ const c = canon(i.root);
165
+ if (!c)
166
+ return { ok: false, code: 'ROOT_INVALID' };
167
+ if (headOf(c) !== i.baseHead)
168
+ return { ok: false, code: 'HEAD_CHANGED' };
169
+ if (i.paths.length === 0 || i.paths.some((p) => typeof p !== 'string' || p.length === 0 || p.startsWith('-') || CONTROL.test(p) || p.includes('\\') || p.split('/').includes('..')))
170
+ return { ok: false, code: 'OUTPUT_INVALID' };
171
+ const msg = i.message.replace(/[^\x20-\x7e\n]/g, '?').slice(0, 2000);
172
+ // explicit-path staging only (never -A / .): exactly the approved paths
173
+ const add = run(c, ['add', '-A', '--', ...i.paths]);
174
+ if (add.code !== 0)
175
+ return { ok: false, code: 'GIT_FAILED', detail: 'add' };
176
+ const cm = run(c, ['-c', 'user.name=my-centcom', '-c', 'user.email=my-centcom@localhost.invalid', '-c', 'commit.gpgsign=false', 'commit', '--no-verify', '-q', '-m', msg]);
177
+ if (cm.code !== 0)
178
+ return { ok: false, code: 'GIT_FAILED', detail: 'commit' };
179
+ const newHead = headOf(c);
180
+ const parent = run(c, ['rev-parse', '--verify', '--quiet', 'HEAD^']);
181
+ if (!newHead || parent.code !== 0 || parent.out.trim() !== i.baseHead)
182
+ return { ok: false, code: 'GIT_FAILED', detail: 'parent' };
183
+ const names = run(c, ['diff-tree', '--no-commit-id', '--name-only', '-r', '-z', '--no-renames', 'HEAD']);
184
+ const files = names.out.split('\0').filter((x) => x.length > 0).sort();
185
+ return { ok: true, commit: newHead, parent: parent.out.trim(), files };
186
+ }
187
+ const verifyGitStorage = (root) => {
188
+ const base = join(root, '.git');
189
+ if (!canon(root) || !lstatSync(base).isDirectory() || lstatSync(base).isSymbolicLink())
190
+ throw Error('GIT_STORAGE_UNSAFE');
191
+ const prefix = realpathSync.native(base) + (WIN ? '\\' : '/');
192
+ let count = 0;
193
+ const walk = (dir, depth) => { if (depth > 12)
194
+ throw Error('GIT_STORAGE_LIMIT'); for (const name of readdirSync(dir)) {
195
+ if (++count > 8192)
196
+ throw Error('GIT_STORAGE_LIMIT');
197
+ const file = join(dir, name), st = lstatSync(file), real = realpathSync.native(file);
198
+ if (st.isSymbolicLink() || !(WIN ? real.toLowerCase().startsWith(prefix.toLowerCase()) : real.startsWith(prefix)) || st.isFile() && st.nlink > 1)
199
+ throw Error('GIT_STORAGE_UNSAFE');
200
+ if (st.isDirectory())
201
+ walk(file, depth + 1);
202
+ } };
203
+ walk(base, 0);
204
+ if (existsSync(join(base, 'objects', 'info', 'alternates')) || existsSync(join(base, 'commondir')))
205
+ throw Error('GIT_STORAGE_ALTERNATES');
206
+ };
207
+ const plumbing = (root, args, input, extra = {}) => {
208
+ verifyGitStorage(root);
209
+ const config = rawRun(root, ['config', '--local', '--no-includes', '--list']);
210
+ if (config.code !== 0 || config.out.split(/\r?\n/).some(l => /^(filter\.|include|diff\.|gpg\.|commit\.gpgsign=true|core\.(worktree|sshcommand)=)/i.test(l)))
211
+ throw Error('UNSAFE_GIT_CONFIG');
212
+ const r = spawnSync(git, [...SAFE, '-c', 'commit.gpgsign=false', ...args], { cwd: root, env: { ...env, ...extra }, input, shell: false, windowsHide: true, timeout, maxBuffer: 32 * 1024 * 1024, encoding: 'utf8' });
213
+ if (r.error || r.status !== 0)
214
+ throw Error('GIT_PLUMBING_FAILED');
215
+ return r.stdout;
216
+ };
217
+ const indexHash = (root) => existsSync(join(root, '.git', 'index')) ? sha(readFileSync(join(root, '.git', 'index'))) : sha('NO_INDEX');
218
+ const branchOf = (root) => { const b = plumbing(root, ['symbolic-ref', '--quiet', 'HEAD']).trim(); if (!/^refs\/heads\/[A-Za-z0-9][A-Za-z0-9._/-]*$/.test(b) || b.includes('..'))
219
+ throw Error('BRANCH_INVALID'); return b; };
220
+ function prepareCommit(i) {
221
+ if (!canon(i.root) || !isAbsolute(i.indexFile) || existsSync(i.indexFile) || !i.message.trim() || Buffer.byteLength(i.message) > 2000 || /[\u0000-\u0008\u000b-\u001f\u007f]/.test(i.message))
222
+ throw Error('COMMIT_INPUT_INVALID');
223
+ if (!lstatSync(join(i.root, '.git')).isDirectory() || lstatSync(join(i.root, '.git')).isSymbolicLink())
224
+ throw Error('GIT_DIRECTORY_UNSUPPORTED');
225
+ if (existsSync(join(i.root, '.git', 'index'))) {
226
+ const index = lstatSync(join(i.root, '.git', 'index'));
227
+ if (!index.isFile() || index.isSymbolicLink() || index.nlink > 1)
228
+ throw Error('GIT_INDEX_UNSAFE');
229
+ }
230
+ const observed = observe(i.root, i.baseHead, i.proposal);
231
+ if (!observed.ok || !observed.evidence.match)
232
+ throw Error('COMMIT_WORKTREE_CHANGED');
233
+ const branch = branchOf(i.root), indexSha256 = indexHash(i.root), extra = { GIT_INDEX_FILE: i.indexFile };
234
+ mkdirSync(dirname(i.indexFile), { recursive: true });
235
+ if (plumbing(i.root, ['diff', '--cached', '--name-only', '-z', '--ignore-submodules=none', '--no-ext-diff', '--no-textconv', i.baseHead, '--']).length)
236
+ throw Error('COMMIT_INDEX_CHANGED');
237
+ if (plumbing(i.root, ['status', '--porcelain=v1', '--ignored=matching', '--untracked-files=all']).split(/\r?\n/).some(l => l.startsWith('!!')))
238
+ throw Error('COMMIT_IGNORED_FILES_UNREVIEWED');
239
+ const entries = plumbing(i.root, ['ls-tree', '-r', '-z', i.baseHead]).split('\0').filter(Boolean);
240
+ const modes = new Map();
241
+ for (const e of entries) {
242
+ const m = /^(100644|100755) blob ([a-f0-9]{40,64})\t(.+)$/.exec(e);
243
+ if (!m)
244
+ throw Error('UNSUPPORTED_GIT_MODE');
245
+ modes.set(m[3], m[1]);
246
+ }
247
+ plumbing(i.root, ['read-tree', i.baseHead], undefined, extra);
248
+ for (const o of i.proposal.operations) {
249
+ if (o.op === 'rename' || o.op === 'delete')
250
+ throw Error('COMMIT_OPERATION_UNSUPPORTED');
251
+ const seg = o.path.split('/'), n = walkProjectPath(i.root, seg, 'file');
252
+ if (!n.ok)
253
+ throw Error('COMMIT_PATH_INVALID');
254
+ const w = readProjectFileWhole(n.value, i.root, seg, PR_LIMITS.maxFileBytes);
255
+ if (!w.ok || sha(w.value.bytes) !== o.contentSha256)
256
+ throw Error('COMMIT_BYTES_CHANGED');
257
+ const blob = plumbing(i.root, ['hash-object', '-w', '--stdin', '--no-filters'], w.value.bytes).trim();
258
+ plumbing(i.root, ['update-index', '--add', '--cacheinfo', modes.get(o.path) ?? '100644', blob, o.path], undefined, extra);
259
+ }
260
+ const tree = plumbing(i.root, ['write-tree'], undefined, extra).trim();
261
+ const changes = plumbing(i.root, ['diff-tree', '--no-commit-id', '--name-only', '-r', '-z', i.baseHead, tree]).split('\0').filter(Boolean).sort();
262
+ if (JSON.stringify(changes) !== JSON.stringify(i.proposal.operations.map(o => o.path).sort()))
263
+ throw Error('COMMIT_TREE_CHANGED');
264
+ const identity = { GIT_AUTHOR_NAME: 'my-centcom', GIT_AUTHOR_EMAIL: 'my-centcom@localhost.invalid', GIT_COMMITTER_NAME: 'my-centcom', GIT_COMMITTER_EMAIL: 'my-centcom@localhost.invalid' };
265
+ const candidate = plumbing(i.root, ['commit-tree', tree, '-p', i.baseHead], i.message.trim() + '\n', identity).trim();
266
+ if (indexHash(i.root) !== indexSha256)
267
+ throw Error('INDEX_CHANGED');
268
+ return { branch, candidate, tree, message: i.message.trim() + '\n', parent: i.baseHead, indexSha256 };
269
+ }
270
+ function finishCommit(i, update) {
271
+ if (branchOf(i.root) !== i.branch)
272
+ throw Error('COMMIT_BRANCH_CHANGED');
273
+ const object = plumbing(i.root, ['cat-file', 'commit', i.candidate]);
274
+ const parts = object.split('\n\n'), headers = parts.shift();
275
+ if (!headers.includes('tree ' + i.tree + '\n') || headers.split('\n').filter(l => l.startsWith('parent ')).join() !== 'parent ' + i.parent || !headers.includes('author my-centcom <my-centcom@localhost.invalid>') || parts.join('\n\n') !== i.message)
276
+ throw Error('COMMIT_VERIFY_FAILED');
277
+ for (const o of i.proposal.operations)
278
+ if (sha(plumbing(i.root, ['cat-file', 'blob', i.candidate + ':' + o.path])) !== o.contentSha256)
279
+ throw Error('COMMIT_BLOB_CHANGED');
280
+ if (!headers.includes('committer my-centcom <my-centcom@localhost.invalid>'))
281
+ throw Error('COMMIT_IDENTITY_CHANGED');
282
+ const changed = plumbing(i.root, ['diff-tree', '--no-commit-id', '--name-only', '--no-renames', '-r', '-z', i.parent, i.candidate]).split('\0').filter(Boolean).sort();
283
+ if (JSON.stringify(changed) !== JSON.stringify(i.proposal.operations.map(o => o.path).sort()))
284
+ throw Error('COMMIT_PATHS_CHANGED');
285
+ if (update) {
286
+ const observed = observe(i.root, i.parent, i.proposal);
287
+ if (!observed.ok || !observed.evidence.match || indexHash(i.root) !== i.indexSha256)
288
+ throw Error('COMMIT_CONFLICT');
289
+ plumbing(i.root, ['update-ref', i.branch, i.candidate, i.parent]);
290
+ }
291
+ if (headOf(i.root) !== i.candidate)
292
+ throw Error('COMMIT_CONFLICT');
293
+ // Synchronize only the already-verified normal index to the committed tree, after CAS; never stage unrelated changes.
294
+ const normal = join(i.root, '.git', 'index'), lock = normal + '.lock';
295
+ if (indexHash(i.root) === i.indexSha256) {
296
+ const fd = openSync(lock, 'wx');
297
+ let moved = false;
298
+ try {
299
+ if (indexHash(i.root) !== i.indexSha256)
300
+ throw Error('INDEX_CHANGED');
301
+ const prepared = lock + '.prepared';
302
+ if (existsSync(prepared))
303
+ throw Error('INDEX_RECONCILIATION_UNRESOLVED');
304
+ plumbing(i.root, ['read-tree', i.candidate], undefined, { GIT_INDEX_FILE: prepared });
305
+ if (indexHash(i.root) !== i.indexSha256)
306
+ throw Error('INDEX_CHANGED');
307
+ writeFileSync(fd, readFileSync(prepared));
308
+ closeSync(fd);
309
+ renameSync(lock, normal);
310
+ moved = true;
311
+ unlinkSync(prepared);
312
+ }
313
+ finally {
314
+ if (!moved) {
315
+ try {
316
+ closeSync(fd);
317
+ }
318
+ catch { }
319
+ try {
320
+ unlinkSync(lock);
321
+ }
322
+ catch { }
323
+ }
324
+ }
325
+ }
326
+ const st = statusOf(i.root);
327
+ if (!st.ok || st.entries.length || plumbing(i.root, ['diff', '--cached', '--name-only', '-z', '--ignore-submodules=none', '--no-ext-diff', '--no-textconv', i.candidate, '--']).length)
328
+ throw Error('COMMIT_WORKTREE_NOT_CLEAN');
329
+ }
330
+ return Object.freeze({ headOf, statusOf, createWorkspace, observe, commit, prepareCommit, finishCommit, branchOf });
331
+ }
332
+ //# sourceMappingURL=gitEvidence.js.map
@@ -0,0 +1,30 @@
1
+ import { type GitWorkingTreeStateV1 } from '../../../../packages/contracts/dist/index.js';
2
+ /**
3
+ * C07 minimum Git observation (SW-051): branch, HEAD and dirty/untracked state of one approved worktree at an explicit time.
4
+ *
5
+ * Read-only and bounded: the pinned git executable comes only from trusted composition (never PATH), runs with shell:false,
6
+ * windowsHide, a timeout, an output cap and a brand-new environment (no user or global Git configuration, no terminal prompt,
7
+ * GIT_OPTIONAL_LOCKS=0 so status does not rewrite the index). core.fsmonitor is forced off so a repository-configured monitor
8
+ * program cannot be started by an observation. The observed root must be exactly the worktree top level (a directory nested inside
9
+ * some other repository is refused). An observation is a fact at observedAt; an unchanged HEAD never means "no edits".
10
+ * This module decides nothing about runs, artifacts or validation.
11
+ */
12
+ export type GitObservationCode = 'ROOT_INVALID' | 'GIT_UNAVAILABLE' | 'GIT_FAILED' | 'GIT_NO_COMMITS' | 'SCAN_LIMIT' | 'OUTPUT_INVALID';
13
+ export type GitObservationResult = {
14
+ readonly ok: true;
15
+ readonly state: GitWorkingTreeStateV1;
16
+ } | {
17
+ readonly ok: false;
18
+ readonly code: GitObservationCode;
19
+ };
20
+ export interface GitObserver {
21
+ observe(projectId: string, canonicalRoot: string): Promise<GitObservationResult>;
22
+ }
23
+ export declare function createGitObserver(config: {
24
+ gitExecutablePath: string;
25
+ timeoutMs?: number;
26
+ maxOutputBytes?: number;
27
+ maxFiles?: number;
28
+ now?: () => number;
29
+ }): GitObserver;
30
+ //# sourceMappingURL=gitObservation.d.ts.map
@@ -0,0 +1,113 @@
1
+ import { execFile } from 'node:child_process';
2
+ import { lstatSync, realpathSync } from 'node:fs';
3
+ import { isAbsolute, normalize, sep } from 'node:path';
4
+ import { GitWorkingTreeStateV1Schema } from '../../../../packages/contracts/dist/index.js';
5
+ const WIN = process.platform === 'win32';
6
+ const sameFs = (a, b) => (WIN ? a.toLowerCase() === b.toLowerCase() : a === b);
7
+ const trimSep = (p) => (p.length > 3 ? p.replace(/[\\/]+$/, '') : p);
8
+ const unify = (p) => trimSep(normalize(p.replace(/\//g, sep)));
9
+ const CONTROL = /[\u0000-\u001f\u007f-\u009f]/;
10
+ export function createGitObserver(config) {
11
+ if (config === null || typeof config !== 'object')
12
+ throw new Error('GIT_OBSERVER_CONFIG_INVALID');
13
+ const git = config.gitExecutablePath;
14
+ if (typeof git !== 'string' || !isAbsolute(git) || CONTROL.test(git) || git.split(/[\\/]+/).includes('..'))
15
+ throw new Error('GIT_OBSERVER_CONFIG_INVALID');
16
+ try {
17
+ const st = lstatSync(git);
18
+ if (!st.isFile() || st.isSymbolicLink() || !sameFs(trimSep(realpathSync.native(git)), unify(git)))
19
+ throw new Error('alias');
20
+ }
21
+ catch {
22
+ throw new Error('GIT_OBSERVER_CONFIG_INVALID');
23
+ }
24
+ const timeoutMs = config.timeoutMs ?? 10_000;
25
+ const maxOutputBytes = config.maxOutputBytes ?? 1_048_576;
26
+ const maxFiles = config.maxFiles ?? 5_000;
27
+ const now = config.now ?? Date.now;
28
+ const env = {
29
+ GIT_OPTIONAL_LOCKS: '0',
30
+ GIT_TERMINAL_PROMPT: '0',
31
+ GIT_CONFIG_NOSYSTEM: '1',
32
+ GIT_CONFIG_GLOBAL: WIN ? 'NUL' : '/dev/null',
33
+ };
34
+ if (WIN && typeof process.env.SystemRoot === 'string')
35
+ env.SystemRoot = process.env.SystemRoot;
36
+ const run = (root, args) => new Promise((resolve) => {
37
+ execFile(git, ['-c', 'core.fsmonitor=false', '-c', 'core.untrackedCache=false', '-C', root, ...args], { env, shell: false, windowsHide: true, timeout: timeoutMs, maxBuffer: maxOutputBytes, encoding: 'utf8' }, (err, stdout) => {
38
+ if (!err)
39
+ return resolve({ code: 0, out: stdout });
40
+ const e = err;
41
+ if (e.code === 'ERR_CHILD_PROCESS_STDIO_MAXBUFFER')
42
+ return resolve({ code: 'LIMIT', out: '' });
43
+ if (typeof e.code === 'number')
44
+ return resolve({ code: e.code, out: stdout ?? '' });
45
+ return resolve({ code: 'SPAWN', out: '' });
46
+ });
47
+ });
48
+ async function observe(projectId, canonicalRoot) {
49
+ if (typeof projectId !== 'string' || projectId.length === 0 || typeof canonicalRoot !== 'string' || !isAbsolute(canonicalRoot) || CONTROL.test(canonicalRoot)) {
50
+ return { ok: false, code: 'ROOT_INVALID' };
51
+ }
52
+ let root;
53
+ try {
54
+ const st = lstatSync(canonicalRoot);
55
+ if (!st.isDirectory() || st.isSymbolicLink())
56
+ return { ok: false, code: 'ROOT_INVALID' };
57
+ root = trimSep(realpathSync.native(canonicalRoot));
58
+ if (!sameFs(root, unify(canonicalRoot)))
59
+ return { ok: false, code: 'ROOT_INVALID' }; // alias, junction or short name
60
+ }
61
+ catch {
62
+ return { ok: false, code: 'ROOT_INVALID' };
63
+ }
64
+ const top = await run(root, ['rev-parse', '--show-toplevel']);
65
+ if (top.code === 'SPAWN')
66
+ return { ok: false, code: 'GIT_UNAVAILABLE' };
67
+ if (top.code !== 0)
68
+ return { ok: false, code: 'GIT_FAILED' };
69
+ if (!sameFs(unify(top.out.trim()), root))
70
+ return { ok: false, code: 'ROOT_INVALID' }; // not the worktree top level
71
+ const head = await run(root, ['rev-parse', '--verify', '--quiet', 'HEAD']);
72
+ if (head.code !== 0)
73
+ return { ok: false, code: head.code === 'SPAWN' ? 'GIT_UNAVAILABLE' : 'GIT_NO_COMMITS' };
74
+ const branch = await run(root, ['rev-parse', '--abbrev-ref', 'HEAD']);
75
+ if (branch.code !== 0)
76
+ return { ok: false, code: 'GIT_FAILED' };
77
+ const status = await run(root, ['status', '--porcelain=v1', '-z', '--untracked-files=all', '--no-renames']);
78
+ if (status.code === 'LIMIT')
79
+ return { ok: false, code: 'SCAN_LIMIT' };
80
+ if (status.code !== 0)
81
+ return { ok: false, code: 'GIT_FAILED' };
82
+ const dirtyFiles = [];
83
+ const untrackedFiles = [];
84
+ for (const entry of status.out.split('\0')) {
85
+ if (entry.length === 0)
86
+ continue;
87
+ if (entry.length < 4 || entry[2] !== ' ')
88
+ return { ok: false, code: 'OUTPUT_INVALID' };
89
+ const xy = entry.slice(0, 2);
90
+ const path = entry.slice(3);
91
+ if (path.length === 0 || CONTROL.test(path))
92
+ return { ok: false, code: 'OUTPUT_INVALID' };
93
+ (xy === '??' ? untrackedFiles : dirtyFiles).push(path);
94
+ if (dirtyFiles.length + untrackedFiles.length > maxFiles)
95
+ return { ok: false, code: 'SCAN_LIMIT' };
96
+ }
97
+ const parsed = GitWorkingTreeStateV1Schema.safeParse({
98
+ schemaVersion: 1,
99
+ projectId,
100
+ branch: branch.out.trim(),
101
+ headCommit: head.out.trim(),
102
+ clean: dirtyFiles.length === 0 && untrackedFiles.length === 0,
103
+ dirtyFiles,
104
+ untrackedFiles,
105
+ observedAt: new Date(now()).toISOString(),
106
+ });
107
+ if (!parsed.success)
108
+ return { ok: false, code: 'OUTPUT_INVALID' };
109
+ return { ok: true, state: Object.freeze({ ...parsed.data, dirtyFiles: Object.freeze([...parsed.data.dirtyFiles]), untrackedFiles: Object.freeze([...parsed.data.untrackedFiles]) }) };
110
+ }
111
+ return Object.freeze({ observe });
112
+ }
113
+ //# sourceMappingURL=gitObservation.js.map
@@ -0,0 +1,68 @@
1
+ import type { PairedAuthority } from '../projects/pairedAuthority.js';
2
+ import type { SqliteLedger } from '../storage/sqliteLedger.js';
3
+ import { type ProjectViewResult } from './projectViewService.js';
4
+ /**
5
+ * C07 run-scoped project-read CAPABILITY ISSUER (SW-074, daemon side). The only writer of capability descriptors.
6
+ *
7
+ * A descriptor is issued for ONE run of ONE approved project, and only while C03 still authorizes that run (the same admission rules as launch: enabled principal, verified
8
+ * read operation, unexpired grant, project root still its own canonical path). It is a small file in a daemon-owned directory that the restricted agent identity can read but
9
+ * not write (it lives under the project's .switchyard-data, which that identity cannot modify). The read service re-reads and re-verifies it on every request, so REVOCATION is
10
+ * simply removing it: sweep() does so for expiry, revoked grants, disabled principals, an invalid project root and runs that are no longer active.
11
+ *
12
+ * Limit (reported): the MCP server is a separate Low-integrity process that cannot open the ledger, so revocation reaches it at the next request after the descriptor is removed.
13
+ * sweep() runs on a short timer owned by the composition root; between a ledger revocation and the next sweep the capability remains valid (bounded by sweepIntervalMs).
14
+ */
15
+ export type IssueDenied = 'TOOLS_INVALID' | 'RUN_UNKNOWN' | 'NOT_AUTHORIZED' | 'PROJECT_ROOT_INVALID' | 'WRITE_FAILED' | 'RUN_MISMATCH' | 'VIEW_UNAVAILABLE';
16
+ export type IssueResult = {
17
+ readonly ok: true;
18
+ readonly capabilityId: string;
19
+ readonly descriptorPath: string;
20
+ readonly descriptorSha256: string;
21
+ readonly expiresAt: string;
22
+ readonly canonicalRoot: string;
23
+ readonly view?: Extract<ProjectViewResult, {
24
+ ok: true;
25
+ }>;
26
+ } | {
27
+ readonly ok: false;
28
+ readonly code: IssueDenied;
29
+ };
30
+ export interface ProjectReadIssuer {
31
+ /** `proposeTool` is honoured ONLY from trusted composition after C03 authorized a PROPOSE grant for this run; a request can never set it. */
32
+ issue(inv: {
33
+ runId: string;
34
+ projectId: string;
35
+ pluginId: string;
36
+ operationId: string;
37
+ authorizationGrantId: string;
38
+ }, opts?: {
39
+ lifetimeMs?: number;
40
+ proposeTool?: boolean;
41
+ }): IssueResult;
42
+ revoke(runId: string): boolean;
43
+ /** Re-checks every active capability against C03 and the clock; removes the ones that no longer hold. Returns the revoked capability ids. */
44
+ sweep(): string[];
45
+ activeCount(): number;
46
+ /** Number of descriptors from a previous daemon incarnation removed when this issuer started. */
47
+ readonly orphansPurged: number;
48
+ /** Number of run-scoped project views from a previous daemon incarnation removed when this issuer started (SW-077). */
49
+ readonly viewsPurged: number;
50
+ /** SW-077: re-verifies the run's project view against its manifest (exact file set, every digest). undefined when the run has no view. */
51
+ verifyView(runId: string): {
52
+ ok: boolean;
53
+ problems: readonly string[];
54
+ files: number;
55
+ viewId: string;
56
+ manifestSha256: string;
57
+ } | undefined;
58
+ }
59
+ /** The production sweep period (the composition root's timer uses this constant). Worst-case latency from a ledger revocation to descriptor removal is this period plus one sweep. */
60
+ export declare const PROJECT_READ_SWEEP_INTERVAL_MS = 1000;
61
+ export declare function createProjectReadIssuer(o: {
62
+ ledger: SqliteLedger;
63
+ authority: PairedAuthority;
64
+ grantsDir: string;
65
+ now?: () => number;
66
+ viewsRoot?: string;
67
+ }): ProjectReadIssuer;
68
+ //# sourceMappingURL=projectReadIssuer.d.ts.map