@abubakarsiddiik/compiler 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +207 -2
  3. package/dist/bootstrap.d.ts +45 -0
  4. package/dist/bootstrap.d.ts.map +1 -0
  5. package/dist/bootstrap.js +153 -0
  6. package/dist/bootstrap.js.map +1 -0
  7. package/dist/compile.d.ts +41 -0
  8. package/dist/compile.d.ts.map +1 -0
  9. package/dist/compile.js +126 -0
  10. package/dist/compile.js.map +1 -0
  11. package/dist/http.d.ts +28 -0
  12. package/dist/http.d.ts.map +1 -0
  13. package/dist/http.js +176 -0
  14. package/dist/http.js.map +1 -0
  15. package/dist/index.d.ts +13 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +13 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/lift.d.ts +27 -0
  20. package/dist/lift.d.ts.map +1 -0
  21. package/dist/lift.js +72 -0
  22. package/dist/lift.js.map +1 -0
  23. package/dist/parameterize.d.ts +57 -0
  24. package/dist/parameterize.d.ts.map +1 -0
  25. package/dist/parameterize.js +330 -0
  26. package/dist/parameterize.js.map +1 -0
  27. package/dist/publish.d.ts +45 -0
  28. package/dist/publish.d.ts.map +1 -0
  29. package/dist/publish.js +89 -0
  30. package/dist/publish.js.map +1 -0
  31. package/dist/repair-loop.d.ts +51 -0
  32. package/dist/repair-loop.d.ts.map +1 -0
  33. package/dist/repair-loop.js +96 -0
  34. package/dist/repair-loop.js.map +1 -0
  35. package/dist/repair.d.ts +68 -0
  36. package/dist/repair.d.ts.map +1 -0
  37. package/dist/repair.js +235 -0
  38. package/dist/repair.js.map +1 -0
  39. package/dist/returns.d.ts +45 -0
  40. package/dist/returns.d.ts.map +1 -0
  41. package/dist/returns.js +444 -0
  42. package/dist/returns.js.map +1 -0
  43. package/dist/segment.d.ts +70 -0
  44. package/dist/segment.d.ts.map +1 -0
  45. package/dist/segment.js +195 -0
  46. package/dist/segment.js.map +1 -0
  47. package/dist/ui.d.ts +21 -0
  48. package/dist/ui.d.ts.map +1 -0
  49. package/dist/ui.js +46 -0
  50. package/dist/ui.js.map +1 -0
  51. package/dist/verify.d.ts +51 -0
  52. package/dist/verify.d.ts.map +1 -0
  53. package/dist/verify.js +207 -0
  54. package/dist/verify.js.map +1 -0
  55. package/package.json +41 -3
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,208 @@
1
- # Temporary Holding Version
1
+ # @abubakarsiddiik/compiler
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ From traces to verified ops. The compiler starts with the repair agent, because
4
+ the first traces come from finishing an intent that no op could serve.
5
+
6
+ ## Repair agent
7
+
8
+ `repairIntent` completes one intent with the substrate verbs and a model over
9
+ `ModelPort`:
10
+
11
+ ```ts
12
+ const result = await repairIntent({
13
+ model,
14
+ substrate,
15
+ goal: "Search the catalog for socks and open the Merino Socks product page.",
16
+ effect: "read",
17
+ maxSteps: 12,
18
+ check: async (view) => isOnProductPage(view),
19
+ });
20
+ ```
21
+
22
+ The loop:
23
+
24
+ 1. `view` captures the page and ranks affordances with refs.
25
+ 2. The model returns one `act`, `view`, `read`, or `done`.
26
+ 3. `act` resolves the ref, dispatches, and records effects and a delta.
27
+ 4. `done` is accepted only when the optional `check` agrees.
28
+
29
+ The result carries the same `Trace` shape as a fallback scope: every view, act,
30
+ and read, with the locator, value, document and mutation counters, URL, state
31
+ before and after, effects, and delta. The compiler can treat a headless repair
32
+ exactly like a recorded run.
33
+
34
+ A failed act is fed back to the model but not recorded: a stale ref is a retry,
35
+ not a step in the intent.
36
+
37
+ ## Segmenter
38
+
39
+ `segmentTrace(trace, map)` cuts a run at state and URL changes, then merges
40
+ pieces that belong to one op according to the map's `from`/`to` sets:
41
+
42
+ - **Store:** the five UI pieces map to `search`, `get_product`, `add_to_cart`,
43
+ `open_checkout`, and `checkout`.
44
+ - **Wizard:** three step changes merge into one `submit_application`, because
45
+ that op runs from `step1` to `done`.
46
+ - **Portal:** login and a same-state filter stay separate; the filter changes
47
+ the URL even though the state stays `invoices`.
48
+
49
+ A candidate is only chosen when the from/to match is unique. When several ops
50
+ share the same boundaries, the segment is marked ambiguous and left for the
51
+ model.
52
+
53
+ `labelSegments({ model, map, segments })` asks the model once for a label per
54
+ segment: `reuse` an existing op, `extend` one, or `propose` a new one. The
55
+ deterministic candidate is a hint, not an answer.
56
+
57
+ ## Parameterizer
58
+
59
+ `parameterizeTrace({ trace, params?, labels? }, map)` turns a segment into
60
+ params and constants:
61
+
62
+ - **A segment that matches an op** is parameterized against that op's
63
+ signature. A typed value that fills a named param becomes a param; so does a
64
+ URL path or query piece. Everything else stays a constant.
65
+ - **A segment with no op** is parameterized by its label and the task values.
66
+ - **`parameterizeTraces(inputs, map)`** diffs several traces of the same op. A
67
+ value that changes between runs becomes a param, even when the first pass
68
+ called it a constant.
69
+
70
+ The result carries `params`, `constants`, `missing` (required op params no
71
+ binding covered), and an inferred JSON Schema.
72
+
73
+ On the dev fixtures, the store's five ops and the portal's two ops match their
74
+ oracle signatures exactly. The wizard reports `file_path` as missing, because
75
+ the substrate cannot upload yet.
76
+
77
+ ## Returns inference
78
+
79
+ `inferReturns(view)` reads the post-state and builds an extractor plus a JSON
80
+ Schema:
81
+
82
+ - **Rows first.** A repeated test id inside a table or grid is stronger
83
+ evidence than a handful of scalar nodes. Table columns come from the header
84
+ row; a `data-*` attribute on a cell is carried into the locator. Card rows
85
+ group their descendants by role.
86
+ - **Fields next.** A node with a stable test id and a value becomes a field,
87
+ e.g. `order-id` -> `order_id`.
88
+ - **None last.** A page with no data region returns `{ kind: "none" }`.
89
+
90
+ The inferred extractor is run against the same view before it is returned, so
91
+ an inference that does not extract is discarded.
92
+
93
+ `validateInferredReturns(inferred, view)` extracts and validates against the
94
+ schema. On the fixtures, store search rows and portal filter rows validate on
95
+ a held-back run with different data.
96
+
97
+ `nameReturns({ model, inferred })` asks the model to rename the keys. Names
98
+ must be unique snake_case and must exist in the inference; anything else is
99
+ rejected.
100
+
101
+ ## URL lift
102
+
103
+ `liftUrl({ segment, returns })` builds a route from the post-state URL:
104
+
105
+ - A query value or path segment that equals a bound param becomes `{name}`.
106
+ - Empty query params are dropped, so a filter form's `q=` and `category=` do
107
+ not end up in the route.
108
+ - A segment whose params never appear in the URL does not lift.
109
+
110
+ `withUrlLift(op, lift, returns)` replaces the op's `url` impl with the lifted
111
+ route and extractor. The store search lifts to `/search?q={query}` and the
112
+ portal filter to `/?status={status}`; both are run with a new param in the
113
+ bench test, not just compared as strings.
114
+
115
+ ## HTTP lift
116
+
117
+ `liftHttp({ segment, returns, outcomeCheck })` rebuilds the non-GET requests
118
+ the trace captured:
119
+
120
+ - **Every 2xx write request** becomes a step with the same method, path, and
121
+ body.
122
+ - **A bound param's value** becomes `{name}` in the URL and body.
123
+ - **A value from an earlier response that appears in a later request** becomes
124
+ a `bind`, so a token or id can reach the next step.
125
+
126
+ `withHttpLift(op, lift, returns, outcomeCheck)` replaces the op's `http` impl
127
+ and records the check. The store add-to-cart lifts to
128
+ `POST /api/cart/items` with `view_cart` as `outcome_check`. The bench test
129
+ sends the request, loses the response, reconciles with `view_cart`, and
130
+ asserts the cart still has one item and the executor ran once.
131
+
132
+ ## Verifier
133
+
134
+ `verifyOp({ map, op, paramSets, baseUrl })` runs every impl of an op on a
135
+ fresh browser context per param set:
136
+
137
+ - **At least three param sets.** Fewer is rejected before a browser starts.
138
+ - **Params are validated** against the op's schema.
139
+ - **The tier runs**: `url`, `http`, or `ui`. The `http` tier's post checks run
140
+ against the page after the fetch, because a fetch does not navigate.
141
+ - **An `outcome_check`** runs after a write and must succeed.
142
+ - **The report is per impl**: each run's params, result, state, URL, and
143
+ failure message. An op is verified when at least one impl passes every set.
144
+
145
+ On the fixtures, store search verifies on three fresh sessions, a wrong post
146
+ state is rejected with the run that broke, and a lifted `http` add-to-cart
147
+ verifies on three fresh carts with `view_cart` as its outcome check.
148
+
149
+ ## Publisher
150
+
151
+ `publishMap({ dir, map, candidates })` writes the next `v<n>.json`:
152
+
153
+ - **A verified candidate** replaces an op of the same name or adds a new one.
154
+ - **An unverified candidate** is rejected and never written.
155
+ - **An irreversible op without `reviewed: true`** is held: it goes to
156
+ `review/v<n>.json` and does not enter the map.
157
+ - **`compiled_from`** records only the traces that reached the map;
158
+ `verified_at` is the publish time.
159
+
160
+ The new map is parsed with the same loader the runtime uses before it is
161
+ written, so the publisher cannot create a map the server will reject. The
162
+ result carries the version, path, map, diff, and review path.
163
+
164
+ ## UI lift
165
+
166
+ A segment with no cheaper tier lifts to a `ui` program. The trace already
167
+ carries the semantic locator of every action, so the steps are those actions
168
+ with bound values replaced by `{name}` placeholders. A file input is a `fill`
169
+ with a path; the engine turns that into `DOM.setFileInputFiles`.
170
+
171
+ The wizard's `submit_application` compiles this way and verifies on three fresh
172
+ sessions with the attachment. The parameterizer maps the attachment label to
173
+ `file_path`.
174
+
175
+ ## Repair loop
176
+
177
+ `repairOp({ map, op, intent, params, paramSets, repair, capture, dir })` repairs
178
+ one degraded op without a hand edit:
179
+
180
+ 1. **The repair run** finishes the op's intent with the substrate and returns
181
+ its trace.
182
+ 2. **The last segment** is labelled with the broken op; earlier segments are
183
+ labelled from their candidate, so a login setup stays a setup.
184
+ 3. **The compiler** turns the segment into a candidate, using the cheaper tier
185
+ the trace supports.
186
+ 4. **The verifier** runs it on fresh sessions with every param set.
187
+ 5. **The publisher** writes the next map version.
188
+
189
+ `post` can override the op's post checks when the route moved with the drift;
190
+ the v2 store search does that. An irreversible repair verifies but is held for
191
+ review, not published.
192
+
193
+ On the v2 store, the loop repairs `search` to `/catalog?q={query}` and
194
+ `add_to_cart` to an `http` POST with `view_cart` as its outcome check, then
195
+ publishes v2 and v3.
196
+
197
+ ## Local models
198
+
199
+ The repair role is provider-agnostic. Any OpenAI-compatible endpoint works:
200
+
201
+ ```sh
202
+ PORTOLAN_LOCAL_BASE_URL=http://127.0.0.1:11434/v1 \
203
+ PORTOLAN_LOCAL_MODEL=qwen2.5:7b-instruct \
204
+ pnpm vitest run bench/repair/repair.test.ts
205
+ ```
206
+
207
+ Without those variables the live test skips and the scripted test still proves
208
+ the loop.
@@ -0,0 +1,45 @@
1
+ import type { SiteMap } from "@abubakarsiddiik/protocol";
2
+ import type { Trace } from "@abubakarsiddiik/runtime";
3
+ import type { SubstrateView } from "@abubakarsiddiik/substrate";
4
+ import { type CompiledCandidate } from "./compile.js";
5
+ import { type SegmentLabel, type TraceSegment } from "./segment.js";
6
+ export type BootstrapOptions = {
7
+ site: string;
8
+ origins: string[];
9
+ traces: Trace[];
10
+ /**
11
+ * One label list per trace. When omitted, names are derived deterministically
12
+ * from the recorded actions, so a site can be bootstrapped without a model.
13
+ */
14
+ labels?: SegmentLabel[][];
15
+ capture?: (url: string) => Promise<SubstrateView | undefined>;
16
+ outcomeChecks?: Record<string, string>;
17
+ /** Default true: a recorded write becomes a task, not an unverifiable http op. */
18
+ skipWritesWithoutOutcomeCheck?: boolean;
19
+ };
20
+ export type BootstrapResult = {
21
+ /** A v1 candidate map. It is not verified and must not be served as-is. */
22
+ map: SiteMap;
23
+ candidates: CompiledCandidate[];
24
+ labels: SegmentLabel[][];
25
+ };
26
+ /**
27
+ * A map skeleton with no ops.
28
+ *
29
+ * `root` has no URL or marks, so it matches whatever page the session is on.
30
+ * That is the honest state model for a mapless trace: we know the actions, not
31
+ * the landmarks. Version 0 is a placeholder; `publishMap` derives v1 from it.
32
+ */
33
+ export declare function bootstrapMap(site: string, origins: string[]): SiteMap;
34
+ /**
35
+ * Compile recorded runs into a first map without a hand-written base map.
36
+ *
37
+ * The compiler always needed an oracle map to name ops. Bootstrap supplies
38
+ * names from the trace itself (an action label, then the URL), which is enough
39
+ * for the verification step to accept or reject the candidate.
40
+ */
41
+ export declare function bootstrapFromTraces(options: BootstrapOptions): Promise<BootstrapResult>;
42
+ /** Name every segment of every trace, keeping names unique across the site. */
43
+ export declare function labelTraces(traces: Trace[], map: SiteMap): SegmentLabel[][];
44
+ export declare function nameFromSegment(segment: TraceSegment): string;
45
+ //# sourceMappingURL=bootstrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,KAAK,iBAAiB,EAAwC,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAE,KAAK,YAAY,EAAgB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAElF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,YAAY,EAAE,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,kFAAkF;IAClF,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,2EAA2E;IAC3E,GAAG,EAAE,OAAO,CAAC;IACb,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAChC,MAAM,EAAE,YAAY,EAAE,EAAE,CAAC;CAC1B,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAWrE;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC,CAmC7F;AAED,+EAA+E;AAC/E,wBAAgB,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,OAAO,GAAG,YAAY,EAAE,EAAE,CAe3E;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAqB7D"}
@@ -0,0 +1,153 @@
1
+ import { compileCandidates } from "./compile.js";
2
+ import { segmentTrace } from "./segment.js";
3
+ /**
4
+ * A map skeleton with no ops.
5
+ *
6
+ * `root` has no URL or marks, so it matches whatever page the session is on.
7
+ * That is the honest state model for a mapless trace: we know the actions, not
8
+ * the landmarks. Version 0 is a placeholder; `publishMap` derives v1 from it.
9
+ */
10
+ export function bootstrapMap(site, origins) {
11
+ return {
12
+ site,
13
+ origins,
14
+ version: 0,
15
+ states: [{ id: "root", marks: [] }],
16
+ ops: [],
17
+ entities: {},
18
+ compiled_from: [],
19
+ verified_at: new Date(0).toISOString(),
20
+ };
21
+ }
22
+ /**
23
+ * Compile recorded runs into a first map without a hand-written base map.
24
+ *
25
+ * The compiler always needed an oracle map to name ops. Bootstrap supplies
26
+ * names from the trace itself (an action label, then the URL), which is enough
27
+ * for the verification step to accept or reject the candidate.
28
+ */
29
+ export async function bootstrapFromTraces(options) {
30
+ const seed = bootstrapMap(options.site, options.origins);
31
+ const labels = options.labels ?? labelTraces(options.traces, seed);
32
+ const capture = options.capture ?? (async () => undefined);
33
+ const traces = options.traces.map((trace, index) => ({
34
+ trace,
35
+ labels: labels[index] ?? [],
36
+ ...(trace.scope_id.length > 0 ? { source: trace.scope_id } : {}),
37
+ }));
38
+ const candidates = await compileCandidates({
39
+ map: seed,
40
+ traces,
41
+ capture,
42
+ ...(options.outcomeChecks !== undefined ? { outcomeChecks: options.outcomeChecks } : {}),
43
+ skipWritesWithoutOutcomeCheck: options.skipWritesWithoutOutcomeCheck ?? true,
44
+ });
45
+ for (const candidate of candidates) {
46
+ candidate.op.from = candidate.op.from.map((id) => (id === "unknown" ? "root" : id));
47
+ candidate.op.to = candidate.op.to.map((id) => (id === "unknown" ? "root" : id));
48
+ }
49
+ return {
50
+ map: {
51
+ ...seed,
52
+ version: 1,
53
+ ops: candidates.map((candidate) => candidate.op),
54
+ compiled_from: [...new Set(options.traces.map((trace) => trace.scope_id))],
55
+ verified_at: new Date().toISOString(),
56
+ },
57
+ candidates,
58
+ labels,
59
+ };
60
+ }
61
+ /** Name every segment of every trace, keeping names unique across the site. */
62
+ export function labelTraces(traces, map) {
63
+ const used = new Set();
64
+ return traces.map((trace) => segmentTrace(trace, map).map((segment) => {
65
+ const name = uniqueName(nameFromSegment(segment), used);
66
+ return {
67
+ index: segment.index,
68
+ action: "propose",
69
+ name,
70
+ summary: summaryFromSegment(segment),
71
+ reason: "derived from the recorded run",
72
+ };
73
+ }));
74
+ }
75
+ export function nameFromSegment(segment) {
76
+ // A button or link names the intent ("Search", "Add to cart"); a field name
77
+ // alone is usually just the noun. Prefer the last click, then a field.
78
+ const clicks = segment.actions.filter((action) => action.do === "click");
79
+ for (const action of clicks.reverse()) {
80
+ const label = action.locator?.name;
81
+ if (label !== undefined && opName(label) !== "op")
82
+ return opName(label);
83
+ }
84
+ for (const action of segment.actions) {
85
+ if (action.do !== "fill" && action.do !== "select")
86
+ continue;
87
+ const label = action.locator?.name;
88
+ if (label !== undefined)
89
+ return opName(label);
90
+ }
91
+ for (const action of segment.actions) {
92
+ const label = action.locator?.name;
93
+ if (label !== undefined)
94
+ return opName(label);
95
+ }
96
+ return opName(pathLabel(segment.url)) || "op";
97
+ }
98
+ function summaryFromSegment(segment) {
99
+ const steps = [];
100
+ for (const action of segment.actions) {
101
+ const target = action.locator?.name;
102
+ if (action.do === "fill" || action.do === "select") {
103
+ steps.push(target === undefined ? action.do : `${action.do} ${target}`);
104
+ }
105
+ else if (action.do === "click") {
106
+ steps.push(target === undefined ? "click" : `click ${target}`);
107
+ }
108
+ else {
109
+ steps.push(action.do);
110
+ }
111
+ }
112
+ if (steps.length === 0) {
113
+ return segment.url === undefined ? "Recorded operation." : `Open ${pathLabel(segment.url)}.`;
114
+ }
115
+ const summary = `Recorded: ${steps.join(", ")}.`;
116
+ return summary.length <= 200 ? summary : `${summary.slice(0, 197)}...`;
117
+ }
118
+ function pathLabel(url) {
119
+ if (url === undefined)
120
+ return "op";
121
+ try {
122
+ const parsed = new URL(url, "http://portolan.local");
123
+ const parts = parsed.pathname.split("/").filter((part) => part.length > 0);
124
+ const last = parts.at(-1);
125
+ if (last === undefined)
126
+ return "home";
127
+ return decodeURIComponent(last);
128
+ }
129
+ catch {
130
+ return "op";
131
+ }
132
+ }
133
+ function opName(label) {
134
+ const normalized = label
135
+ .toLowerCase()
136
+ .replace(/[^a-z0-9]+/g, "_")
137
+ .replace(/^_+|_+$/g, "");
138
+ if (normalized.length === 0)
139
+ return "op";
140
+ return /^[a-z]/.test(normalized) ? normalized : `op_${normalized}`;
141
+ }
142
+ function uniqueName(name, used) {
143
+ let candidate = name.slice(0, 64);
144
+ let suffix = 2;
145
+ while (used.has(candidate)) {
146
+ const tail = `_${suffix}`;
147
+ candidate = `${name.slice(0, 64 - tail.length)}${tail}`;
148
+ suffix += 1;
149
+ }
150
+ used.add(candidate);
151
+ return candidate;
152
+ }
153
+ //# sourceMappingURL=bootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAIA,OAAO,EAA6C,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC5F,OAAO,EAAqB,YAAY,EAAqB,MAAM,cAAc,CAAC;AAwBlF;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,OAAiB;IAC1D,OAAO;QACL,IAAI;QACJ,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AI,MAAM,EAAE,CAAC;QAC1B,SAAS,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;QACxD,MAAM,IAAI,CAAC,CAAC;IACd,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACpB,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,41 @@
1
+ import type { Extractor, OpDef, SiteMap } from "@abubakarsiddiik/protocol";
2
+ import type { Trace } from "@abubakarsiddiik/runtime";
3
+ import type { SubstrateView } from "@abubakarsiddiik/substrate";
4
+ import { type ParameterizedSegment } from "./parameterize.js";
5
+ import type { SegmentLabel } from "./segment.js";
6
+ export type CompileTrace = {
7
+ trace: Trace;
8
+ labels?: SegmentLabel[];
9
+ source?: string;
10
+ };
11
+ export type CompileOptions = {
12
+ map: SiteMap;
13
+ traces: CompileTrace[];
14
+ /** Capture the post-state of a url segment. Return undefined if it is gone. */
15
+ capture: (url: string) => Promise<SubstrateView | undefined>;
16
+ /** Read op that proves a write, keyed by op name. */
17
+ outcomeChecks?: Record<string, string>;
18
+ /**
19
+ * Drop a write that has no outcome check instead of compiling an http impl
20
+ * the map loader would reject. Bootstrap uses this: a recording proves the
21
+ * request happened, not how to check that a later write took effect.
22
+ */
23
+ skipWritesWithoutOutcomeCheck?: boolean;
24
+ };
25
+ export type CompiledCandidate = {
26
+ op: OpDef;
27
+ segment: ParameterizedSegment;
28
+ tier: "url" | "http" | "ui";
29
+ source?: string;
30
+ };
31
+ /**
32
+ * Compile traces into candidate ops.
33
+ *
34
+ * A segment with a successful non-GET request lifts to `http`; otherwise a
35
+ * segment with a URL lifts to `url`. The candidate keeps the oracle op's
36
+ * params, from/to, and effect when the map already names it, and takes its
37
+ * returns from the response body or the captured post-state.
38
+ */
39
+ export declare function compileCandidates(options: CompileOptions): Promise<CompiledCandidate[]>;
40
+ export type { Extractor };
41
+ //# sourceMappingURL=compile.d.ts.map