ttsc 0.31.0 → 0.31.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 (52) hide show
  1. package/cmd/platform/main.go +2 -2
  2. package/internal/sourceprocess/contain_windows.go +10 -13
  3. package/internal/sourceprocess/started_windows.go +41 -0
  4. package/internal/sourceprocess/windows_started_publication_distinguishes_pending_from_refusal_test.go +76 -0
  5. package/internal/watchhelper/run.go +30 -20
  6. package/internal/watchhelper/run_other.go +4 -4
  7. package/internal/watchhelper/run_windows.go +471 -0
  8. package/internal/watchhelper/watchhelper.go +8 -2
  9. package/internal/watchhelper/windows_notifications_preserve_mutations_without_access_noise_test.go +506 -0
  10. package/lib/internal/nativeBinary.d.ts +3 -3
  11. package/lib/internal/nativeBinary.js +3 -3
  12. package/lib/plugin/internal/load/loadProjectPlugins.d.ts +12 -13
  13. package/lib/plugin/internal/load/loadProjectPlugins.js +61 -36
  14. package/lib/plugin/internal/load/loadProjectPlugins.js.map +1 -1
  15. package/lib/plugin/internal/source/GoEnvironmentReading.d.ts +42 -0
  16. package/lib/plugin/internal/source/GoEnvironmentReading.js +110 -0
  17. package/lib/plugin/internal/source/GoEnvironmentReading.js.map +1 -0
  18. package/lib/plugin/internal/source/NativeSourcePackages.d.ts +7 -7
  19. package/lib/plugin/internal/source/NativeSourcePackages.js +33 -20
  20. package/lib/plugin/internal/source/NativeSourcePackages.js.map +1 -1
  21. package/lib/plugin/internal/source/PluginBuildEnvironmentReadings.d.ts +21 -0
  22. package/lib/plugin/internal/source/PluginBuildEnvironmentReadings.js +36 -0
  23. package/lib/plugin/internal/source/PluginBuildEnvironmentReadings.js.map +1 -1
  24. package/lib/plugin/internal/source/PluginBuildEnvironmentWitness.d.ts +5 -3
  25. package/lib/plugin/internal/source/PluginBuildEnvironmentWitness.js +14 -8
  26. package/lib/plugin/internal/source/PluginBuildEnvironmentWitness.js.map +1 -1
  27. package/lib/plugin/internal/source/SourcePluginWorkspace.d.ts +50 -19
  28. package/lib/plugin/internal/source/SourcePluginWorkspace.js +109 -22
  29. package/lib/plugin/internal/source/SourcePluginWorkspace.js.map +1 -1
  30. package/lib/plugin/internal/source/buildSourcePlugin.d.ts +19 -16
  31. package/lib/plugin/internal/source/buildSourcePlugin.js +27 -22
  32. package/lib/plugin/internal/source/buildSourcePlugin.js.map +1 -1
  33. package/lib/plugin/internal/source/computeCacheKey.d.ts +4 -2
  34. package/lib/plugin/internal/source/computeCacheKey.js +15 -6
  35. package/lib/plugin/internal/source/computeCacheKey.js.map +1 -1
  36. package/lib/plugin/internal/source/hashPluginBuildEnvironment.js +2 -68
  37. package/lib/plugin/internal/source/hashPluginBuildEnvironment.js.map +1 -1
  38. package/lib/plugin/internal/source/pluginModuleReplaceDirectories.d.ts +6 -5
  39. package/lib/plugin/internal/source/pluginModuleReplaceDirectories.js +10 -17
  40. package/lib/plugin/internal/source/pluginModuleReplaceDirectories.js.map +1 -1
  41. package/package.json +8 -8
  42. package/src/internal/nativeBinary.ts +3 -3
  43. package/src/plugin/internal/load/loadProjectPlugins.ts +209 -117
  44. package/src/plugin/internal/source/GoEnvironmentReading.ts +109 -0
  45. package/src/plugin/internal/source/NativeSourcePackages.ts +103 -43
  46. package/src/plugin/internal/source/PluginBuildEnvironmentReadings.ts +42 -0
  47. package/src/plugin/internal/source/PluginBuildEnvironmentWitness.ts +18 -8
  48. package/src/plugin/internal/source/SourcePluginWorkspace.ts +143 -25
  49. package/src/plugin/internal/source/buildSourcePlugin.ts +62 -34
  50. package/src/plugin/internal/source/computeCacheKey.ts +26 -8
  51. package/src/plugin/internal/source/hashPluginBuildEnvironment.ts +8 -76
  52. package/src/plugin/internal/source/pluginModuleReplaceDirectories.ts +13 -25
@@ -2,20 +2,23 @@
2
2
  * Share generated Go workspace policy between package selection and building.
3
3
  *
4
4
  * Package selection must use the builder's overlays, generated workspace and
5
- * selected tool rather than an ancestor go.work found in a source directory.
6
- * A load may share installed-overlay manifest records under its pinned tool
7
- * and effective environment; each unique scratch is read independently. The
8
- * cold build owns a fresh reader over its proven materialized inputs. Go
9
- * supplies the workspace's required Go and toolchain directives. These reads
10
- * preserve the existing installation/version and sequential-stability limits.
5
+ * selected tool rather than an ancestor go.work found in a source directory. A
6
+ * load shares early replacement watch, package and build manifest records under
7
+ * its pinned tool and effective environment; identical current bytes in
8
+ * independently proven scratch inputs share their Go parse. A moved native tool
9
+ * clears that reader's syntax memo, and a toolchain retry starts a new reader
10
+ * scope. Each caller has a diagnostic view over the shared native reader state;
11
+ * one plugin cannot inherit another plugin's failure label (#1720). Go supplies
12
+ * the workspace's required Go and toolchain directives. These reads preserve
13
+ * the existing installation/version and sequential-stability limits.
11
14
  *
