@sayoriqwq/effect-harness 0.0.4 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/README.md +9 -77
  2. package/diagnostics/effect-routes.md +6 -0
  3. package/diagnostics/index.md +10 -0
  4. package/diagnostics/tsgo-routes.md +5 -0
  5. package/dist/src/eslint.d.ts +57 -0
  6. package/dist/src/eslint.js +42 -0
  7. package/dist/src/eslint.js.map +1 -0
  8. package/dist/src/index.d.ts +2 -0
  9. package/dist/src/index.js +3 -0
  10. package/dist/src/index.js.map +1 -0
  11. package/dist/src/prelude.d.ts +6 -0
  12. package/dist/src/prelude.js +161 -0
  13. package/dist/src/prelude.js.map +1 -0
  14. package/package.json +25 -17
  15. package/prelude-assets/effect/managed/docs/diagnostics.md +6 -0
  16. package/prelude-assets/effect/managed/docs/editor-policy.md +5 -0
  17. package/prelude-assets/effect/managed/docs/effect-code.md +5 -0
  18. package/prelude-assets/effect/managed/docs/index.md +14 -0
  19. package/prelude-assets/effect/managed/docs/managed-surfaces.md +5 -0
  20. package/prelude-assets/effect/managed/docs/package-config.md +20 -0
  21. package/prelude-assets/effect/managed/docs/quality-policy.md +5 -0
  22. package/prelude-assets/effect/managed/docs/source-identity.md +5 -0
  23. package/prelude-assets/guidance/eslint.md +15 -0
  24. package/repos/effect.subtree.json +2 -2
  25. package/repos/tsgo.subtree.json +2 -2
  26. package/HARNESS.md +0 -66
  27. package/dist/bin/effect-harness.d.ts +0 -2
  28. package/dist/bin/effect-harness.js +0 -34
  29. package/dist/bin/effect-harness.js.map +0 -1
  30. package/dist/src/cli/Main.d.ts +0 -7
  31. package/dist/src/cli/Main.js +0 -45
  32. package/dist/src/cli/Main.js.map +0 -1
  33. package/dist/src/harness/Errors.d.ts +0 -24
  34. package/dist/src/harness/Errors.js +0 -26
  35. package/dist/src/harness/Errors.js.map +0 -1
  36. package/dist/src/harness/Guardrails.d.ts +0 -7
  37. package/dist/src/harness/Guardrails.js +0 -50
  38. package/dist/src/harness/Guardrails.js.map +0 -1
  39. package/dist/src/harness/Model.d.ts +0 -52
  40. package/dist/src/harness/Model.js +0 -170
  41. package/dist/src/harness/Model.js.map +0 -1
  42. package/dist/src/harness/ModuleSources.d.ts +0 -5
  43. package/dist/src/harness/ModuleSources.js +0 -47
  44. package/dist/src/harness/ModuleSources.js.map +0 -1
  45. package/dist/src/harness/ProviderDiscovery.d.ts +0 -172
  46. package/dist/src/harness/ProviderDiscovery.js +0 -157
  47. package/dist/src/harness/ProviderDiscovery.js.map +0 -1
  48. package/dist/src/harness/SourcePin.d.ts +0 -4
  49. package/dist/src/harness/SourcePin.js +0 -214
  50. package/dist/src/harness/SourcePin.js.map +0 -1
  51. package/dist/src/harness/verify/JsonFields.d.ts +0 -1
  52. package/dist/src/harness/verify/JsonFields.js +0 -4
  53. package/dist/src/harness/verify/JsonFields.js.map +0 -1
  54. package/dist/src/harness/verify/Pipeline.d.ts +0 -7
  55. package/dist/src/harness/verify/Pipeline.js +0 -55
  56. package/dist/src/harness/verify/Pipeline.js.map +0 -1
  57. package/dist/src/harness/verify/ProviderProfile.d.ts +0 -3
  58. package/dist/src/harness/verify/ProviderProfile.js +0 -726
  59. package/dist/src/harness/verify/ProviderProfile.js.map +0 -1
  60. package/dist/src/harness/verify/ProviderRepository.d.ts +0 -4
  61. package/dist/src/harness/verify/ProviderRepository.js +0 -127
  62. package/dist/src/harness/verify/ProviderRepository.js.map +0 -1
  63. package/dist/src/harness/verify/Tsgo.d.ts +0 -3
  64. package/dist/src/harness/verify/Tsgo.js +0 -166
  65. package/dist/src/harness/verify/Tsgo.js.map +0 -1
  66. package/dist/src/harness/verify/TsgoMetadata.d.ts +0 -4
  67. package/dist/src/harness/verify/TsgoMetadata.js +0 -50
  68. package/dist/src/harness/verify/TsgoMetadata.js.map +0 -1
  69. package/dist/src/harness/verify/TsgoPolicy.d.ts +0 -208
  70. package/dist/src/harness/verify/TsgoPolicy.js +0 -143
  71. package/dist/src/harness/verify/TsgoPolicy.js.map +0 -1
  72. package/dist/src/harness/verify/TsgoSuppressions.d.ts +0 -2
  73. package/dist/src/harness/verify/TsgoSuppressions.js +0 -24
  74. package/dist/src/harness/verify/TsgoSuppressions.js.map +0 -1
  75. package/dist/src/harness/verify/VerifyStage.d.ts +0 -62
  76. package/dist/src/harness/verify/VerifyStage.js +0 -85
  77. package/dist/src/harness/verify/VerifyStage.js.map +0 -1
  78. package/dist/src/platform/Json.d.ts +0 -4
  79. package/dist/src/platform/Json.js +0 -16
  80. package/dist/src/platform/Json.js.map +0 -1
  81. package/dist/src/platform/Process.d.ts +0 -6
  82. package/dist/src/platform/Process.js +0 -35
  83. package/dist/src/platform/Process.js.map +0 -1
  84. package/harness/code.md +0 -83
  85. package/harness/diagnostic-layers.md +0 -94
  86. package/harness/effect-routes.md +0 -50
  87. package/harness/feedback-loop.md +0 -156
  88. package/harness/index.md +0 -83
  89. package/harness/offcial-guide.md +0 -50
  90. package/harness/offcial-migrate.md +0 -220
  91. package/harness/source.md +0 -91
  92. package/harness/tsgo-routes.md +0 -58
  93. package/harness/tsgo.md +0 -241
  94. package/provider/docs/diagnostics.md +0 -48
  95. package/provider/docs/discovery.md +0 -104
  96. package/provider/docs/editor-policy.md +0 -55
  97. package/provider/docs/effect-code.md +0 -41
  98. package/provider/docs/index.md +0 -48
  99. package/provider/docs/managed-surfaces.md +0 -51
  100. package/provider/docs/package-config.md +0 -71
  101. package/provider/docs/quality-policy.md +0 -68
  102. package/provider/docs/source-identity.md +0 -48
  103. package/provider/effect-harness.provider.json +0 -1020
  104. package/provider/index.md +0 -189
  105. package/provider/snippets/agents.md +0 -34
