superbee 0.4.3-pre.10 → 0.4.3-pre.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superbee",
3
- "version": "0.4.3-pre.10",
3
+ "version": "0.4.3-pre.12",
4
4
  "type": "module",
5
5
  "description": "Agent-facing Superbee CLI for reading and writing local OKF knowledge bundles: context notes, docs, cross-links, and live bundle Views.",
6
6
  "keywords": [
@@ -0,0 +1,154 @@
1
+ # Author and test an integration
2
+
3
+ A recipe carries definitions. Its Connector names a provider, permitted hosts, a source profile,
4
+ record identities and mappings into the recipe's Kinds. Installing it does not create a connection,
5
+ read a credential, fetch a provider or schedule a run.
6
+
7
+ Authoring and recorded tests need only the public CLI and core packages. No Holaxis account or
8
+ private repository is required. Local `source bind` / `source run` use explicit private consent;
9
+ managed execution remains separate. Recorded tests never enable live execution.
10
+
11
+ ## Validate a recipe without executing it
12
+
13
+ ```sh
14
+ superbee recipe validate ./my-recipe --json
15
+ superbee recipe validate ./my-recipe --readme --json
16
+ ```
17
+
18
+ The validator uses core's recipe parser, Kind and Connector mapping checks, profile validation and
19
+ pin digest. It reports all Connector refusals with file locations and JSON pointers. Source summaries
20
+ name the shipped profile class, hosts, method, path and ownable fields. `--readme` includes a template
21
+ for the maintainer, compatibility, permissions, resource scope, support and test evidence; it does not
22
+ invent an official support commitment or managed admission.
23
+
24
+ Validation reads the selected local directory only. It never imports a module named by the recipe,
25
+ discovers a bundle, writes a document or makes a provider request. Unknown profiles are explicit
26
+ `PROFILE_NOT_AVAILABLE` refusals, not successful compatibility claims. The shipped `rest-json` and first-party `github-issues` profiles resolve through core.
27
+ An explicitly selected test double does not establish compatibility for an unavailable profile.
28
+
29
+ The complete package is checked for core's secret-shaped text, including README files; `.env` and
30
+ `.env.*` containers are refused without opening them. Output names the offending location, never the
31
+ secret value. This is a packaging tripwire, not a guarantee that arbitrary secrets can be recognized.
32
+ Keep real credentials outside the recipe. Dot-prefixed entries are refused before traversal or
33
+ opening, matching recipe acquisition. Symlinks, special files, malformed UTF-8 and inputs
34
+ beyond the documented bounds are refused. Bounds are 512 directory entries, nesting depth 12,
35
+ 2 MiB per file and 8 MiB total. Select the recipe subdirectory rather than an entire repository.
36
+
37
+ ## Replay recorded source responses
38
+
39
+ The distributed `references/integrations/rest-json-authoring/` example includes a recipe and a
40
+ passing recorded fixture for every required scenario. Copy that directory somewhere outside the
41
+ source checkout and run the two commands in its README. It needs no `--profile` executable module.
42
+
43
+ ```sh
44
+ superbee source test ./my-recipe --fixture ./fixtures/my-source --json
45
+ ```
46
+
47
+ The fixture directory contains `fixture.json`. The selected Connector and source must belong to the
48
+ recipe. Core's public source harness runs every scenario through the same observation engine,
49
+ mapping, record-overlay, conflict rules and in-memory storage that library consumers use. The CLI
50
+ does not have its own observer or mapper, and it opens no live transport.
51
+
52
+ The version-1 JSON shape is:
53
+
54
+ ```json
55
+ {
56
+ "version": 1,
57
+ "connector": "connectors/example",
58
+ "source": "items",
59
+ "feed": "source-feeds/example",
60
+ "documents": [],
61
+ "scenarios": [
62
+ {
63
+ "name": "errors.server",
64
+ "runs": [{"exchanges": [{"request": {"url": "https://api.example.org/items"}, "response": {"status": 503}}]}],
65
+ "expect": [{
66
+ "receipt": {"outcome": "provider_unavailable", "reason": null, "pages": 0, "held": 0, "pending": 0, "pass": {}, "changes": {}},
67
+ "cursor": null,
68
+ "requests": [],
69
+ "changes": [],
70
+ "findings": []
71
+ }]
72
+ }
73
+ ]
74
+ }
75
+ ```
76
+
77
+ This illustrates the shape, **not passing expected values**. Populate `documents` with the Source
78
+ Feed, its necessary conventions and any existing target documents; recipe conventions are already
79
+ included and cannot be shadowed. Supply the real expected receipt fields, requests, cursor, changes
80
+ and findings for every run. A recipe's definitions-only directory and recorded fixtures remain
81
+ separate. Expected values are compared exactly; missing expectation keys, changed receipts, unused
82
+ recorded exchanges, unscripted requests and failed core invariants fail the command.
83
+
84
+ Each exchange records the method and URL expected by the public harness and a response (`status`,
85
+ optional headers and body), `{ "fail": true }`, or `{ "hang": true }`. Runs may specify `mode`, `at`,
86
+ `edits` and a bounded engine `budget`. Fixture records can include hostile URLs and other attack
87
+ strings to test refusal. The report never echoes provider payloads, profile exception text or actual
88
+ and expected field values. Echoed scenario names must not contain secret-shaped text; invalid
89
+ presentation metadata is refused without printing its value even when attack payloads are allowed.
90
+
91
+ The report lists required and missing scenarios. Cover authentication/rate/server/malformed errors,
92
+ incomplete pages, cursor resume and hostile cursors, complete-observation disappearance, owned-field
93
+ conflicts, unmapped and null values, missing identity, redirects and undeclared hosts. A subset may
94
+ be useful during development, but missing required scenarios always makes the final command fail.
95
+ Scenarios are bounded to 64, with at most 16 runs per scenario and 512 exchanges per run.
96
+
97
+ ## Explicitly test local profile code
98
+
99
+ ```sh
100
+ superbee source test ./my-recipe --fixture ./fixtures/my-source --profile ./profile.mjs --json
101
+ ```
102
+
103
+ `--profile` deliberately imports local JavaScript. Its default export (or named `profile`) must be a
104
+ public `SourceProfile` with the same id as the declaration. The fixture may supply `spec`; otherwise
105
+ the profile receives the parsed Connector source. A scenario can override its spec to exercise
106
+ refusal cases. Core's `SourceProfile`, `runSourceScenario`, `runSourceFixture` and conformance tools
107
+ are also available directly from `@superbee/core/source-engine` and `/source-harness` in `node:test`.
108
+
109
+ **Run only code you trust.** A local extension runs in this Node process with its ordinary authority;
110
+ this is not a sandbox, and using a recorded transport does not prevent arbitrary code from using
111
+ ambient APIs. The static egress check and independent admission review lower that risk; they do not
112
+ provide isolation. Neither a fixture nor a recipe can implicitly select a module for the CLI to
113
+ execute. Validation and installation never import one.
114
+
115
+ The Work Item example reexports the shipped first-party GitHub profile. Its synthetic fixtures
116
+ qualify mapping and observation behavior; live provider access and managed catalog admission remain
117
+ separate evidence.
118
+
119
+ ## Bind and run a local Source Feed
120
+
121
+ After installing a recipe and creating its Source Feed in a local or Git bundle, preview consent:
122
+
123
+ ```sh
124
+ superbee source bind source-feeds/github --anonymous --dir ./bundle --json
125
+ superbee source bind source-feeds/github --anonymous --accept <digest-from-preview> --dir ./bundle --json
126
+ superbee source run source-feeds/github --dir ./bundle --json
127
+ ```
128
+
129
+ Binding previews make no provider request and read no credential. Acceptance pins the physical
130
+ bundle, feed, declaration/provider rules, resource, Kind/overlay policy, built-in profile/version
131
+ and budgets in private user state. A changed pin refuses before network or credential reads;
132
+ preview and accept again. Copying or moving a bundle requires a new binding. `--complete` requests
133
+ a complete pass; an interrupted pass never claims completeness.
134
+
135
+ Anonymous public GitHub reads use the same read-path/resource guard and never discover credentials.
136
+ For an explicitly authorized credentialed run, replace `--anonymous` with `--credential-env NAME`;
137
+ the binding stores only that variable name. Supply the token separately through the process
138
+ environment. Never put token values in arguments, recipes, fixtures or documents. GitHub token and
139
+ GitHub App installation-token declarations are supported; no login, token exchange or credential
140
+ discovery is performed. A 401/403 is a normal credential-refused result.
141
+
142
+ Run admits shipped built-ins only and uses bounded DNS-pinned HTTPS. It updates existing documents
143
+ linked by `sources` and existing overlay Signals; it does not create mirrored Work Items. A document
144
+ linked after a prior observation can adopt cached last-observed values on its next run, including a
145
+ 304. A held invalid provider value needs a fresh observation; it is not retained as a retry queue.
146
+ Private observation/accepted state persists with one lock and atomic envelope. A crash after a
147
+ bundle write can replay through the same conflict rules; no exactly-once cross-store transaction
148
+ is claimed. Corrupt private state refuses without reset. Summaries omit records, cursor, raw
149
+ provider errors and credential values. Neither bind nor run synchronizes or publishes a bundle.
150
+
151
+ Run receipts include fixed machine reason codes where available, never provider error text.
152
+ A terminal unsuccessful run exits nonzero after its receipt: credential refusal 4, not found 6,
153
+ guard/content/size refusal 2, and provider/runtime failure 1. Observed and deferred exit 0;
154
+ deferred retains retry metadata for continuation and does not claim a complete observation.
@@ -0,0 +1,24 @@
1
+ # Recorded REST integration authoring
2
+
3
+ This example uses a synthetic ticket board, not a live provider or a credential.
4
+
5
+ From a copy of this directory, using a CLI release that includes integration authoring:
6
+
7
+ ```sh
8
+ superbee recipe validate ./recipe --readme --json
9
+ superbee source test ./recipe --fixture ./fixture --json
10
+ ```
11
+
12
+ No checkout, account, environment variable or private source is required. The recorded fixture
13
+ exercises all required source scenarios, including hostile provider URLs. Expected values are
14
+ committed independently of the CLI run. Change one expected receipt or remove a required scenario:
15
+ the second command exits nonzero. Neither command writes to the recipe or a real bundle.
16
+
17
+ The Source Feed and Signal fixture conventions are the public source-feeds recipe definitions;
18
+ the Ticket example and recorded scenario corpus reuse the source engine's synthetic ticket board.
19
+ This tests the shipped declarative rest-json profile. It does not qualify a real provider, enable
20
+ local live execution, grant credentials or establish managed admission.
21
+
22
+ See `references/author-an-integration.md` in the CLI package (source:
23
+ `examples/references/author-an-integration.md`) for the fixture format and explicit local-code
24
+ execution boundary.