12
15
  * @evidence contracts/common.md#principled-implementation Shared manifest acquisition, managed replacement admission, overlay filtering and Go-owned workspace version selection keep metadata and compilation under the same workspace policy; callers own source materialization and effective environment.
13
16
  * @evidence contracts/common.md#clear-and-simple-design One namespace owns the generated workspace and its module reader, overlay discovery and Go launch diagnostics; no second manifest parser or build-tag interpreter is introduced.
14
17
  * @evidence contracts/common.md#prohibited-implementation-shortcuts Actual Go mod edit and work use commands interpret manifests; selected tool errors propagate and no static workspace version replaces Go's decision.
15
18
  * @evidence contracts/common.md#meaningful-documentation Native prose explains shared policy and caller ownership; private helpers remain part of this operation's review surface.
16
19
  * @evidence contracts/portability.md#os-neutral-implementation Native fs/path operations preserve path spelling and formatGoWorkPath owns Go syntax quoting; subprocesses use the existing native wrapper owner with hidden windows.
17
- * @evidence contracts/performance.md#efficient-algorithms Workspace construction scans module and replacement populations; each module reader memoizes absolute directory results within its owning load or materialized build. Overlay discovery recursively scans admitted directories and sorts paths; native Go output and JSON parsing scale with complete bytes.
18
- * @evidence contracts/performance.md#reuse-equivalent-work A metadata load shares equivalent installed-overlay observations under one pinned tool/effective environment; unique scratch paths are independent. A materialized build uses its own reader, and no memo crosses a load or changed environment. Metadata and build share policy rather than pretending their independently materialized sources are identical.
20
+ * @evidence contracts/performance.md#efficient-algorithms Workspace construction scans module and replacement populations; each reader reads current manifest bytes and memoizes equivalent Go syntax within its pinned native tool/load. Overlay discovery recursively scans admitted directories and sorts paths; native Go output and JSON parsing scale with complete bytes.
21
+ * @evidence contracts/performance.md#reuse-equivalent-work Metadata and materialized builds share Go parsing only for identical current manifest bytes under the same pinned tool/effective environment. Independent materialization/content proof remains with each caller; tool movement clears syntax reuse and retries start another scope.
19
22
  * @evidence contracts/performance.md#bound-retention-and-release-resources Readers retain module records only for their enclosing load or materialized build; command capture cleanup belongs to spawnGoTool and scratch lifetime belongs to the caller. Native commands can mutate Go-owned state and their selected-child completion does not prove arbitrary descendants retired.
20
23
  */