@@ -1,214 +0,0 @@
1
- import { Console, Effect, FileSystem } from 'effect';
2
- import { ChildProcessSpawner } from 'effect/unstable/process';
3
- import { readJson } from "../platform/Json.js";
4
- import { commandExitCode, commandLines, commandString } from "../platform/Process.js";
5
- import { HarnessError } from "./Errors.js";
6
- import { decodeManifest, decodePackageJson, decodeProviderPackageBaseline } from "./Model.js";
7
- import { moduleSources } from "./ModuleSources.js";
8
- const providerProfilePath = 'provider/effect-harness.provider.json';
9
- const expectedSourcePins = [
10
- {
11
- name: 'effect',
12
- contractPath: 'repos/effect.subtree.json',
13
- repository: 'https://github.com/Effect-TS/effect-smol',
14
- prefix: 'repos/effect',
15
- anchor: 'repos/effect/LLMS.md',
16
- route: 'harness/effect-routes.md',
17
- updateCommand: 'npx --yes @sayoriqwq/partita pin update --contract repos/effect.subtree.json --name effect --prefix repos/effect --dry-run',
18
- verifyCommand: 'npx --yes @sayoriqwq/partita pin verify --contract repos/effect.subtree.json --name effect --prefix repos/effect',
19
- filesExclude: 'enabled',
20
- },
21
- {
22
- name: 'tsgo',
23
- contractPath: 'repos/tsgo.subtree.json',
24
- repository: 'https://github.com/Effect-TS/tsgo',
25
- prefix: 'repos/tsgo',
26
- anchor: 'repos/tsgo/README.md',
27
- route: 'harness/tsgo-routes.md',
28
- updateCommand: 'npx --yes @sayoriqwq/partita pin update --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo --dry-run',
29
- verifyCommand: 'npx --yes @sayoriqwq/partita pin verify --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo',
30
- filesExclude: 'disabled',
31
- },
32
- ];
33
- function hasVendoredImport(file, text, manifest) {
34
- return moduleSources(file, text).some(({ source }) => source.includes(manifest.local.prefix));
35
- }
36
- function isApplicationSource(file, manifest) {
37
- const sourceRoot = file.startsWith('bin/')
38
- || file.startsWith('src/')
39
- || file.startsWith('tests/');
40
- const sourceExtension = ['.js', '.jsx', '.mjs', '.cjs', '.ts', '.tsx', '.mts', '.cts']
41
- .some(extension => file.endsWith(extension));
42
- return sourceRoot && sourceExtension && !file.startsWith(`${manifest.local.prefix}/`);
43
- }
44
- const hasGitHead = Effect.fnUntraced(function* (root) {
45
- const exitCode = yield* commandExitCode('git', ['rev-parse', '--verify', 'HEAD'], { cwd: root });
46
- return exitCode === ChildProcessSpawner.ExitCode(0);
47
- });
48
- const latestSubtreeSplit = Effect.fnUntraced(function* (root, prefix) {
49
- const output = yield* commandString('git', [
50
- 'log',
51
- '--format=%B%x1e',
52
- `--grep=git-subtree-dir: ${prefix}`,
53
- ], { cwd: root });
54
- for (const entry of output.split('\x1E')) {
55
- if (!entry.includes(`git-subtree-dir: ${prefix}`)) {
56
- continue;
57
- }
58
- const match = entry.match(/git-subtree-split:\s*([0-9a-f]{40})/u);
59
- if (match !== null) {
60
- return match[1];
61
- }
62
- }
63
- return undefined;
64
- });
65
- const trackedFiles = Effect.fnUntraced(function* (root) {
66
- if (!(yield* hasGitHead(root))) {
67
- return [];
68
- }
69
- return yield* commandLines('git', ['ls-files'], { cwd: root });
70
- });
71
- const assertNoVendoredImports = Effect.fnUntraced(function* (errors, root, manifest) {
72
- const fs = yield* FileSystem.FileSystem;
73
- const files = (yield* trackedFiles(root)).filter(file => isApplicationSource(file, manifest));
74
- for (const file of files) {
75
- const filePath = `${root}/${file}`;
76
- if (!(yield* fs.exists(filePath))) {
77
- continue;
78
- }
79
- const text = yield* fs.readFileString(filePath);
80
- if (hasVendoredImport(file, text, manifest)) {
81
- errors.push(`${file} imports from ${manifest.local.prefix}; use package dependencies instead.`);
82
- }
83
- }
84
- });
85
- const verifyPackageBaseline = Effect.fnUntraced(function* (errors, root, packageBaseline) {
86
- const fs = yield* FileSystem.FileSystem;
87
- const packagePath = `${root}/package.json`;
88
- if (!(yield* fs.exists(packagePath))) {
89
- return;
90
- }
91
- const packageJson = yield* readJson(packagePath, decodePackageJson);
92
- const workspacePath = `${root}/pnpm-workspace.yaml`;
93
- const workspaceText = (yield* fs.exists(workspacePath)) ? yield* fs.readFileString(workspacePath) : '';
94
- for (const [name, version] of Object.entries(packageBaseline)) {
95
- const directVersion = packageJson.dependencies?.[name] ?? packageJson.devDependencies?.[name];
96
- if (directVersion !== undefined && directVersion.length > 0 && directVersion !== version && directVersion !== 'catalog:') {
97
- errors.push(`${name} is ${directVersion} in package.json; expected ${version} or catalog:.`);
98
- }
99
- if (workspaceText.includes(`${name}:`) && !workspaceText.includes(`${name}: ${version}`)) {
100
- errors.push(`${name} catalog version does not match provider profile baseline ${version}.`);
101
- }
102
- }
103
- });
104
- const treeEntry = Effect.fnUntraced(function* (root, file) {
105
- if (!(yield* hasGitHead(root))) {
106
- return undefined;
107
- }
108
- return yield* commandString('git', ['ls-tree', 'HEAD', file], { cwd: root });
109
- });
110
- function assertStringValue(errors, actual, expected, source) {
111
- if (actual !== expected) {
112
- errors.push(`${source} is ${actual}; expected ${expected}.`);
113
- }
114
- }
115
- function assertBooleanValue(errors, actual, expected, source) {
116
- if (actual !== expected) {
117
- errors.push(`${source} is ${String(actual)}; expected ${String(expected)}.`);
118
- }
119
- }
120
- function assertGitHubSubtreeContract(errors, manifest, expected) {
121
- assertStringValue(errors, manifest.name, expected.name, `${expected.contractPath}.name`);
122
- assertStringValue(errors, manifest.github.repository, expected.repository, `${expected.contractPath}.github.repository`);
123
- assertStringValue(errors, manifest.github.branch, 'main', `${expected.contractPath}.github.branch`);
124
- assertStringValue(errors, manifest.local.prefix, expected.prefix, `${expected.contractPath}.local.prefix`);
125
- assertStringValue(errors, manifest.mechanism, 'git-subtree', `${expected.contractPath}.mechanism`);
126
- assertStringValue(errors, manifest.anchor.llmDocument, expected.anchor, `${expected.contractPath}.anchor.llmDocument`);
127
- assertStringValue(errors, manifest.agent.route, expected.route, `${expected.contractPath}.agent.route`);
128
- assertStringValue(errors, manifest.commands.update, expected.updateCommand, `${expected.contractPath}.commands.update`);
129
- assertStringValue(errors, manifest.commands.verify, expected.verifyCommand, `${expected.contractPath}.commands.verify`);
130
- assertStringValue(errors, manifest.editorPolicy.autoImportExclude, 'block', `${expected.contractPath}.editorPolicy.autoImportExclude`);
131
- assertStringValue(errors, manifest.editorPolicy.watcherExclude, 'recommended', `${expected.contractPath}.editorPolicy.watcherExclude`);
132
- assertStringValue(errors, manifest.editorPolicy.searchExclude, 'recommended', `${expected.contractPath}.editorPolicy.searchExclude`);
133
- assertStringValue(errors, manifest.editorPolicy.filesExclude, expected.filesExclude, `${expected.contractPath}.editorPolicy.filesExclude`);
134
- assertStringValue(errors, manifest.ownership.mode, 'provider', `${expected.contractPath}.ownership.mode`);
135
- assertBooleanValue(errors, manifest.boundaries.readOnly, true, `${expected.contractPath}.boundaries.readOnly`);
136
- assertBooleanValue(errors, manifest.boundaries.importBlock, true, `${expected.contractPath}.boundaries.importBlock`);
137
- assertStringValue(errors, manifest.subtree.split, manifest.github.ref, `${expected.contractPath}.subtree.split`);
138
- assertStringValue(errors, manifest.subtree.trailer, `git-subtree-split: ${manifest.subtree.split}`, `${expected.contractPath}.subtree.trailer`);
139
- if (!/^[0-9a-f]{40}$/u.test(manifest.subtree.split)) {
140
- errors.push(`${expected.contractPath}.subtree.split must be a 40-character lowercase git commit SHA.`);
141
- }
142
- if (!manifest.github.repository.startsWith('https://github.com/')) {
143
- errors.push(`${expected.contractPath}.github.repository must be a GitHub HTTPS URL.`);
144
- }
145
- }
146
- const verifyOneSourcePin = Effect.fnUntraced(function* (errors, root, expected) {
147
- const fs = yield* FileSystem.FileSystem;
148
- const manifest = yield* readJson(`${root}/${expected.contractPath}`, decodeManifest);
149
- const sourcePath = `${root}/${manifest.local.prefix}`;
150
- assertGitHubSubtreeContract(errors, manifest, expected);
151
- if (!(yield* fs.exists(sourcePath))) {
152
- errors.push(`Missing pinned source directory: ${manifest.local.prefix}`);
153
- }
154
- else {
155
- const sourceStat = yield* fs.stat(sourcePath);
156
- if (sourceStat.type !== 'Directory') {
157
- errors.push(`${manifest.local.prefix} exists but is not a directory.`);
158
- }
159
- }
160
- const entry = yield* treeEntry(root, manifest.local.prefix);
161
- if (entry !== undefined && entry.startsWith('160000 ')) {
162
- errors.push(`${manifest.local.prefix} is a gitlink submodule; expected a git subtree directory.`);
163
- }
164
- else if (entry !== undefined && entry.length > 0 && !entry.startsWith('040000 tree ')) {
165
- errors.push(`${manifest.local.prefix} is not recorded as a Git tree entry.`);
166
- }
167
- else if (entry === undefined || entry.length === 0) {
168
- errors.push(`${manifest.local.prefix} is not recorded in HEAD; source pins must be committed Git tree entries.`);
169
- }
170
- if (!(yield* fs.exists(`${root}/${manifest.anchor.llmDocument}`))) {
171
- errors.push(`Missing source-entry LLM anchor: ${manifest.anchor.llmDocument}`);
172
- }
173
- if (!(yield* fs.exists(`${root}/${manifest.agent.route}`))) {
174
- errors.push(`Missing source-entry agent route: ${manifest.agent.route}`);
175
- }
176
- if (yield* hasGitHead(root)) {
177
- const split = yield* latestSubtreeSplit(root, manifest.local.prefix);
178
- if (split === undefined) {
179
- errors.push(`Missing git subtree split for ${manifest.local.prefix}; contract-only source pins are not accepted.`);
180
- }
181
- else if (split !== manifest.subtree.split) {
182
- errors.push(`Subtree split mismatch for ${manifest.local.prefix}: contract expects ${manifest.subtree.split}, git history has ${split}`);
183
- }
184
- }
185
- else {
186
- errors.push('Missing Git HEAD; source pins must be verified from committed history.');
187
- }
188
- const gitmodules = `${root}/.gitmodules`;
189
- if ((yield* fs.exists(gitmodules)) && (yield* fs.readFileString(gitmodules)).includes(manifest.local.prefix)) {
190
- errors.push(`${manifest.local.prefix} must be a git subtree, not a git submodule.`);
191
- }
192
- yield* assertNoVendoredImports(errors, root, manifest);
193
- });
194
- export const verifySourcePin = Effect.fnUntraced(function* (root) {
195
- const errors = [];
196
- const pins = expectedSourcePins;
197
- for (const expected of pins) {
198
- yield* verifyOneSourcePin(errors, root, expected);
199
- }
200
- const packageBaseline = yield* readJson(`${root}/${providerProfilePath}`, decodeProviderPackageBaseline);
201
- yield* verifyPackageBaseline(errors, root, packageBaseline);
202
- if (errors.length > 0) {
203
- yield* Console.error('Source subtree verification failed:');
204
- for (const error of errors) {
205
- yield* Console.error(`- ${error}`);
206
- }
207
- return yield* new HarnessError({ message: 'Source subtree verification failed.' });
208
- }
209
- for (const expected of pins) {
210
- const manifest = yield* readJson(`${root}/${expected.contractPath}`, decodeManifest);
211
- yield* Console.log(`Source entry verified: ${manifest.local.prefix} @ git-subtree-split ${manifest.subtree.split}`);
212
- }
213
- });
214
- //# sourceMappingURL=SourcePin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SourcePin.js","sourceRoot":"","sources":["../../../src/harness/SourcePin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAA;AAC7F,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAclD,MAAM,mBAAmB,GAAG,uCAAuC,CAAA;AAEnE,MAAM,kBAAkB,GAAqC;IAC3D;QACE,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,2BAA2B;QACzC,UAAU,EAAE,0CAA0C;QACtD,MAAM,EAAE,cAAc;QACtB,MAAM,EAAE,sBAAsB;QAC9B,KAAK,EAAE,0BAA0B;QACjC,aAAa,EAAE,4HAA4H;QAC3I,aAAa,EAAE,kHAAkH;QACjI,YAAY,EAAE,SAAS;KACxB;IACD;QACE,IAAI,EAAE,MAAM;QACZ,YAAY,EAAE,yBAAyB;QACvC,UAAU,EAAE,mCAAmC;QAC/C,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE,sBAAsB;QAC9B,KAAK,EAAE,wBAAwB;QAC/B,aAAa,EAAE,sHAAsH;QACrI,aAAa,EAAE,4GAA4G;QAC3H,YAAY,EAAE,UAAU;KACzB;CACF,CAAA;AAED,SAAS,iBAAiB,CAAC,IAAY,EAAE,IAAY,EAAE,QAA+B;I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,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,QAAQ,CAAC,KAAK,CAAC,MAAM,wBAAwB,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAA;IACrH,CAAC;AACH,CAAC,CAAC,CAAA","sourcesContent":["import type { EffectSubtreeManifest } from './Model.ts'\nimport { Console, Effect, FileSystem } from 'effect'\nimport { ChildProcessSpawner } from 'effect/unstable/process'\nimport { readJson } from '../platform/Json.ts'\nimport { commandExitCode, commandLines, commandString } from '../platform/Process.ts'\nimport { HarnessError } from './Errors.ts'\nimport { decodeManifest, decodePackageJson, decodeProviderPackageBaseline } from './Model.ts'\nimport { moduleSources } from './ModuleSources.ts'\n\ninterface ExpectedSourcePin {\n readonly name: string\n readonly contractPath: string\n readonly repository: string\n readonly prefix: string\n readonly anchor: string\n readonly route: string\n readonly updateCommand: string\n readonly verifyCommand: string\n readonly filesExclude: string\n}\n\nconst providerProfilePath = 'provider/effect-harness.provider.json'\n\nconst expectedSourcePins: ReadonlyArray<ExpectedSourcePin> = [\n {\n name: 'effect',\n contractPath: 'repos/effect.subtree.json',\n repository: 'https://github.com/Effect-TS/effect-smol',\n prefix: 'repos/effect',\n anchor: 'repos/effect/LLMS.md',\n route: 'harness/effect-routes.md',\n updateCommand: 'npx --yes @sayoriqwq/partita pin update --contract repos/effect.subtree.json --name effect --prefix repos/effect --dry-run',\n verifyCommand: 'npx --yes @sayoriqwq/partita pin verify --contract repos/effect.subtree.json --name effect --prefix repos/effect',\n filesExclude: 'enabled',\n },\n {\n name: 'tsgo',\n contractPath: 'repos/tsgo.subtree.json',\n repository: 'https://github.com/Effect-TS/tsgo',\n prefix: 'repos/tsgo',\n anchor: 'repos/tsgo/README.md',\n route: 'harness/tsgo-routes.md',\n updateCommand: 'npx --yes @sayoriqwq/partita pin update --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo --dry-run',\n verifyCommand: 'npx --yes @sayoriqwq/partita pin verify --contract repos/tsgo.subtree.json --name tsgo --prefix repos/tsgo',\n filesExclude: 'disabled',\n },\n]\n\nfunction hasVendoredImport(file: string, text: string, manifest: EffectSubtreeManifest): boolean {\n return moduleSources(file, text).some(({ source }) => source.includes(manifest.local.prefix))\n}\n\nfunction isApplicationSource(file: string, manifest: EffectSubtreeManifest): boolean {\n const sourceRoot = file.startsWith('bin/')\n || file.startsWith('src/')\n || file.startsWith('tests/')\n const sourceExtension = ['.js', '.jsx', '.mjs', '.cjs', '.ts', '.tsx', '.mts', '.cts']\n .some(extension => file.endsWith(extension))\n\n return sourceRoot && sourceExtension && !file.startsWith(`${manifest.local.prefix}/`)\n}\n\nconst hasGitHead = Effect.fnUntraced(function* (root: string) {\n const exitCode = yield* commandExitCode('git', ['rev-parse', '--verify', 'HEAD'], { cwd: root })\n return exitCode === ChildProcessSpawner.ExitCode(0)\n})\n\nconst latestSubtreeSplit = Effect.fnUntraced(function* (root: string, prefix: string) {\n const output = yield* commandString('git', [\n 'log',\n '--format=%B%x1e',\n `--grep=git-subtree-dir: ${prefix}`,\n ], { cwd: root })\n\n for (const entry of output.split('\\x1E')) {\n if (!entry.includes(`git-subtree-dir: ${prefix}`)) {\n continue\n }\n\n const match = entry.match(/git-subtree-split:\\s*([0-9a-f]{40})/u)\n if (match !== null) {\n return match[1]!\n }\n }\n\n return undefined\n})\n\nconst trackedFiles = Effect.fnUntraced(function* (root: string) {\n if (!(yield* hasGitHead(root))) {\n return []\n }\n return yield* commandLines('git', ['ls-files'], { cwd: root })\n})\n\nconst assertNoVendoredImports = Effect.fnUntraced(function* (\n errors: Array<string>,\n root: string,\n manifest: EffectSubtreeManifest,\n) {\n const fs = yield* FileSystem.FileSystem\n const files = (yield* trackedFiles(root)).filter(file => isApplicationSource(file, manifest))\n\n for (const file of files) {\n const filePath = `${root}/${file}`\n if (!(yield* fs.exists(filePath))) {\n continue\n }\n\n const text = yield* fs.readFileString(filePath)\n if (hasVendoredImport(file, text, manifest)) {\n errors.push(`${file} imports from ${manifest.local.prefix}; use package dependencies instead.`)\n }\n }\n})\n\nconst verifyPackageBaseline = Effect.fnUntraced(function* (\n errors: Array<string>,\n root: string,\n packageBaseline: Readonly<Record<string, string>>,\n) {\n const fs = yield* FileSystem.FileSystem\n const packagePath = `${root}/package.json`\n if (!(yield* fs.exists(packagePath))) {\n return\n }\n\n const packageJson = yield* readJson(packagePath, decodePackageJson)\n const workspacePath = `${root}/pnpm-workspace.yaml`\n const workspaceText = (yield* fs.exists(workspacePath)) ? yield* fs.readFileString(workspacePath) : ''\n\n for (const [name, version] of Object.entries(packageBaseline)) {\n const directVersion = packageJson.dependencies?.[name] ?? packageJson.devDependencies?.[name]\n if (directVersion !== undefined && directVersion.length > 0 && directVersion !== version && directVersion !== 'catalog:') {\n errors.push(`${name} is ${directVersion} in package.json; expected ${version} or catalog:.`)\n }\n\n if (workspaceText.includes(`${name}:`) && !workspaceText.includes(`${name}: ${version}`)) {\n errors.push(`${name} catalog version does not match provider profile baseline ${version}.`)\n }\n }\n})\n\nconst treeEntry = Effect.fnUntraced(function* (root: string, file: string) {\n if (!(yield* hasGitHead(root))) {\n return undefined\n }\n return yield* commandString('git', ['ls-tree', 'HEAD', file], { cwd: root })\n})\n\nfunction assertStringValue(errors: Array<string>, actual: string, expected: string, source: string): void {\n if (actual !== expected) {\n errors.push(`${source} is ${actual}; expected ${expected}.`)\n }\n}\n\nfunction assertBooleanValue(errors: Array<string>, actual: boolean, expected: boolean, source: string): void {\n if (actual !== expected) {\n errors.push(`${source} is ${String(actual)}; expected ${String(expected)}.`)\n }\n}\n\nfunction assertGitHubSubtreeContract(\n errors: Array<string>,\n manifest: EffectSubtreeManifest,\n expected: ExpectedSourcePin,\n): void {\n assertStringValue(errors, manifest.name, expected.name, `${expected.contractPath}.name`)\n assertStringValue(errors, manifest.github.repository, expected.repository, `${expected.contractPath}.github.repository`)\n assertStringValue(errors, manifest.github.branch, 'main', `${expected.contractPath}.github.branch`)\n assertStringValue(errors, manifest.local.prefix, expected.prefix, `${expected.contractPath}.local.prefix`)\n assertStringValue(errors, manifest.mechanism, 'git-subtree', `${expected.contractPath}.mechanism`)\n assertStringValue(errors, manifest.anchor.llmDocument, expected.anchor, `${expected.contractPath}.anchor.llmDocument`)\n assertStringValue(errors, manifest.agent.route, expected.route, `${expected.contractPath}.agent.route`)\n assertStringValue(errors, manifest.commands.update, expected.updateCommand, `${expected.contractPath}.commands.update`)\n assertStringValue(errors, manifest.commands.verify, expected.verifyCommand, `${expected.contractPath}.commands.verify`)\n assertStringValue(errors, manifest.editorPolicy.autoImportExclude, 'block', `${expected.contractPath}.editorPolicy.autoImportExclude`)\n assertStringValue(errors, manifest.editorPolicy.watcherExclude, 'recommended', `${expected.contractPath}.editorPolicy.watcherExclude`)\n assertStringValue(errors, manifest.editorPolicy.searchExclude, 'recommended', `${expected.contractPath}.editorPolicy.searchExclude`)\n assertStringValue(errors, manifest.editorPolicy.filesExclude, expected.filesExclude, `${expected.contractPath}.editorPolicy.filesExclude`)\n assertStringValue(errors, manifest.ownership.mode, 'provider', `${expected.contractPath}.ownership.mode`)\n assertBooleanValue(errors, manifest.boundaries.readOnly, true, `${expected.contractPath}.boundaries.readOnly`)\n assertBooleanValue(errors, manifest.boundaries.importBlock, true, `${expected.contractPath}.boundaries.importBlock`)\n assertStringValue(errors, manifest.subtree.split, manifest.github.ref, `${expected.contractPath}.subtree.split`)\n assertStringValue(errors, manifest.subtree.trailer, `git-subtree-split: ${manifest.subtree.split}`, `${expected.contractPath}.subtree.trailer`)\n\n if (!/^[0-9a-f]{40}$/u.test(manifest.subtree.split)) {\n errors.push(`${expected.contractPath}.subtree.split must be a 40-character lowercase git commit SHA.`)\n }\n\n if (!manifest.github.repository.startsWith('https://github.com/')) {\n errors.push(`${expected.contractPath}.github.repository must be a GitHub HTTPS URL.`)\n }\n}\n\nconst verifyOneSourcePin = Effect.fnUntraced(function* (\n errors: Array<string>,\n root: string,\n expected: ExpectedSourcePin,\n) {\n const fs = yield* FileSystem.FileSystem\n const manifest = yield* readJson(`${root}/${expected.contractPath}`, decodeManifest)\n const sourcePath = `${root}/${manifest.local.prefix}`\n assertGitHubSubtreeContract(errors, manifest, expected)\n\n if (!(yield* fs.exists(sourcePath))) {\n errors.push(`Missing pinned source directory: ${manifest.local.prefix}`)\n }\n else {\n const sourceStat = yield* fs.stat(sourcePath)\n if (sourceStat.type !== 'Directory') {\n errors.push(`${manifest.local.prefix} exists but is not a directory.`)\n }\n }\n\n const entry = yield* treeEntry(root, manifest.local.prefix)\n if (entry !== undefined && entry.startsWith('160000 ')) {\n errors.push(`${manifest.local.prefix} is a gitlink submodule; expected a git subtree directory.`)\n }\n else if (entry !== undefined && entry.length > 0 && !entry.startsWith('040000 tree ')) {\n errors.push(`${manifest.local.prefix} is not recorded as a Git tree entry.`)\n }\n else if (entry === undefined || entry.length === 0) {\n errors.push(`${manifest.local.prefix} is not recorded in HEAD; source pins must be committed Git tree entries.`)\n }\n\n if (!(yield* fs.exists(`${root}/${manifest.anchor.llmDocument}`))) {\n errors.push(`Missing source-entry LLM anchor: ${manifest.anchor.llmDocument}`)\n }\n\n if (!(yield* fs.exists(`${root}/${manifest.agent.route}`))) {\n errors.push(`Missing source-entry agent route: ${manifest.agent.route}`)\n }\n\n if (yield* hasGitHead(root)) {\n const split = yield* latestSubtreeSplit(root, manifest.local.prefix)\n if (split === undefined) {\n errors.push(`Missing git subtree split for ${manifest.local.prefix}; contract-only source pins are not accepted.`)\n }\n else if (split !== manifest.subtree.split) {\n errors.push(`Subtree split mismatch for ${manifest.local.prefix}: contract expects ${manifest.subtree.split}, git history has ${split}`)\n }\n }\n else {\n errors.push('Missing Git HEAD; source pins must be verified from committed history.')\n }\n\n const gitmodules = `${root}/.gitmodules`\n if ((yield* fs.exists(gitmodules)) && (yield* fs.readFileString(gitmodules)).includes(manifest.local.prefix)) {\n errors.push(`${manifest.local.prefix} must be a git subtree, not a git submodule.`)\n }\n\n yield* assertNoVendoredImports(errors, root, manifest)\n})\n\nexport const verifySourcePin = Effect.fnUntraced(function* (root: string) {\n const errors: Array<string> = []\n const pins = expectedSourcePins\n\n for (const expected of pins) {\n yield* verifyOneSourcePin(errors, root, expected)\n }\n\n const packageBaseline = yield* readJson(`${root}/${providerProfilePath}`, decodeProviderPackageBaseline)\n yield* verifyPackageBaseline(errors, root, packageBaseline)\n\n if (errors.length > 0) {\n yield* Console.error('Source subtree verification failed:')\n for (const error of errors) {\n yield* Console.error(`- ${error}`)\n }\n return yield* new HarnessError({ message: 'Source subtree verification failed.' })\n }\n\n for (const expected of pins) {\n const manifest = yield* readJson(`${root}/${expected.contractPath}`, decodeManifest)\n yield* Console.log(`Source entry verified: ${manifest.local.prefix} @ git-subtree-split ${manifest.subtree.split}`)\n }\n})\n"]}
@@ -1 +0,0 @@
1
- export declare function isRecord(value: unknown): value is Record<string, unknown>;
@@ -1,4 +0,0 @@
1
- export function isRecord(value) {
2
- return typeof value === 'object' && value !== null && !Array.isArray(value);
3
- }
4
- //# sourceMappingURL=JsonFields.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"JsonFields.js","sourceRoot":"","sources":["../../../../src/harness/verify/JsonFields.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC7E,CAAC","sourcesContent":["export function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n"]}
@@ -1,7 +0,0 @@
1
- import type { FileSystem } from 'effect';
2
- import type { ChildProcessSpawner } from 'effect/unstable/process';
3
- import { Effect } from 'effect';
4
- import { VerifyStageFailed } from './VerifyStage.ts';
5
- type VerifyServices = ChildProcessSpawner.ChildProcessSpawner | FileSystem.FileSystem;
6
- export declare const verifyPipeline: (harness: string) => Effect.Effect<void, VerifyStageFailed, VerifyServices>;
7
- export {};
@@ -1,55 +0,0 @@
1
- import { Console, Effect, Result } from 'effect';
2
- import { commandString } from "../../platform/Process.js";
3
- import { errorMessage } from "../Errors.js";
4
- import { verifyHarnessContract } from "./ProviderRepository.js";
5
- import { stageSpecByTag, VerifyStageFailed } from "./VerifyStage.js";
6
- function toVoid(effect) {
7
- return Effect.map(effect, () => undefined);
8
- }
9
- function sourcePins(harness) {
10
- return {
11
- spec: stageSpecByTag('source-pins'),
12
- run: toVoid(commandString('pnpm', ['source:verify'], { cwd: harness })),
13
- };
14
- }
15
- function harnessContract(harness) {
16
- return {
17
- spec: stageSpecByTag('harness-contract'),
18
- run: toVoid(verifyHarnessContract(harness)),
19
- };
20
- }
21
- function commandStage(tag, args, harness) {
22
- return {
23
- spec: stageSpecByTag(tag),
24
- run: toVoid(commandString('pnpm', args, { cwd: harness })),
25
- };
26
- }
27
- const runStage = Effect.fnUntraced(function* (stage) {
28
- yield* Console.log(`verify stage: ${stage.spec.tag}`);
29
- const result = yield* Effect.result(stage.run);
30
- if (Result.isFailure(result)) {
31
- return yield* new VerifyStageFailed({
32
- causeMessage: errorMessage(result.failure),
33
- routeHint: stage.spec.routeHint,
34
- routes: [...stage.spec.routes],
35
- stageTag: stage.spec.tag,
36
- stageTitle: stage.spec.title,
37
- });
38
- }
39
- yield* Console.log(`verify stage passed: ${stage.spec.tag}`);
40
- });
41
- export const verifyPipeline = Effect.fnUntraced(function* (harness) {
42
- const stages = [
43
- sourcePins(harness),
44
- harnessContract(harness),
45
- commandStage('tsgo-diagnostics', ['typecheck'], harness),
46
- commandStage('tests', ['test'], harness),
47
- commandStage('lint', ['lint', '--max-warnings', '0'], harness),
48
- commandStage('knip', ['knip'], harness),
49
- ];
50
- for (const stage of stages) {
51
- yield* runStage(stage);
52
- }
53
- yield* Console.log('verify pipeline passed.');
54
- });
55
- //# sourceMappingURL=Pipeline.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Pipeline.js","sourceRoot":"","sources":["../../../../src/harness/verify/Pipeline.ts"],"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C,CAAA;IACxB,CAAC;IAED,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAA;AAC/C,CAAC,CAAC,CAAA","sourcesContent":["import type { FileSystem, PlatformError } from 'effect'\nimport type { ChildProcessSpawner } from 'effect/unstable/process'\nimport type { HarnessError, ProcessError } from '../Errors.ts'\nimport type { VerifyStageSpec, VerifyStageTag } from './VerifyStage.ts'\nimport { Console, Effect, Result } from 'effect'\nimport { commandString } from '../../platform/Process.ts'\nimport { errorMessage } from '../Errors.ts'\nimport { verifyHarnessContract } from './ProviderRepository.ts'\nimport { stageSpecByTag, VerifyStageFailed } from './VerifyStage.ts'\n\ntype VerifyError = HarnessError | PlatformError.PlatformError | ProcessError\ntype VerifyServices = ChildProcessSpawner.ChildProcessSpawner | FileSystem.FileSystem\n\ninterface VerifyStage {\n readonly spec: VerifyStageSpec\n readonly run: Effect.Effect<void, VerifyError, VerifyServices>\n}\n\nfunction toVoid<E, R>(effect: Effect.Effect<unknown, E, R>): Effect.Effect<void, E, R> {\n return Effect.map(effect, () => undefined)\n}\n\nfunction sourcePins(harness: string): VerifyStage {\n return {\n spec: stageSpecByTag('source-pins'),\n run: toVoid(commandString('pnpm', ['source:verify'], { cwd: harness })),\n }\n}\n\nfunction harnessContract(harness: string): VerifyStage {\n return {\n spec: stageSpecByTag('harness-contract'),\n run: toVoid(verifyHarnessContract(harness)),\n }\n}\n\nfunction commandStage(\n tag: VerifyStageTag,\n args: ReadonlyArray<string>,\n harness: string,\n): VerifyStage {\n return {\n spec: stageSpecByTag(tag),\n run: toVoid(commandString('pnpm', args, { cwd: harness })),\n }\n}\n\nconst runStage = Effect.fnUntraced(function* (stage: VerifyStage) {\n yield* Console.log(`verify stage: ${stage.spec.tag}`)\n const result = yield* Effect.result(stage.run)\n\n if (Result.isFailure(result)) {\n return yield* new VerifyStageFailed({\n causeMessage: errorMessage(result.failure),\n routeHint: stage.spec.routeHint,\n routes: [...stage.spec.routes],\n stageTag: stage.spec.tag,\n stageTitle: stage.spec.title,\n })\n }\n\n yield* Console.log(`verify stage passed: ${stage.spec.tag}`)\n})\n\nexport const verifyPipeline = Effect.fnUntraced(function* (harness: string) {\n const stages: ReadonlyArray<VerifyStage> = [\n sourcePins(harness),\n harnessContract(harness),\n commandStage('tsgo-diagnostics', ['typecheck'], harness),\n commandStage('tests', ['test'], harness),\n commandStage('lint', ['lint', '--max-warnings', '0'], harness),\n commandStage('knip', ['knip'], harness),\n ]\n\n for (const stage of stages) {\n yield* runStage(stage)\n }\n\n yield* Console.log('verify pipeline passed.')\n})\n"]}
@@ -1,3 +0,0 @@
1
- import { Effect, FileSystem } from 'effect';
2
- import { HarnessError } from '../Errors.ts';
3
- export declare const verifyProviderProfileContract: (errors: string[], harness: string) => Effect.Effect<void, HarnessError | import("effect/PlatformError").PlatformError, FileSystem.FileSystem>;