@n8r/surface 0.0.0-stage → 0.1.0-experimental.2

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 (96) hide show
  1. package/LICENSE +202 -0
  2. package/LICENSE-DOCS +395 -0
  3. package/LICENSING.md +36 -0
  4. package/README.md +181 -2
  5. package/dist/activity.d.ts +16 -0
  6. package/dist/activity.js +44 -0
  7. package/dist/cli.d.ts +2 -0
  8. package/dist/cli.js +260 -0
  9. package/dist/codec.d.ts +4 -0
  10. package/dist/codec.js +41 -0
  11. package/dist/codex.d.ts +72 -0
  12. package/dist/codex.js +510 -0
  13. package/dist/contracts.d.ts +129 -0
  14. package/dist/contracts.js +1 -0
  15. package/dist/html.d.ts +5 -0
  16. package/dist/html.js +50 -0
  17. package/dist/index.d.ts +7 -0
  18. package/dist/index.js +5 -0
  19. package/dist/notes.d.ts +52 -0
  20. package/dist/notes.js +184 -0
  21. package/dist/portable.d.ts +10 -0
  22. package/dist/portable.js +71 -0
  23. package/dist/revisions.d.ts +2 -0
  24. package/dist/revisions.js +18 -0
  25. package/dist/settings.d.ts +23 -0
  26. package/dist/settings.js +100 -0
  27. package/dist/setup.d.ts +9 -0
  28. package/dist/setup.js +161 -0
  29. package/dist/source-tools.d.ts +102 -0
  30. package/dist/source-tools.js +201 -0
  31. package/dist/startup.d.ts +7 -0
  32. package/dist/startup.js +74 -0
  33. package/dist/surface-draft.d.ts +19 -0
  34. package/dist/surface-draft.js +95 -0
  35. package/dist/surface-instructions.d.ts +2 -0
  36. package/dist/surface-instructions.js +23 -0
  37. package/dist/surface-store.d.ts +36 -0
  38. package/dist/surface-store.js +181 -0
  39. package/dist/validate.d.ts +4 -0
  40. package/dist/validate.js +184 -0
  41. package/docs/n8r-surface/README.md +133 -0
  42. package/docs/n8r-surface/codex-research-transcript.md +51 -0
  43. package/docs/n8r-surface/codex-research-verification.md +176 -0
  44. package/docs/n8r-surface/command-outcomes.md +564 -0
  45. package/docs/n8r-surface/contracts.md +210 -0
  46. package/docs/n8r-surface/critical-path.md +163 -0
  47. package/docs/n8r-surface/design.md +289 -0
  48. package/docs/n8r-surface/getting-started.md +107 -0
  49. package/docs/n8r-surface/host-contract.md +176 -0
  50. package/docs/n8r-surface/implementation-decisions.md +96 -0
  51. package/docs/n8r-surface/npm-distribution.md +137 -0
  52. package/docs/n8r-surface/npm-release.md +188 -0
  53. package/docs/n8r-surface/recreation-handoff.md +117 -0
  54. package/docs/n8r-surface/researcher-discovery.md +157 -0
  55. package/docs/n8r-surface/researcher-prepared-check.md +117 -0
  56. package/docs/n8r-surface/researcher-reconciliation-trial.md +149 -0
  57. package/docs/n8r-surface/researcher-repository-check.md +95 -0
  58. package/docs/n8r-surface/researcher-skeleton-check.md +84 -0
  59. package/docs/n8r-surface/researcher-skill-verification.md +725 -0
  60. package/docs/n8r-surface/researcher-skill.md +255 -0
  61. package/docs/n8r-surface/researcher-vault.md +134 -0
  62. package/docs/n8r-surface/save-reopen-transcript.md +211 -0
  63. package/docs/n8r-surface/save-reopen-verification.md +152 -0
  64. package/docs/n8r-surface/startup-human-check.md +172 -0
  65. package/docs/n8r-surface/startup-verification.md +161 -0
  66. package/docs/n8r-surface/startup.md +151 -0
  67. package/docs/n8r-surface/surface-revisions-transcript.md +552 -0
  68. package/docs/n8r-surface/surface-revisions-verification.md +161 -0
  69. package/docs/n8r-surface/vault-setup-verification.md +210 -0
  70. package/docs/n8r-surface/verification.md +117 -0
  71. package/docs/n8r-surface/versioning.md +183 -0
  72. package/examples/researcher/README.md +92 -0
  73. package/examples/researcher/composed.surface.json +430 -0
  74. package/examples/researcher/composed.surface.yaml +283 -0
  75. package/examples/researcher/harbor-r1.research.html +193 -0
  76. package/examples/researcher/harbor-r2.research.html +226 -0
  77. package/examples/researcher/lumen-manual-edit.pending.html +271 -0
  78. package/examples/researcher/lumen-r1.research.html +271 -0
  79. package/examples/researcher/lumen-r2.research.html +280 -0
  80. package/examples/researcher/sources/harbor-api.md +16 -0
  81. package/examples/researcher/sources/harbor-auth.md +8 -0
  82. package/examples/researcher/sources/lumen-guide.md +28 -0
  83. package/examples/researcher/sources/lumen-settings.md +9 -0
  84. package/package.json +45 -4
  85. package/plugins/n8r-surface/.codex-plugin/plugin.json +31 -0
  86. package/plugins/n8r-surface/LICENSE +202 -0
  87. package/plugins/n8r-surface/LICENSE-DOCS +395 -0
  88. package/plugins/n8r-surface/LICENSING.md +36 -0
  89. package/plugins/n8r-surface/assets/icon.svg +5 -0
  90. package/plugins/n8r-surface/plugin.json +27 -0
  91. package/plugins/n8r-surface/skills/research/SKILL.md +122 -0
  92. package/plugins/n8r-surface/skills/research/agents/openai.yaml +4 -0
  93. package/plugins/n8r-surface/skills/research/references/discovery-map.md +160 -0
  94. package/plugins/n8r-surface/skills/research/references/model-meanings.md +55 -0
  95. package/plugins/n8r-surface/skills/research/references/skeleton-surface.md +105 -0
  96. package/plugins/n8r-surface/skills/research/references/working-notes.md +116 -0