21
24
  export declare namespace SourcePluginWorkspace {
@@ -33,7 +36,8 @@ export declare namespace SourcePluginWorkspace {
33
36
  */
34
37
  export function materialize(source: string, scratch: string): void;
35
38
  /**
36
- * Write the native builder's generated workspace and let Go select its version.
39
+ * Write the native builder's generated workspace and let Go select its
40
+ * version.
37
41
  *
38
42
  * @evidence contracts/common.md#principled-implementation Actual manifest records drive managed overlay filtering and replacement admission; Go work use supplies required directives.
39
43
  * @evidence contracts/common.md#clear-and-simple-design The writer shares one reader across source/overlay queries and delegates manifest interpretation to Go.
@@ -51,6 +55,7 @@ export declare namespace SourcePluginWorkspace {
51
55
  interface GoModInfo {
52
56
  readonly modulePath: string | null;
53
57
  readonly replacements: readonly GoModReplacement[];
58
+ readonly directives: NonNullable<GoModJson["Replace"]>;
54
59
  }
55
60
  /**
56
61
  * One selected-context manifest reader.
@@ -67,31 +72,57 @@ export declare namespace SourcePluginWorkspace {
67
72
  export interface GoModReader {
68
73
  /**
69
74
  * Observe the module at this native directory within the reader context.
75
+ * The optional diagnostic owner overrides the creating caller's label only;
76
+ * it changes no selected-tool, environment or byte-content authority.
70
77
  *
71
78
  * @evidence contracts/common.md#principled-implementation The signature associates a native directory with the selected reader's Go-owned module and replacement observation.
72
- * @evidence contracts/common.md#clear-and-simple-design One input and one record expose the manifest policy needed by the workspace writer.
79
+ * @evidence contracts/common.md#clear-and-simple-design A directory and optional diagnostic label expose manifest policy without treating the label as native cache authority.
73
80
  * @evidence contracts/common.md#prohibited-implementation-shortcuts The signature supplies no parser, alternate selection policy or stability certificate.
74
- * @evidence contracts/common.md#meaningful-documentation Native prose states that the result belongs to the reader context rather than a context-independent directory cache.
81
+ * @evidence contracts/common.md#meaningful-documentation Native prose states selected-context result ownership and the optional caller label, which changes failure attribution only.
75
82
  * @evidence contracts/portability.md#os-neutral-implementation The directory is a native filesystem path; its resolution belongs to the implementing reader.
76
83
  * @evidence contracts/performance.md#efficient-algorithms A method signature executes no algorithm; createGoModReader owns acquisition and parsing.
77
84
  * @evidence contracts/performance.md#reuse-equivalent-work Implementations supply observations within their selected tool/environment scope; this signature establishes no cross-context memo.
78
85
  * @evidence contracts/performance.md#bound-retention-and-release-resources The signature acquires no resource; record retention belongs to the reader's enclosing load or materialized build.
79
86
  */
80
- read(dir: string): GoModInfo;
87
+ read(dir: string, diagnosticPlugin?: string): GoModInfo;
88
+ }
89
+ interface GoModJson {
90
+ readonly Module?: {
91
+ readonly Path?: string;
92
+ };
93
+ readonly Require?: readonly {
94
+ readonly Path?: string;
95
+ readonly Version?: string;
96
+ }[];
97
+ readonly Replace?: readonly {
98
+ readonly Old?: {
99
+ readonly Path?: string;
100
+ readonly Version?: string;
101
+ };
102
+ readonly New?: {
103
+ readonly Path?: string;
104
+ readonly Version?: string;
105
+ };
106
+ }[];
81
107
  }
82
108
  /**
83
- * Read each module once through Go within one selected-tool context.
109
+ * Read current manifest bytes and share identical Go parses within one pinned
110
+ * selected-tool/load context, including copied scratch modules. An optional
111
+ * registry shares native reader state from the first watch query onward; its
112
+ * owner must keep one fixed effective environment and discard it on retry.
113
+ * Caller views share that native state and syntax, while each default
114
+ * diagnostic label remains with its current caller.
84
115
  *
85
- * @evidence contracts/common.md#principled-implementation Actual go mod edit JSON determines module/replacement identities; missing go.mod returns the existing empty module observation.
86
- * @evidence contracts/common.md#clear-and-simple-design An absolute-directory map wraps one manifest acquisition helper.
116
+ * @evidence contracts/common.md#principled-implementation Actual go mod edit JSON determines module/replacement identities; current bytes, selected/dispatched-tool metadata and Go's environment-file witness qualify reuse under the existing metadata-distinguishability premise. Environment values are copied at reader creation. Missing go.mod returns the existing empty module observation, and moving tool/manifest inputs cannot publish a parsed record.
117
+ * @evidence contracts/common.md#clear-and-simple-design One factory acquires load-owned native reader state by selected tool; a thin caller view forwards its diagnostic label without duplicating the byte-content map. Current reads and post-parse byte/tool comparisons qualify insertion.
87
118
  * @evidence contracts/common.md#prohibited-implementation-shortcuts No custom Go manifest parser or global context-insensitive memo is introduced.
88
119
  * @evidence contracts/common.md#meaningful-documentation Native prose states this operation's authority and delegated boundaries; fields retain separate native comments.
89
120
  * @evidence contracts/portability.md#os-neutral-implementation Native path resolution and temporary cwd avoid deep Windows working-directory limits; the selected tool handles manifest syntax.
90
- * @evidence contracts/performance.md#efficient-algorithms Each distinct directory runs one existence query and at most one Go mod edit plus complete JSON parsing.
91
- * @evidence contracts/performance.md#reuse-equivalent-work The caller may share this reader only within one load and the same pinned tool/effective environment; directory results are not cross-load authority.
92
- * @evidence contracts/performance.md#bound-retention-and-release-resources The map grows with distinct observed directories for its caller's lifetime; process/output capture cleanup remains delegated.
121
+ * @evidence contracts/performance.md#efficient-algorithms Reader acquisition performs a selected-tool registry lookup; every nonmissing read qualifies tool/environment metadata and reads current manifest bytes. A cold or stale witness first observes the selected launcher; an unavailable or nonfile launcher skips optional environment acquisition and permits only the actual uncached parse attempt. An observed file lends its same pre-read stat to the witness before acquiring current Go values and GOENV evidence through the common reader, without a GOROOT walk. Only complete native GOENV/GOROOT locations qualify syntax sharing; a dispatched tool is witnessed before parsing. Unavailable native environment acquisition disables syntax sharing while preserving actual parse success or failure. Each distinct byte string that earns stable successful syntax in that tool epoch runs Go mod edit and complete JSON parsing once, then rechecks bytes/tool metadata before caching; copied manifests share that parse. Failed queries remain uncached and report the current caller's diagnostic label.
122
+ * @evidence contracts/performance.md#reuse-equivalent-work The caller may share this reader only within one load and the same pinned tool/effective environment; parsed syntax is not cross-load or native containment authority. Caller views share native state while preserving failure attribution; diagnostic labels are not syntax cache inputs.
123
+ * @evidence contracts/performance.md#bound-retention-and-release-resources The map retains distinct manifest bytes and parsed syntax for its caller's load/build lifetime; process/output capture cleanup remains delegated.
93
124
  */
94
- export function createGoModReader(goBinary: string, pluginName: string, env: NodeJS.ProcessEnv): GoModReader;
125
+ export function createGoModReader(goBinary: string, pluginName: string, env: NodeJS.ProcessEnv, readers?: Map<string, GoModReader>): GoModReader;
95
126
  /**
96
127
  * Describe a failed Go launch without confusing missing cwd and missing tool.
97
128
  *
@@ -8,29 +8,34 @@ const node_fs_1 = __importDefault(require("node:fs"));
8
8
  const node_os_1 = __importDefault(require("node:os"));
9
9
  const node_path_1 = __importDefault(require("node:path"));
10
10
  const OwnedSynchronousProcess_1 = require("../../../internal/OwnedSynchronousProcess");
11
+ const GoEnvironmentReading_1 = require("./GoEnvironmentReading");
11
12
  const GoSourceInputs_1 = require("./GoSourceInputs");
12
- const copiesPluginSourceEntry_1 = require("./copiesPluginSourceEntry");
13
+ const PluginBuildEnvironmentWitness_1 = require("./PluginBuildEnvironmentWitness");
13
14
  const SourcePluginAdmission_1 = require("./SourcePluginAdmission");
15
+ const copiesPluginSourceEntry_1 = require("./copiesPluginSourceEntry");
14
16
  const formatGoWorkPath_1 = require("./formatGoWorkPath");
15
17
  const spawnGoTool_1 = require("./spawnGoTool");
16
18
  /**
17
19
  * Share generated Go workspace policy between package selection and building.
18
20
  *
19
21
  * Package selection must use the builder's overlays, generated workspace and
20
- * selected tool rather than an ancestor go.work found in a source directory.
21
- * A load may share installed-overlay manifest records under its pinned tool
22
- * and effective environment; each unique scratch is read independently. The
23
- * cold build owns a fresh reader over its proven materialized inputs. Go
24
- * supplies the workspace's required Go and toolchain directives. These reads
25
- * preserve the existing installation/version and sequential-stability limits.
22
+ * selected tool rather than an ancestor go.work found in a source directory. A
23
+ * load shares early replacement watch, package and build manifest records under
24
+ * its pinned tool and effective environment; identical current bytes in
25
+ * independently proven scratch inputs share their Go parse. A moved native tool
26
+ * clears that reader's syntax memo, and a toolchain retry starts a new reader
27
+ * scope. Each caller has a diagnostic view over the shared native reader state;
28
+ * one plugin cannot inherit another plugin's failure label (#1720). Go supplies
29
+ * the workspace's required Go and toolchain directives. These reads preserve
30
+ * the existing installation/version and sequential-stability limits.
26
31
  *
27
32
  * @evidence contracts/common.md#principled-implementation Shared manifest acquisition, managed replacement admission, overlay filtering and Go-owned workspace version selection keep metadata and compilation under the same workspace policy; callers own source materialization and effective environment.
28
33
  * @evidence contracts/common.md#clear-and-simple-design One namespace owns the generated workspace and its module reader, overlay discovery and Go launch diagnostics; no second manifest parser or build-tag interpreter is introduced.
29
34
  * @evidence contracts/common.md#prohibited-implementation-shortcuts Actual Go mod edit and work use commands interpret manifests; selected tool errors propagate and no static workspace version replaces Go's decision.
30
35
  * @evidence contracts/common.md#meaningful-documentation Native prose explains shared policy and caller ownership; private helpers remain part of this operation's review surface.
31
36
  * @evidence contracts/portability.md#os-neutral-implementation Native fs/path operations preserve path spelling and formatGoWorkPath owns Go syntax quoting; subprocesses use the existing native wrapper owner with hidden windows.
32
- * @evidence contracts/performance.md#efficient-algorithms Workspace construction scans module and replacement populations; each module reader memoizes absolute directory results within its owning load or materialized build. Overlay discovery recursively scans admitted directories and sorts paths; native Go output and JSON parsing scale with complete bytes.
33
- * @evidence contracts/performance.md#reuse-equivalent-work A metadata load shares equivalent installed-overlay observations under one pinned tool/effective environment; unique scratch paths are independent. A materialized build uses its own reader, and no memo crosses a load or changed environment. Metadata and build share policy rather than pretending their independently materialized sources are identical.
37
+ * @evidence contracts/performance.md#efficient-algorithms Workspace construction scans module and replacement populations; each reader reads current manifest bytes and memoizes equivalent Go syntax within its pinned native tool/load. Overlay discovery recursively scans admitted directories and sorts paths; native Go output and JSON parsing scale with complete bytes.
38
+ * @evidence contracts/performance.md#reuse-equivalent-work Metadata and materialized builds share Go parsing only for identical current manifest bytes under the same pinned tool/effective environment. Independent materialization/content proof remains with each caller; tool movement clears syntax reuse and retries start another scope.
34
39
  * @evidence contracts/performance.md#bound-retention-and-release-resources Readers retain module records only for their enclosing load or materialized build; command capture cleanup belongs to spawnGoTool and scratch lifetime belongs to the caller. Native commands can mutate Go-owned state and their selected-child completion does not prove arbitrary descendants retired.
35
40
  */
36
41
  var SourcePluginWorkspace;
@@ -60,7 +65,8 @@ var SourcePluginWorkspace;
60
65
  }
