@cat-factory/orchestration 0.296.0 → 0.298.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/container/dependencies.d.ts +12 -1
- package/dist/container/dependencies.d.ts.map +1 -1
- package/dist/container/environmentsModule.factory.d.ts.map +1 -1
- package/dist/container/environmentsModule.factory.js +3 -0
- package/dist/container/environmentsModule.factory.js.map +1 -1
- package/dist/modules/bootstrap/BootstrapService.d.ts.map +1 -1
- package/dist/modules/bootstrap/BootstrapService.js +17 -1
- package/dist/modules/bootstrap/BootstrapService.js.map +1 -1
- package/dist/modules/bootstrap/MonorepoAdoptionAdvisorService.d.ts.map +1 -1
- package/dist/modules/bootstrap/MonorepoAdoptionAdvisorService.js +30 -4
- package/dist/modules/bootstrap/MonorepoAdoptionAdvisorService.js.map +1 -1
- package/dist/modules/bootstrap/MonorepoBootstrapController.d.ts.map +1 -1
- package/dist/modules/bootstrap/MonorepoBootstrapController.js +55 -20
- package/dist/modules/bootstrap/MonorepoBootstrapController.js.map +1 -1
- package/dist/modules/bootstrap/monorepoSurvey.d.ts +202 -18
- package/dist/modules/bootstrap/monorepoSurvey.d.ts.map +1 -1
- package/dist/modules/bootstrap/monorepoSurvey.js +641 -188
- package/dist/modules/bootstrap/monorepoSurvey.js.map +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonorepoBootstrapController.js","sourceRoot":"","sources":["../../../src/modules/bootstrap/MonorepoBootstrapController.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MonorepoBootstrapController.js","sourceRoot":"","sources":["../../../src/modules/bootstrap/MonorepoBootstrapController.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,aAAa,EACb,eAAe,EACf,uBAAuB,EACvB,aAAa,EACb,sBAAsB,EACtB,mBAAmB,EACnB,aAAa,EACb,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,GAChB,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AAW,EAAE;YACrB,SAAS,EAAE,EAAE;YACb,kBAAkB,EAAE,EAAE;YACtB,KAAK,EAAE,IAAI;YACX,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;SACnC,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { AdoptionSurvey } from '@cat-factory/contracts';
|
|
2
|
-
import type { Logger, RepoFiles } from '@cat-factory/kernel';
|
|
2
|
+
import type { Logger, MonorepoAdoptionExplorer, MonorepoAdoptionSide, MonorepoExplorationAnswer, MonorepoExplorationRequest, RepoFiles } from '@cat-factory/kernel';
|
|
3
|
+
/** The bounds a survey answers to. Overridable so a test can drive exhaustion cheaply. */
|
|
4
|
+
export interface SurveyLimits {
|
|
5
|
+
maxExplorationCalls: number;
|
|
6
|
+
maxExplorationChars: number;
|
|
7
|
+
maxSeedChars: number;
|
|
8
|
+
maxFileChars: number;
|
|
9
|
+
}
|
|
3
10
|
/** One side's reader: a bound `RepoFiles` plus the git ref to read it at. */
|
|
4
11
|
export interface SurveySide {
|
|
5
12
|
files: RepoFiles;
|
|
@@ -14,28 +21,205 @@ export interface MonorepoSurveyRequest {
|
|
|
14
21
|
/** The new service's subdirectory (e.g. `services/billing`). */
|
|
15
22
|
directory: string;
|
|
16
23
|
logger?: Logger | undefined;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
survey: AdoptionSurvey;
|
|
20
|
-
/** The read contents, keyed by the SAME prefixed path the survey and a decision's evidence use. */
|
|
21
|
-
files: Record<string, string>;
|
|
24
|
+
/** Bound overrides; the defaults are the constants above. */
|
|
25
|
+
limits?: Partial<SurveyLimits> | undefined;
|
|
22
26
|
}
|
|
23
27
|
/** The parent directory a new service's siblings live in, or `''` for a root-level service. */
|
|
24
28
|
export declare function parentDirectoryOf(directory: string): string;
|
|
25
29
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
30
|
+
* A repository-relative path the platform is willing to fetch, or the reason it will not.
|
|
31
|
+
*
|
|
32
|
+
* The path is MODEL-AUTHORED and is interpolated into the VCS contents API's URL, so it is
|
|
33
|
+
* validated for magic rather than only for traversal, and both halves of that bite:
|
|
34
|
+
*
|
|
35
|
+
* - a control character or a backslash means the model is guessing at a shell or a Windows
|
|
36
|
+
* path, and answering "not found" would tell it the repository lacks a file it never actually
|
|
37
|
+
* asked for;
|
|
38
|
+
* - `?`, `#` and `%` are the URL's own syntax, and the caller appends its `?ref=` AFTER this
|
|
39
|
+
* path. A `#` truncates the request to a DIFFERENT file while the transcript records the whole
|
|
40
|
+
* string as read, so a citation lands on the plan pointing at a path no reviewer can open; a
|
|
41
|
+
* `?ref=` of the model's own is honoured over the branch the survey believes it is reading;
|
|
42
|
+
* and a percent escape puts the traversal check below on the wrong side of the decoding the
|
|
43
|
+
* host, not this process, performs.
|
|
44
|
+
*
|
|
45
|
+
* A refusal is REPORTED (it lands on the transcript and the model is told), never a silent
|
|
46
|
+
* shortening.
|
|
47
|
+
*/
|
|
48
|
+
export declare function normalizeSurveyPath(raw: string): {
|
|
49
|
+
path: string;
|
|
50
|
+
} | {
|
|
51
|
+
refused: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* A monorepo survey in progress: the transcript, the budgets, and the reader the model widens it
|
|
55
|
+
* through.
|
|
28
56
|
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
57
|
+
* Created before the model is asked anything, seeded once, then handed to the advisor. The
|
|
58
|
+
* caller re-reads {@link survey} AFTER the advisor returns, because the transcript is what the
|
|
59
|
+
* model actually fetched rather than what the platform predicted it would need.
|
|
60
|
+
*/
|
|
61
|
+
export declare class MonorepoSurveySession implements MonorepoAdoptionExplorer {
|
|
62
|
+
private readonly request;
|
|
63
|
+
private readonly limits;
|
|
64
|
+
private readonly readers;
|
|
65
|
+
private readonly log;
|
|
66
|
+
private readonly reads;
|
|
67
|
+
private readonly bodies;
|
|
68
|
+
/**
|
|
69
|
+
* Seed bodies that were FETCHED but did not fit the opening context's reservation.
|
|
70
|
+
*
|
|
71
|
+
* Held rather than dropped: the prompt names them and tells the model to ask, so throwing the
|
|
72
|
+
* bytes away buys a second contents-API round trip for content this process is already
|
|
73
|
+
* holding. Kept OUT of {@link bodies} so nothing is citable before it has actually been served,
|
|
74
|
+
* and out of {@link seedKeys} so it stays out of the opening prompt.
|
|
75
|
+
*/
|
|
76
|
+
private readonly withheld;
|
|
77
|
+
private readonly seedKeys;
|
|
78
|
+
private siblings;
|
|
79
|
+
private calls;
|
|
80
|
+
private explorationChars;
|
|
81
|
+
private recordsDropped;
|
|
82
|
+
private exhausted;
|
|
83
|
+
constructor(request: MonorepoSurveyRequest);
|
|
84
|
+
get sides(): readonly MonorepoAdoptionSide[];
|
|
85
|
+
/** The transcript, the siblings offered, and what the exploration spent, as of right now. */
|
|
86
|
+
survey(): AdoptionSurvey;
|
|
87
|
+
/**
|
|
88
|
+
* The bodies rendered into the model's OPENING prompt.
|
|
89
|
+
*
|
|
90
|
+
* Only the seeded ones: everything the model fetches afterwards reaches it as that tool call's
|
|
91
|
+
* own result, and folding those into the prompt too would send each body twice.
|
|
92
|
+
*/
|
|
93
|
+
seedFiles(): Record<string, string>;
|
|
94
|
+
/**
|
|
95
|
+
* Record something the platform could not even attempt, so it does not read as an absence.
|
|
96
|
+
*
|
|
97
|
+
* The one caller is a reference template the workspace has not LINKED: unreadable from here
|
|
98
|
+
* even though the apply phase's container can still clone it. "The template ships nothing for
|
|
99
|
+
* this area" and "nobody looked at the template" lead a reviewer to opposite conclusions.
|
|
100
|
+
*/
|
|
101
|
+
noteUnavailable(side: MonorepoAdoptionSide, path: string, note: string): void;
|
|
102
|
+
/**
|
|
103
|
+
* Read the opening context: each side's root, the CI directory, and every sibling that looks
|
|
104
|
+
* like a service.
|
|
105
|
+
*
|
|
106
|
+
* The sibling probe is the read no root file can stand in for, and it is a LIST rather than a
|
|
107
|
+
* pick. One sibling is a sample of size one, so a monorepo with a six-year-old Java service
|
|
108
|
+
* beside three new TypeScript ones has no single house convention, and naming whichever
|
|
109
|
+
* directory sorted first reports a disagreement as though it were the answer. Dot-entries are
|
|
110
|
+
* excluded (`.github` sorts below every letter, so an alphabetical pick landed on a workflows
|
|
111
|
+
* folder for any root-level target) and a candidate qualifies only by holding a convention file
|
|
112
|
+
* of its own.
|
|
113
|
+
*/
|
|
114
|
+
seed(): Promise<void>;
|
|
115
|
+
private seedMonorepo;
|
|
116
|
+
private seedTemplate;
|
|
117
|
+
/**
|
|
118
|
+
* What BOTH sides contribute: the root listing, the conventions it holds, and its CI.
|
|
119
|
+
*
|
|
120
|
+
* Shared rather than the monorepo's alone, because `ci` is a decision BETWEEN the two sides and
|
|
121
|
+
* a seed that evidences only one of them biases it in the direction the prompt spends a
|
|
122
|
+
* paragraph forbidding: an area nothing was read about is not an area the other side wins.
|
|
123
|
+
*/
|
|
124
|
+
private seedRoot;
|
|
125
|
+
/**
|
|
126
|
+
* List a directory, recording the listing as a citable seed entry.
|
|
127
|
+
*
|
|
128
|
+
* The listing costs no extra request (it is the one the seed already needed) and it is the only
|
|
129
|
+
* evidence either side offers about source layout and module structure: no root manifest states
|
|
130
|
+
* where a service puts its code, its tests or its entry point. Without it, a `source-layout`
|
|
131
|
+
* recommendation cites nothing and is dropped upstream as invention, so `template` was the only
|
|
132
|
+
* answer the model could legitimately give for that area on every monorepo.
|
|
133
|
+
*/
|
|
134
|
+
private listInto;
|
|
135
|
+
/**
|
|
136
|
+
* A seed listing that FAILED: warned and recorded as unreadable, never skipped.
|
|
137
|
+
*
|
|
138
|
+
* Shared with the sibling probe, which is the read where skipping costs the most. "No sibling
|
|
139
|
+
* service" is the strongest claim the opening context makes about a monorepo (it tells the
|
|
140
|
+
* model there is no worked example and it tells the reviewer the survey saw root conventions
|
|
141
|
+
* only), so a probe blinded by a revoked token or a rate limit has to say so rather than
|
|
142
|
+
* produce the sentence a genuinely flat repository produces.
|
|
143
|
+
*/
|
|
144
|
+
private noteListingFailure;
|
|
145
|
+
/**
|
|
146
|
+
* The root files one side contributes: its conventions, capped in priority order, plus any
|
|
147
|
+
* single-file CI declaration.
|
|
148
|
+
*
|
|
149
|
+
* The two lists are read together but capped apart. A CI file competing for the convention cap
|
|
150
|
+
* would be crowded out by fourteen manifests on exactly the repositories whose CI is a single
|
|
151
|
+
* file, which is the `ci` area losing its only evidence to a tie-break nobody chose.
|
|
152
|
+
*/
|
|
153
|
+
private takeRootFiles;
|
|
154
|
+
/** Read a named set of files a directory actually holds, in the order they were named. */
|
|
155
|
+
private takeFiles;
|
|
156
|
+
/**
|
|
157
|
+
* List every plausible sibling service, keeping the ones that hold a convention file.
|
|
158
|
+
*
|
|
159
|
+
* Excludes the target itself and every dot-entry (which is also what keeps the CI folder out,
|
|
160
|
+
* since a listing's entries are one level deep): a directory that says nothing about how a
|
|
161
|
+
* service here is built is worse than no example, because "no sibling" is a fact the plan
|
|
162
|
+
* REPORTS while a bad sibling is one it asserts.
|
|
163
|
+
*
|
|
164
|
+
* One bounded fan-out rather than a loop of awaits, the shape {@link takeFiles} already uses:
|
|
165
|
+
* the candidate set is capped above, so six sequential round trips to the VCS host sat in the
|
|
166
|
+
* opening context's critical path for nothing.
|
|
167
|
+
*/
|
|
168
|
+
private probeSiblings;
|
|
169
|
+
/**
|
|
170
|
+
* Apply the per-side reservation to everything the seed fetched, and record the result.
|
|
171
|
+
*
|
|
172
|
+
* A body that does not fit is recorded `refused` rather than dropped, for the same reason the
|
|
173
|
+
* survey reports what it could not read: the model must not treat a file it was never shown as
|
|
174
|
+
* a file that does not exist, and the reviewer sees the same list. The BYTES are kept even so
|
|
175
|
+
* (see {@link withheld}), because the note invites the model to ask for them and re-fetching
|
|
176
|
+
* what is already in memory is a round trip for nothing. Whatever an earlier side leaves
|
|
177
|
+
* unspent carries forward, so the reservation is a floor rather than a ceiling.
|
|
178
|
+
*/
|
|
179
|
+
private commitSeed;
|
|
180
|
+
/**
|
|
181
|
+
* One model-chosen read, charged against the exploration budget.
|
|
182
|
+
*
|
|
183
|
+
* The call is counted BEFORE anything else, refusals included: a model emitting nonsense paths
|
|
184
|
+
* would otherwise loop until the step cap fired, having read nothing. Budget exhaustion is
|
|
185
|
+
* answered rather than thrown, so the model is told what it has left and can produce a plan
|
|
186
|
+
* that says which areas it ran short on, instead of the loop ending with no reply at all.
|
|
187
|
+
*/
|
|
188
|
+
explore(request: MonorepoExplorationRequest): Promise<MonorepoExplorationAnswer>;
|
|
189
|
+
private exploreList;
|
|
190
|
+
private exploreRead;
|
|
191
|
+
/** Spend a model read's characters, or refuse it because the content budget is gone. */
|
|
192
|
+
private charge;
|
|
193
|
+
/** A provider failure on a model read: recorded, and stated to the model as UNKNOWN. */
|
|
194
|
+
private fail;
|
|
195
|
+
/** A read the platform declines: recorded on the transcript, and the reason given to the model. */
|
|
196
|
+
private refuse;
|
|
197
|
+
/** Whether a path is the new service's own directory or something under it. */
|
|
198
|
+
private isInsideTarget;
|
|
199
|
+
/**
|
|
200
|
+
* Scrub at READ time, so every body is scrubbed once and nothing can reach a model through a
|
|
201
|
+
* path that forgot to. A prompt built from an unscrubbed body is strictly more exposed than the
|
|
202
|
+
* transcript, and the exploration half has no compose step a caller could scrub at.
|
|
203
|
+
*/
|
|
204
|
+
private scrub;
|
|
205
|
+
/**
|
|
206
|
+
* Append to the transcript, up to the cap.
|
|
207
|
+
*
|
|
208
|
+
* Past {@link MAX_ADOPTION_READS} the entry is COUNTED and not recorded: one model turn can emit
|
|
209
|
+
* any number of tool calls, so the array needs a bound the call budget does not give it, and
|
|
210
|
+
* that count is what states the truncation to the reviewer. The gap between `calls` and the
|
|
211
|
+
* array's length cannot: the seed adds rows without adding calls, and a call answered from what
|
|
212
|
+
* was already read adds a call without a row.
|
|
213
|
+
*/
|
|
214
|
+
private record;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Open a survey of both sides of a monorepo bootstrap and read its opening context.
|
|
35
218
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
219
|
+
* Two reads make up the monorepo half and the second is the one that matters most: the root
|
|
220
|
+
* config says what the repository declares, and the sibling services beside the target say what a
|
|
221
|
+
* service in this repository actually looks like, which is the thing a new service has to match
|
|
222
|
+
* and the thing no root file states. Everything past that is the model's to ask for.
|
|
39
223
|
*/
|
|
40
|
-
export declare function surveyMonorepo(request: MonorepoSurveyRequest): Promise<
|
|
224
|
+
export declare function surveyMonorepo(request: MonorepoSurveyRequest): Promise<MonorepoSurveySession>;
|
|
41
225
|
//# sourceMappingURL=monorepoSurvey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monorepoSurvey.d.ts","sourceRoot":"","sources":["../../../src/modules/bootstrap/monorepoSurvey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"monorepoSurvey.d.ts","sourceRoot":"","sources":["../../../src/modules/bootstrap/monorepoSurvey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqC,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE/F,OAAO,KAAK,EACV,MAAM,EACN,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC1B,SAAS,EACV,MAAM,qBAAqB,CAAA;AAiJ5B,0FAA0F;AAC1F,MAAM,WAAW,YAAY;IAC3B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,mBAAmB,EAAE,MAAM,CAAA;IAC3B,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;CACrB;AASD,6EAA6E;AAC7E,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,SAAS,CAAA;IAChB,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,8CAA8C;IAC9C,QAAQ,EAAE,UAAU,CAAA;IACpB,kFAAkF;IAClF,QAAQ,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