@@ -0,0 +1,176 @@
1
+ # Standalone Codex conversation: evidence and limits
2
+
3
+ Use [Install → run → check](getting-started.md) to try this increment. This record
4
+ is for maintainers; it is not a prerequisite for the human walkthrough.
5
+
6
+ ## Scope and status
7
+
8
+ Related to [#17](https://github.com/injectionator/n8r-surface/issues/17).
9
+ RESEARCH-01 implements a source conversation and follow-up. It does not complete
10
+ E2E-01, save/reopen/continue, structured output, Lab integration or distribution.
11
+ The user prioritized standalone AI, then saved continuation, then npm distribution.
12
+
13
+ **Final candidate rehearsal: Pass (agent), 5 November 2026. Human acceptance: user-reported Pass on 5 November 2026; PR #33 is confirmed
14
+ merged at `b186050`. This is the user’s report, not another agent observation.** The installed command completed both interactions from the
15
+ short guide with real `gpt-6-astra` execution: source list/read, cited findings,
16
+ and the supplied OIDC correction retained separately from guide claims.
17
+
18
+ - Code revision: [`ba6f95d`](https://github.com/injectionator/n8r-surface/commit/ba6f95dc62947c53e9ab7276e60f5b7cb4d3e17e).
19
+ - Environment: macOS arm64, Node 26.13.0, npm tarball installed into an isolated
20
+ prefix, Codex CLI 0.166.0, existing ChatGPT sign-in, explicit `gpt-6-astra`.
21
+ A separate test HOME held n8r settings; CODEX_HOME pointed to the existing Codex
22
+ installation without copying credentials. No account tier claim is inferred.
23
+ - Executed tarball SHA-256:
24
+ `c996b4085eaab0324c0f514b41d5440256ad27845675e1912aaffbd74e8179ec`.
25
+ - Starting state: one copied synthetic `lumen-guide.md`, complete configured vault,
26
+ unchanged version-1 n8r settings, no existing research output.
27
+ - Interaction: installed `n8r-surface discover <selected-source>/lumen-guide.md --model gpt-6-astra`,
28
+ accepted transmission, pasted the two prompts in the guide, then `/exit`.
29
+ The relative path in the human guide and this explicit file selection resolve
30
+ the same bytes. Exit **0**.
31
+ - [Sanitized full terminal transcript](codex-research-transcript.md) retains actual
32
+ model messages and source-call lines. The developing agent did not prewrite
33
+ findings or replace the model's investigation.
34
+ - Independent readback: source SHA-256 before and after was
35
+ `98d3374c79c166b37f0debb4ffb5e457eda1385dd7847b042cbad674cac98693`;
36
+ settings bytes were unchanged; the vault contained no research files. The
37
+ stated inference, OIDC, archive and callback facts match guide lines 8–22.
38
+ The follow-up retained non-selection of OIDC without inventing anonymous access.
39
+
40
+ The earlier directory-source rehearsal also passed before the root-identity and
41
+ turn-correlation fixes; it remains local historical evidence. The final file-scope
42
+ rehearsal above includes both fixes. Later documentation-only evidence commits do
43
+ not change the exercised implementation. Local transcripts/readback are retained
44
+ under the selected vault's `runs/` convention; no local vault path is published.
45
+
46
+ ## Architecture
47
+
48
+ The TypeScript terminal client launches the installed Codex app-server over local
49
+ stdio. It uses the existing ChatGPT sign-in, checks account type, and requires the
50
+ configured model or explicit `--model` choice. It rejects custom providers/endpoints
51
+ and never falls back to API keys or another model. No credential bytes are read,
52
+ copied into settings or printed by this adapter. Codex retains ownership of its
53
+ authentication, caches and diagnostics.
54
+
55
+ The adapter is pinned to **Codex CLI 0.166.0**. Protocol interfaces were generated
56
+ from that exact installed executable with:
57
+
58
+ ```sh
59
+ codex app-server generate-ts --experimental --out /tmp/n8r-protocol
60
+ ```
61
+
62
+ It uses `initialize`/`initialized`, `account/read`, `config/read`, `thread/start`,
63
+ `turn/start`, `item/tool/call`, turn/item notifications and `turn/interrupt`.
64
+ Experimental dynamic tools and permissions require the initialization capability.
65
+ See the official [app-server protocol](https://developers.openai.com/codex/app-server)
66
+ and [permission profiles](https://learn.chatgpt.com/docs/permissions).
67
+ Future CLI versions must be checked deliberately before broadening the pin.
68
+
69
+ One ephemeral thread holds successive turns. The CLI has no reopen interface and
70
+ produces no research artefact. It prints completed agent messages as they arrive,
71
+ not token-by-token deltas. Requests have a 45-second response deadline; a turn has
72
+ a ten-minute limit. Ctrl-C requests interruption, closes the owned process and
73
+ exits 130; EOF during an answer exits 1 and marks it incomplete. EOF at the prompt
74
+ or `/exit` exits 0. Failed turns exit 2, including failure after partial output.
75
+ A stale event/callback cannot complete or read for a newer turn.
76
+
77
+ ### Shared instructions
78
+
79
+ The npm tarball contains the canonical plugin manifest, Researcher `SKILL.md` and
80
+ all four reference documents without rewriting them. Version **0.1.8**, combined
81
+ SHA-256 **`8af29c3073df9b8210a7dd94ced9700379b0a98f76bd3a2902f9430b93c98a2a`**.
82
+ The digest hashes, in fixed order, each relative path, NUL, original bytes, NUL.
83
+ The adapter appends host limits: source inspection only, evidence citations,
84
+ human corrections separate from source claims, and no save capability.
85
+ Installed-package checks independently load the bundle outside the checkout and
86
+ compare this digest. This is instruction loading evidence, not universal proof
87
+ that a model follows every instruction.
88
+
89
+ ### Source capability and permissions
90
+
91
+ The model chooses `source_list`, `source_search` and `source_read` calls. The host
92
+ returns real evidence, not developer-authored findings. A directory or single file
93
+ is explicitly selected and displayed before authorization. File-only access cannot
94
+ read siblings. Paths are relative; traversal, absolute paths, control characters,
95
+ backslashes, descendant symlinks and special files are rejected. The host checks
96
+ canonical root identity and ancestry on every operation, including between turns.
97
+ Directory topology must remain stable during each operation: these Node filesystem
98
+ checks are not an adversarial concurrent-filesystem transaction.
99
+
100
+ Hidden entries, `node_modules`, `vendor`, `dist`, and key/certificate containers
101
+ are excluded. This is not a general secret detector; choose sources permitted for
102
+ transmission. UTF-8 files are bounded to 256 KiB. Reads return up to 200 lines and
103
+ 32 Ki characters, with full-file byte digest, timestamp and truncation status.
104
+ Search is literal and case-sensitive, bounded to 100 files, roughly 8 MiB of
105
+ source bytes (one final file may cross the threshold), 1,000 entries, depth 32 and
106
+ 100 matching lines. Listings expose exclusions and truncation. Missing coverage
107
+ never proves absence. No source code is executed.
108
+
109
+ Codex receives an empty execution-environment list, no runtime workspace roots,
110
+ a read-only/no-network permission profile, and no approval escalation. The
111
+ adapter disables configured MCP servers, apps, plugins, hooks, shell, browser and
112
+ other unrelated facilities, suppresses automatic source instructions and memories,
113
+ and does not inherit API keys or desktop-internal task channels. A pre-existing
114
+ profile with the adapter's reserved name is rejected instead of merged. Unknown
115
+ server requests fail closed; source callbacks require the active thread and turn.
116
+
117
+ Codex can still describe generic native tool names in its model-visible catalogue.
118
+ A separate synthetic PNG boundary probe on 0.166.0 attempted native `view_image`
119
+ and reported **“No usable execution environment is available.”** No image read
120
+ was established. This supports the empty-environment boundary for that attempt;
121
+ it is not comprehensive OS sandbox certification or proof for every future tool.
122
+ The host source-path checks have separate deterministic regression tests.
123
+
124
+ ## Baseline and prerequisite investigation
125
+
126
+ The original installed `discover` invocation exited 2 with the bare-startup-only
127
+ message. Codex 0.139.0 reported ChatGPT sign-in but rejected `gpt-6-astra` as needing
128
+ a newer client. Its model list offered `gpt-5.5`; the user explicitly selected it,
129
+ but inference rejected it for ChatGPT sign-in. Neither result proves inference.
130
+
131
+ The user then authorized a CLI update and retry of `gpt-6-astra`. `codex update`
132
+ installed 0.166.0 in the active Node 26 global prefix. The original standalone
133
+ installation in the other prefix was then explicitly updated to the same 0.166.0;
134
+ both reported that version and retained ChatGPT sign-in. The command checks
135
+ whichever `codex` is on its PATH.
136
+ Existing sign-in was reused; the saved model setting was not changed.
137
+
138
+ `codex exec` and then app-server both completed real `gpt-6-astra` responses.
139
+ During protocol exploration, defining a named permission profile without its
140
+ required `default_permissions` caused a late workspace-requirements error.
141
+ Supplying both resolved it; the regression checks require the complete profile.
142
+ No managed requirement was disabled or bypassed.
143
+
144
+ ## Automated verification
145
+
146
+ Final implementation: 89 Node tests passed on each of Node 22.23.2, 24.22.2 and
147
+ 26.13.0, including offline terminal cases
148
+ for confirmation refusal (no Codex launch), API-key rejection, same-thread turns,
149
+ out-of-scope tool calls, failed answers, stale events/callbacks, malformed identity,
150
+ authentication changes, EOF, and cancellation during connection and an active turn.
151
+ The terminal fixture is explicitly scripted and is **not real AI evidence**.
152
+ It verifies process behavior, source/settings bytes and child cleanup.
153
+
154
+ Additional checks passed:
155
+
156
+ - Installed-package check on all three Node majors: library exports, all bundled
157
+ Researcher references/digest, startup terminal/readback and 13 offline discovery
158
+ terminal cases. Runtime dependency metadata was cached with `npm cache add yaml@2.9.1`.
159
+ - `bash -n scripts/flow`; Python unittest discovery: 24 tests, including JSON
160
+ syntax and applicable synthetic identifier/reference checks.
161
+ - Markdownlint 0.24.0: 57 files, zero issues after transcript addition.
162
+ - Lychee 0.24.2 offline with fragments: 410 links, zero errors after transcript addition.
163
+ - cffconvert 2.0.0: citation metadata valid; `git diff --check`: clean.
164
+
165
+ Documentation checks were repeated after recording the transcript. External link
166
+ requests and registry publication were not part of these checks. Fixture integrity
167
+ is not model conformance. Automated rehearsal does not replace human acceptance.
168
+
169
+ ## Remaining acceptance
170
+
171
+ - Conversation-only human check: user reported Pass; saved continuation has its
172
+ own [verification record](save-reopen-verification.md).
173
+ - Save/readback, fresh-session continuation, preserved decisions and identities.
174
+ - Validated HTML/JSON/YAML, broader products and the complete E2E-01/E2E-02 cases.
175
+ - Live UI/API observations and later named Lab consumer verification.
176
+ - Registry distribution under #27, separately authorized.