61
66
  SourcePluginWorkspace.materialize = materialize;
62
67
  /**
63
- * Write the native builder's generated workspace and let Go select its version.
68
+ * Write the native builder's generated workspace and let Go select its
69
+ * version.
64
70
  *
65
71
  * @evidence contracts/common.md#principled-implementation Actual manifest records drive managed overlay filtering and replacement admission; Go work use supplies required directives.
66
72
  * @evidence contracts/common.md#clear-and-simple-design The writer shares one reader across source/overlay queries and delegates manifest interpretation to Go.
@@ -132,32 +138,111 @@ var SourcePluginWorkspace;
132
138
  ];
133
139
  }
134
140
  /**
135
- * Read each module once through Go within one selected-tool context.
141
+ * Read current manifest bytes and share identical Go parses within one pinned
142
+ * selected-tool/load context, including copied scratch modules. An optional
143
+ * registry shares native reader state from the first watch query onward; its
144
+ * owner must keep one fixed effective environment and discard it on retry.
145
+ * Caller views share that native state and syntax, while each default
146
+ * diagnostic label remains with its current caller.
136
147
  *
137
- * @evidence contracts/common.md#principled-implementation Actual go mod edit JSON determines module/replacement identities; missing go.mod returns the existing empty module observation.
138
- * @evidence contracts/common.md#clear-and-simple-design An absolute-directory map wraps one manifest acquisition helper.
148
+ * @evidence contracts/common.md#principled-implementation Actual go mod edit JSON determines module/replacement identities; current bytes, selected/dispatched-tool metadata and Go's environment-file witness qualify reuse under the existing metadata-distinguishability premise. Environment values are copied at reader creation. Missing go.mod returns the existing empty module observation, and moving tool/manifest inputs cannot publish a parsed record.
149
+ * @evidence contracts/common.md#clear-and-simple-design One factory acquires load-owned native reader state by selected tool; a thin caller view forwards its diagnostic label without duplicating the byte-content map. Current reads and post-parse byte/tool comparisons qualify insertion.
139
150
  * @evidence contracts/common.md#prohibited-implementation-shortcuts No custom Go manifest parser or global context-insensitive memo is introduced.
140
151
  * @evidence contracts/common.md#meaningful-documentation Native prose states this operation's authority and delegated boundaries; fields retain separate native comments.
141
152
  * @evidence contracts/portability.md#os-neutral-implementation Native path resolution and temporary cwd avoid deep Windows working-directory limits; the selected tool handles manifest syntax.
142
- * @evidence contracts/performance.md#efficient-algorithms Each distinct directory runs one existence query and at most one Go mod edit plus complete JSON parsing.
143
- * @evidence contracts/performance.md#reuse-equivalent-work The caller may share this reader only within one load and the same pinned tool/effective environment; directory results are not cross-load authority.
144
- * @evidence contracts/performance.md#bound-retention-and-release-resources The map grows with distinct observed directories for its caller's lifetime; process/output capture cleanup remains delegated.
153
+ * @evidence contracts/performance.md#efficient-algorithms Reader acquisition performs a selected-tool registry lookup; every nonmissing read qualifies tool/environment metadata and reads current manifest bytes. A cold or stale witness first observes the selected launcher; an unavailable or nonfile launcher skips optional environment acquisition and permits only the actual uncached parse attempt. An observed file lends its same pre-read stat to the witness before acquiring current Go values and GOENV evidence through the common reader, without a GOROOT walk. Only complete native GOENV/GOROOT locations qualify syntax sharing; a dispatched tool is witnessed before parsing. Unavailable native environment acquisition disables syntax sharing while preserving actual parse success or failure. Each distinct byte string that earns stable successful syntax in that tool epoch runs Go mod edit and complete JSON parsing once, then rechecks bytes/tool metadata before caching; copied manifests share that parse. Failed queries remain uncached and report the current caller's diagnostic label.
154
+ * @evidence contracts/performance.md#reuse-equivalent-work The caller may share this reader only within one load and the same pinned tool/effective environment; parsed syntax is not cross-load or native containment authority. Caller views share native state while preserving failure attribution; diagnostic labels are not syntax cache inputs.
155
+ * @evidence contracts/performance.md#bound-retention-and-release-resources The map retains distinct manifest bytes and parsed syntax for its caller's load/build lifetime; process/output capture cleanup remains delegated.
145
156
  */
146
- function createGoModReader(goBinary, pluginName, env) {
157
+ function createGoModReader(goBinary, pluginName, env, readers) {
158
+ const existing = readers?.get(goBinary);
159
+ if (existing !== undefined)
160
+ return {
161
+ read: (dir, diagnosticPlugin = pluginName) => existing.read(dir, diagnosticPlugin),
162
+ };
163
+ // WARNING (#1712): parse identical bytes once in this pinned tool/load
164
+ // context, including early replacement watch projection and copied scratch
165
+ // manifests. The optional registry belongs to one fixed effective environment
166
+ // and one load; it is never shared with a toolchain retry. Always read current bytes;
167
+ // a pathname or metadata-only memo misses manifest edits. Never promote
168
+ // this map to a process cache: tool/environment epochs change Go authority.
169
+ // Fixed variable strings do not freeze GOENV or a dispatched Go executable.
170
+ // Requalify their actual native evidence before every syntax hit; missing
171
+ // environment authority permits a fresh parse only, never positive reuse.
172
+ // WARNING (#1720): diagnostic names are per caller, not a syntax/cache input.
173
+ // Shared views must forward their current label to every failed native read.
147
174
  const cache = new Map();
148
- return {
149
- read(dir) {
175
+ const environment = { ...env };
176
+ let toolWitness;
177
+ const reader = {
178
+ read(dir, diagnosticPlugin = pluginName) {
150
179
  OwnedSynchronousProcess_1.OwnedSynchronousProcess.checkpoint();
151
180
  const resolved = node_path_1.default.resolve(dir);
152
- const cached = cache.get(resolved);
181
+ const manifest = node_path_1.default.join(resolved, "go.mod");
182
+ let bytes;
183
+ try {
184
+ bytes = node_fs_1.default.readFileSync(manifest);
185
+ }
186
+ catch (error) {
187
+ if (error.code === "ENOENT")
188
+ return emptyGoModInfo();
189
+ throw error;
190
+ }
191
+ if (toolWitness === undefined ||
192
+ !PluginBuildEnvironmentWitness_1.PluginBuildEnvironmentWitness.holds(toolWitness)) {
193
+ cache.clear();
194
+ const witness = new Map();
195
+ let launcher;
196
+ try {
197
+ launcher = node_fs_1.default.statSync(goBinary, { bigint: true });
198
+ }
199
+ catch {
200
+ // Unavailable metadata cannot qualify optional syntax reuse.
201
+ }
202
+ if (launcher?.isFile() === true)
203
+ PluginBuildEnvironmentWitness_1.PluginBuildEnvironmentWitness.add(witness, goBinary, launcher);
204
+ // GOENV can change toolchain selection without changing env strings.
205
+ // Share its existing native discovery owner; do not scan GOROOT here.
206
+ // Do not launch a missing/unobservable tool twice just to learn that
207
+ // optional cache qualification is unavailable (#1712). The actual
208
+ // mod-edit attempt below still owns its current failure or success.
209
+ const observed = launcher?.isFile() === true
210
+ ? GoEnvironmentReading_1.GoEnvironmentReading.read(goBinary, node_os_1.default.tmpdir(), environment, ["GOROOT"], witness)
211
+ : undefined;
212
+ if (typeof observed?.GOROOT === "string" &&
213
+ node_path_1.default.isAbsolute(observed.GOROOT))
214
+ PluginBuildEnvironmentWitness_1.PluginBuildEnvironmentWitness.add(witness, node_path_1.default.join(observed.GOROOT, "bin", process.platform === "win32" ? "go.exe" : "go"));
215
+ const complete = typeof observed?.GOROOT === "string" &&
216
+ node_path_1.default.isAbsolute(observed.GOROOT) &&
217
+ typeof observed.GOENV === "string" &&
218
+ (observed.GOENV === "off" || node_path_1.default.isAbsolute(observed.GOENV));
219
+ toolWitness =
220
+ complete && PluginBuildEnvironmentWitness_1.PluginBuildEnvironmentWitness.holds(witness)
221
+ ? witness
222
+ : undefined;
223
+ }
224
+ // UTF-8 decoding is lossy for malformed input. Only identical bytes
225
+ // can share Go syntax, even when Go serializes two inputs identically.
226
+ const byteKey = bytes.toString("base64");
227
+ const cached = cache.get(byteKey);
153
228
  if (cached !== undefined) {
154
229
  return cached;
155
230
  }
156
- const info = readGoModInfo(resolved, goBinary, pluginName, env);
157
- cache.set(resolved, info);
231
+ const info = readGoModInfo(resolved, goBinary, diagnosticPlugin, environment);
232
+ if (!node_fs_1.default.readFileSync(manifest).equals(bytes))
233
+ throw new Error(`ttsc: go.mod changed while Go was reading ${manifest}`);
234
+ if (toolWitness !== undefined &&
235
+ !PluginBuildEnvironmentWitness_1.PluginBuildEnvironmentWitness.holds(toolWitness))
236
+ throw new Error(`ttsc: Go tool or environment changed while reading ${manifest}`);
237
+ // An unavailable environment observation can still execute a fresh Go
238
+ // parse, but it cannot authorize sharing that result on another call.
239
+ if (toolWitness !== undefined)
240
+ cache.set(byteKey, info);
158
241
  return info;
159
242
  },
160
243
  };
244
+ readers?.set(goBinary, reader);
245
+ return reader;
161
246
  }
162
247
  SourcePluginWorkspace.createGoModReader = createGoModReader;
163
248
  function readGoModInfo(dir, goBinary, pluginName, env) {
@@ -192,6 +277,7 @@ var SourcePluginWorkspace;
192
277
  }
193
278
  return {
194
279
  modulePath: json.Module?.Path ?? null,
280
+ directives: json.Replace ?? [],
195
281
  replacements: (json.Replace ?? [])
196
282
  .map(jsonReplacementToGoModReplacement)
197
283
  .filter((replacement) => replacement !== null),
@@ -200,6 +286,7 @@ var SourcePluginWorkspace;
200
286
  function emptyGoModInfo() {
201
287
  return {
202
288
  modulePath: null,
289
+ directives: [],
203
290
  replacements: [],
204
291
  };
205
292
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SourcePluginWorkspace.js","sourceRoot":"","sources":["../../../../src/plugin/internal/source/SourcePluginWorkspace.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,sDAAyB;AACzB,0DAA6B;AAE7B,uFAAoF;AACpF,qDAAkD;AAClD,uEAAoE;AACpE,mEAAgE;AAChE,yDAAsD;AACtD,+CAA4C;AAE5C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,IAAiB,qBAAqB,CA8ZrC;AA9ZD,WAAiB,qBAAqB;IACpC;;;;;;;;;;;OAWG;IACH,SAAgB,WAAW,CAAC,MAAc,EAAE,OAAe;QACzD,iDAAuB,CAAC,UAAU,EAAE,CAAC;QACrC,iBAAE,CAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3C,iBAAE,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE;YACzB,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;gBAChB,iDAAuB,CAAC,UAAU,EAAE,CAAC;gBACrC,OAAO,IAAA,iDAAuB,EAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YAChD,CAAC;SACF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;IAZe,sBAAA,mBAAmB,sBAYlC,CAAA;IAED,SAAS,YAAY,CAAC,GAAW,EAAE,GAAa;QAC9C,iDAAuB,CAAC,UAAU,EAAE,CAAC;QACrC,IAAI,OAAoB,CAAC;QACzB,IAAI,CAAC;YACH,OAAO,GAAG,iBAAE,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QACzD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;QACT,CAAC;QACD,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,iDAAuB,CAAC,UAAU,EAAE,CAAC;YACrC,IAAI,KAAK,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC9C,QAAQ,GAAG,IAAI,CAAC;YAClB,CAAC;QACH,CAAC;QACD,IAAI,QAAQ,EAAE,CAAC;YACb,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChB,CAAC;QACD,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,iDAAuB,CAAC,UAAU,EAAE,CAAC;YACrC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;gBAAE,SAAS;YACnC,IAAI,+BAAc,CAAC,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC;gBAAE,SAAS;YAC9D,YAAY,CAAC,mBAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAGD,MAAM,mBAAmB,GAAG,uCAAuC,CAAC;AACtE,CAAC,EA9ZgB,qBAAqB,aAArB,qBAAqB,GAArB,qBAAqB,QA8ZrC"}
1
+ {"version":3,"file":"SourcePluginWorkspace.js","sourceRoot":"","sources":["../../../../src/plugin/internal/source/SourcePluginWorkspace.ts"],"names":[],"mappings":";;;;;;AAA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} from "./ITtscBuildContributor";
2
2
  import type { SourceBuildFilesystemOperations } from "./SourceBuildFilesystemOperations";
3
+ import { SourcePluginWorkspace } from "./SourcePluginWorkspace";
3
4
  /**
4
5
  * Build one Go source plugin into a cached executable.
5
6
  *
6
7
  * `opts.env` is the effective environment for this build; the caller merges
7
- * inherited and constructor layers using native environment-name identity so
8
- * a programmatic `TtscCompiler` instance
9
- * can pin its own Go toolchain (`TTSC_GO_BINARY`), Go build cache
10
- * (`TTSC_GO_CACHE_DIR`), and Go build variables (`GOFLAGS`, `CGO_*`, …) without
11
- * mutating the shared `process.env`. CLI callers omit it and inherit
12
- * `process.env`, so ambient behavior is unchanged.
8
+ * inherited and constructor layers using native environment-name identity so a
9
+ * programmatic `TtscCompiler` instance can pin its own Go toolchain
10
+ * (`TTSC_GO_BINARY`), Go build cache (`TTSC_GO_CACHE_DIR`), and Go build
11
+ * variables (`GOFLAGS`, `CGO_*`, …) without mutating the shared `process.env`.
12
+ * CLI callers omit it and inherit `process.env`, so ambient behavior is
13
+ * unchanged.
13
14
  *
14
15
  * The cache key includes source and toolchain readings. Before publication the
15
16
  * scratch inputs are compared with their recorded digests and the external
@@ -25,16 +26,16 @@ import type { SourceBuildFilesystemOperations } from "./SourceBuildFilesystemOpe
25
26
  * Optional loader-required package ownership enters the key. Its cold producer
26
27
  * admits the entry and linked sources through Go metadata in the actual
27
28
  * materialized workspace before compilation; legacy cache artifacts have a
28
- * different key. Existing binary hits trust the cache producer and key rather than rehashing
29
- * executable bytes. Default caches are managed locally, while explicit roots
30
- * retain caller-managed pruning policy. Every returned cache key registers a
31
- * reader token retained by this process until exit; registration shares the
32
- * builder/collector lease, and other consumers register independent readers.
33
- * Failure to establish ownership propagates. Private opt-in tracing records the
34
- * mandatory key-creation and pre-build witness gates and adds one diagnostic
35
- * observation after Go returns. That diagnostic read adds metadata work, not
36
- * publication permission. A discarded epoch is separately recorded when the
37
- * bounded build owner starts again.
29
+ * different key. Existing binary hits trust the cache producer and key rather
30
+ * than rehashing executable bytes. Default caches are managed locally, while
31
+ * explicit roots retain caller-managed pruning policy. Every returned cache key
32
+ * registers a reader token retained by this process until exit; registration
33
+ * shares the builder/collector lease, and other consumers register independent
34
+ * readers. Failure to establish ownership propagates. Private opt-in tracing
35
+ * records the mandatory key-creation and pre-build witness gates and adds one
36
+ * diagnostic observation after Go returns. That diagnostic read adds metadata
37
+ * work, not publication permission. A discarded epoch is separately recorded
38
+ * when the bounded build owner starts again.
38
39
  *
39
40
  * Explicit worker scopes check cancellation between build phases, copied source
40
41
  * entries and native commands, including reader admission and final
@@ -81,6 +82,8 @@ export declare function buildSourcePlugin(opts: {
81
82
  * built from.
82
83
  */
83
84
  sourceDigests?: Map<string, string>;
85
+ /** Pinned-tool manifest readers shared only by this loader request. */
86
+ goModReaders?: Map<string, SourcePluginWorkspace.GoModReader>;
84
87
  ttscVersion: string;
85
88
  tsgoVersion: string;
86
89
  }): string;
@@ -12,15 +12,15 @@ const OwnedSynchronousProcess_1 = require("../../../internal/OwnedSynchronousPro
12
12
  const SourceNativeRetirement_1 = require("../../../internal/SourceNativeRetirement");
13
13
  const createCanonicalTempDirectory_1 = require("../../../internal/createCanonicalTempDirectory");
14
14
  const runHoldingLock_1 = require("../../../internal/runHoldingLock");
15
- const NativeSourcePackages_1 = require("./NativeSourcePackages");
16
- const SourcePluginWorkspace_1 = require("./SourcePluginWorkspace");
17
15
  const GoSourceInputs_1 = require("./GoSourceInputs");
18
16
  const GoToolResolution_1 = require("./GoToolResolution");
17
+ const NativeSourcePackages_1 = require("./NativeSourcePackages");
19
18
  const PluginBinaryUse_1 = require("./PluginBinaryUse");
20
19
  const PluginBuildEnvironmentWitness_1 = require("./PluginBuildEnvironmentWitness");
21
20
  const PluginBuildLockProtocol_1 = require("./PluginBuildLockProtocol");
22
21
  const SourceBuildCacheLayout_1 = require("./SourceBuildCacheLayout");
23
22
  const SourcePluginAdmission_1 = require("./SourcePluginAdmission");
23
+ const SourcePluginWorkspace_1 = require("./SourcePluginWorkspace");
24
24
  const acquirePluginBuildLock_1 = require("./acquirePluginBuildLock");
25
25
  const computeCacheKey_1 = require("./computeCacheKey");
26
26
  const copiesPluginSourceEntry_1 = require("./copiesPluginSourceEntry");
@@ -42,12 +42,12 @@ const withGoBuildCacheLease_1 = require("./withGoBuildCacheLease");
42
42
  * Build one Go source plugin into a cached executable.
43
43
  *
44
44
  * `opts.env` is the effective environment for this build; the caller merges
45
- * inherited and constructor layers using native environment-name identity so
46
- * a programmatic `TtscCompiler` instance
47
- * can pin its own Go toolchain (`TTSC_GO_BINARY`), Go build cache
48
- * (`TTSC_GO_CACHE_DIR`), and Go build variables (`GOFLAGS`, `CGO_*`, …) without
49
- * mutating the shared `process.env`. CLI callers omit it and inherit
50
- * `process.env`, so ambient behavior is unchanged.
45
+ * inherited and constructor layers using native environment-name identity so a
46
+ * programmatic `TtscCompiler` instance can pin its own Go toolchain
47
+ * (`TTSC_GO_BINARY`), Go build cache (`TTSC_GO_CACHE_DIR`), and Go build
48
+ * variables (`GOFLAGS`, `CGO_*`, …) without mutating the shared `process.env`.
49
+ * CLI callers omit it and inherit `process.env`, so ambient behavior is
50
+ * unchanged.
51
51
  *
52
52
  * The cache key includes source and toolchain readings. Before publication the
53
53
  * scratch inputs are compared with their recorded digests and the external
@@ -63,16 +63,16 @@ const withGoBuildCacheLease_1 = require("./withGoBuildCacheLease");
63
63
  * Optional loader-required package ownership enters the key. Its cold producer
64
64
  * admits the entry and linked sources through Go metadata in the actual
65
65
  * materialized workspace before compilation; legacy cache artifacts have a
66
- * different key. Existing binary hits trust the cache producer and key rather than rehashing
67
- * executable bytes. Default caches are managed locally, while explicit roots
68
- * retain caller-managed pruning policy. Every returned cache key registers a
69
- * reader token retained by this process until exit; registration shares the
70
- * builder/collector lease, and other consumers register independent readers.
71
- * Failure to establish ownership propagates. Private opt-in tracing records the
72
- * mandatory key-creation and pre-build witness gates and adds one diagnostic
73
- * observation after Go returns. That diagnostic read adds metadata work, not
74
- * publication permission. A discarded epoch is separately recorded when the
75
- * bounded build owner starts again.
66
+ * different key. Existing binary hits trust the cache producer and key rather
67
+ * than rehashing executable bytes. Default caches are managed locally, while
68
+ * explicit roots retain caller-managed pruning policy. Every returned cache key
69
+ * registers a reader token retained by this process until exit; registration
70
+ * shares the builder/collector lease, and other consumers register independent
71
+ * readers. Failure to establish ownership propagates. Private opt-in tracing
72
+ * records the mandatory key-creation and pre-build witness gates and adds one
73
+ * diagnostic observation after Go returns. That diagnostic read adds metadata
74
+ * work, not publication permission. A discarded epoch is separately recorded
75
+ * when the bounded build owner starts again.
76
76
  *
77
77
  * Explicit worker scopes check cancellation between build phases, copied source
78
78
  * entries and native commands, including reader admission and final
@@ -100,7 +100,7 @@ function buildSourcePlugin(opts) {
100
100
  OwnedSynchronousProcess_1.OwnedSynchronousProcess.checkpoint();
101
101
  const environmentDigests = new Map(opts.environmentDigests);
102
102
  try {
103
- const binary = buildSourcePluginAttempt(opts, env, sourceDigests, environmentDigests);
103
+ const binary = buildSourcePluginAttempt(attempt === 0 ? opts : { ...opts, goModReaders: undefined }, env, sourceDigests, environmentDigests);
104
104
  OwnedSynchronousProcess_1.OwnedSynchronousProcess.checkpoint();
105
105
  for (const [directory, digest] of sourceDigests)
106
106
  opts.sourceDigests?.set(directory, digest);
@@ -124,7 +124,9 @@ function buildSourcePlugin(opts) {
124
124
  function buildSourcePluginAttempt(opts, env, sourceDigests, environmentDigests) {
125
125
  OwnedSynchronousProcess_1.OwnedSynchronousProcess.checkpoint();
126
126
  const { dir, entry, source } = resolveSourceBuildTarget(opts);
127
- const overlayDirs = [...(opts.overlayDirs ?? SourcePluginWorkspace_1.SourcePluginWorkspace.findTtscOverlayDirs())].sort();
127
+ const overlayDirs = [
128
+ ...(opts.overlayDirs ?? SourcePluginWorkspace_1.SourcePluginWorkspace.findTtscOverlayDirs()),
129
+ ].sort();
128
130
  const contributors = opts.contributors ?? [];
129
131
  const compiler = (0, resolveGoCompiler_1.resolveGoCompiler)(env);
130
132
  const goBinary = GoToolResolution_1.GoToolResolution.resolveGoToolForBuild(compiler.binary, env, dir);
@@ -132,6 +134,7 @@ function buildSourcePluginAttempt(opts, env, sourceDigests, environmentDigests)
132
134
  OwnedSynchronousProcess_1.OwnedSynchronousProcess.checkpoint();
133
135
  // The digest of every directory the key covers, as the key read it, which
134
136
  // the build proves against what it compiled.
137
+ const goModReader = SourcePluginWorkspace_1.SourcePluginWorkspace.createGoModReader(goBinary, opts.pluginName, env, opts.goModReaders);
135
138
  const environmentWitness = new Map();
136
139
  const key = (0, computeCacheKey_1.computeCacheKey)({
137
140
  contributors,
@@ -140,6 +143,7 @@ function buildSourcePluginAttempt(opts, env, sourceDigests, environmentDigests)
140
143
  entry,
141
144
  env,
142
145
  environmentWitness,
146
+ goModReader,
143
147
  filesystem: opts.filesystem,
144
148
  goBinary,
145
149
  overlayDirs,
@@ -236,6 +240,7 @@ function buildSourcePluginAttempt(opts, env, sourceDigests, environmentDigests)
236
240
  env,
237
241
  environmentWitness,
238
242
  goBinary,
243
+ goModReader,
239
244
  normalizeGoToolPermissions: compiler.bundled,
240
245
  key,
241
246
  keyedDigests: sourceDigests,
@@ -324,7 +329,7 @@ function compileSourcePlugin(opts) {
324
329
  OwnedSynchronousProcess_1.OwnedSynchronousProcess.checkpoint();
325
330
  SourcePluginWorkspace_1.SourcePluginWorkspace.materialize(opts.dir, scratchDir);
326
331
  requireKeyedSource(opts.dir, scratchDir, opts.keyedDigests, opts.pluginName);
327
- const replacements = (0, pluginModuleReplaceDirectories_1.pluginModuleReplaceDirectories)(opts.dir, opts.env, opts.goBinary);
332
+ const replacements = (0, pluginModuleReplaceDirectories_1.pluginModuleReplaceDirectories)(opts.dir, opts.env, opts.goBinary, opts.goModReader);
328
333
  OwnedSynchronousProcess_1.OwnedSynchronousProcess.checkpoint();
329
334
  // Every source the build would otherwise read in place, an overlay and
330
335
  // each replace target outside the module, is copied and proven against the
@@ -340,7 +345,7 @@ function compileSourcePlugin(opts) {
340
345
  ...replacement,
341
346
  directory: external.get(node_path_1.default.resolve(replacement.directory)),
342
347
  })), scratchDir, opts.goBinary, opts.env);
343
- const goModReader = SourcePluginWorkspace_1.SourcePluginWorkspace.createGoModReader(opts.goBinary, opts.pluginName, opts.env);
348
+ const goModReader = opts.goModReader;
344
349
  OwnedSynchronousProcess_1.OwnedSynchronousProcess.checkpoint();
345
350
  if (opts.contributors.length > 0) {
346
351
  mergeContributors({