@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,149 @@
1
+ # Controlled LibreChat declaration reconciliation
2
+
3
+ This procedure tests whether the installed Researcher can find a graph-relevant
4
+ configuration difference, preserve prior research and distinguish declarations
5
+ from runtime evidence. It uses **Markdown research**, not validated Surface JSON.
6
+ The configuration fixture is synthetic; the inspected implementation is actual
7
+ LibreChat source. No target application or service is changed or started.
8
+
9
+ ## Teammate checklist
10
+
11
+ For a first check with the skill already installed, start in the
12
+ [local vault guide](researcher-vault.md). It contains a prepared fictional
13
+ example and a walkthrough for investigating another chat-system repository.
14
+ Each run keeps its working files and saved notes under `runs/` in the selected vault.
15
+
16
+ This page retains the deeper **LibreChat source** trial. Its recorded evidence
17
+ applies to the source revision below, not to the vault's fictional example.
18
+
19
+ ## Preparation for the LibreChat trial
20
+
21
+ Use an installed skill, a permitted LibreChat checkout and a fresh test folder.
22
+ The first shell block below creates the three configuration input files. Keep
23
+ expected results outside Researcher's source folder, and record versions and
24
+ file-preservation checks alongside the saved outputs. The earlier agent rehearsal
25
+ and hashes are in the [verification record](researcher-skill-verification.md#controlled-declaration-trial-014).
26
+ Human acceptance remains separate from that rehearsal.
27
+
28
+ ## State X and expected outcome
29
+
30
+ Prerequisites: the [installed skill](researcher-skill.md), persistent local files,
31
+ Python 3, and a permitted LibreChat checkout. The exercised source revision was
32
+ `e1dfc10449ff713faffacd60273fddcfe2c0a698`. Identify any other revision and recheck
33
+ its semantics before using the same expectation. Existing private/dirty files
34
+ remain excluded. Prior graph research may be supplied, with its scope preserved.
35
+
36
+ The selected trial composition is `trial:librechat-rag-declaration`. Its initial
37
+ partial file explicitly sets `RAG_API_URL=`. The sole changed value becomes
38
+ `https://rag.example.test`. Both are declarations that are never loaded into a
39
+ process. Other settings and deployment overrides remain unknown.
40
+
41
+ The expected graph difference is a declared target for the existing RAG role.
42
+ Product support stays unchanged. Neither the empty value nor the example URL
43
+ establishes deployed enablement, reachability, embedding or successful retrieval.
44
+ Keep this expectation separate from the Researcher's task input.
45
+
46
+ The source documents the key in
47
+ [`.env.example`](https://github.com/LibreChat-AI/LibreChat/blob/e1dfc10449ff713faffacd60273fddcfe2c0a698/.env.example#L802-L814).
48
+ The [file-processing implementation](https://github.com/LibreChat-AI/LibreChat/blob/e1dfc10449ff713faffacd60273fddcfe2c0a698/api/server/services/Files/VectorDB/crud.js#L20-L95)
49
+ checks the URL before requests and uses it for `/embed` and `/documents` operations.
50
+ These are source claims at that revision, not observed application calls.
51
+
52
+ ## Baseline, change and readback
53
+
54
+ From the **LibreChat checkout root**, record identity and prepare a disposable
55
+ input folder. Commands below do not load the environment files or contact a URL.
56
+
57
+ ```sh
58
+ git rev-parse HEAD
59
+ git status --short
60
+ codex --version
61
+ codex plugin list --marketplace n8r-surface --json
62
+ trial_dir=$(mktemp -d "${TMPDIR:-/tmp}/n8r-rag-trial.XXXXXX")
63
+ python3 - "$trial_dir" <<'PY'
64
+ from pathlib import Path
65
+ import sys
66
+ root = Path(sys.argv[1])
67
+ text = '# Task-owned partial LibreChat declaration; never loaded into a process.\nRAG_API_URL=\n'
68
+ (root / 'baseline.env').write_text(text)
69
+ (root / 'current.env').write_text(text)
70
+ (root / 'scope.md').write_text(
71
+ 'Composition: trial:librechat-rag-declaration. current.env is its selected '
72
+ 'partial declaration; baseline.env retains initial bytes. Neither is loaded. '
73
+ 'Other settings, overrides and runtime state are unknown. Do not source '
74
+ 'these files or contact their targets. Prior research is separately scoped.\n'
75
+ )
76
+ print(root)
77
+ PY
78
+ ```
79
+
80
+ Expected: exit 0 for each command, one enabled candidate and the printed trial
81
+ folder. Version 0.1.4 was used for both recorded passes; current 0.1.5 corrects the
82
+ model's ownership reference without changing this reconciliation method.
83
+
84
+ In a fresh local chat, select `n8r-surface:research`, supply the checkout, printed
85
+ trial folder and any applicable prior notes, then ask:
86
+
87
+ > Establish an AI Surface graph baseline for the composition in scope.md using
88
+ > current.env and this LibreChat checkout. Reuse the supplied research after
89
+ > checking applicability. Separate product possibilities, the declared trial
90
+ > setup and observed deployment. Retain identities, human choices and unknowns.
91
+ > Save the next numbered graph-reconciliation note and read back its bytes.
92
+
93
+ Open the saved note and follow its claim-bearing source references. Record its
94
+ exact filename and SHA-256. The baseline must exist **before** changing the file.
95
+ The host must show its resolved absolute save destination; do not accept a claimed
96
+ save without a readable file.
97
+
98
+ In the same terminal, change the one value and inspect the actual bytes:
99
+
100
+ ```sh
101
+ python3 - "$trial_dir" <<'PY'
102
+ from pathlib import Path
103
+ import hashlib, sys
104
+ root = Path(sys.argv[1])
105
+ old = (root / 'baseline.env').read_bytes()
106
+ assert (root / 'current.env').read_bytes() == old
107
+ new = old.replace(b'RAG_API_URL=\n', b'RAG_API_URL=https://rag.example.test\n')
108
+ assert new != old
109
+ (root / 'current.env').write_bytes(new)
110
+ for name in ('baseline.env', 'current.env'):
111
+ data = (root / name).read_bytes()
112
+ print(name, hashlib.sha256(data).hexdigest())
113
+ print(data.decode(), end='')
114
+ PY
115
+ ```
116
+
117
+ Expected exit 0 and only that value changed. Baseline digest is
118
+ `5e060fa66a8c986f418149ff5c8aceba7f4e3b4b090456bb1a1e4bf0299c3161`;
119
+ changed digest is `facfff7d29f57690ba6bb2dc5127a2a249e581bf27f0e3bb9106f4761ab3b638`.
120
+
121
+ In another fresh local chat with the same installed skill and source access,
122
+ supply the baseline note and trial folder, then ask:
123
+
124
+ > Compare this saved graph with the current sources and supplied declaration.
125
+ > Show evidenced agreements, differences, additional discoveries, conflicts and
126
+ > unknowns for relevant nodes and connections. Preserve the original, identities,
127
+ > scoped decisions and unresolved claims. Separate capabilities, declarations
128
+ > and observations. Save a numbered successor and read back its bytes.
129
+
130
+ Independently open the successor and verify the one declared target change,
131
+ unchanged capability/identities and retained unknowns. Rehash the baseline note
132
+ and earlier notes to confirm preservation. Inspect the cited source lines and
133
+ file hashes. Check `git status --short` again; research must not change the source
134
+ checkout. Chat interactions have no process exit code.
135
+
136
+ Graph wording, next note number and additional scoped source findings may vary.
137
+ An unsupported runtime claim, lost predecessor, unrelated selection change,
138
+ unexplained identity replacement or missing saved file fails the check. Source
139
+ reading cannot demonstrate whether a process loaded this declaration; a later
140
+ live trial needs separate effective-configuration and interaction evidence.
141
+
142
+ Retain the notes and input snapshots together when preserving evidence. Otherwise
143
+ remove only the disposable trial folder after review; no application cleanup or
144
+ setting restoration is needed. Do not remove earlier research.
145
+
146
+ See [recorded evidence](researcher-skill-verification.md#controlled-declaration-trial-014)
147
+ and the proposed [Lab recreation handoff](recreation-handoff.md). An agent
148
+ rehearsal establishes the bounded recorded outcome, not human acceptance or
149
+ implemented Lab recreation.
@@ -0,0 +1,95 @@
1
+ # Try another chat-system repository
2
+
3
+ Choose a different chat-system project and see whether Researcher can build a
4
+ useful description from its actual sources. This is an exploratory test: the
5
+ answers depend on the project you choose, so inspect the evidence it cites.
6
+
7
+ ## Before you start
8
+
9
+ Download or clone a repository you are permitted to investigate into your usual
10
+ projects folder. Keep it separate from this vault. Use a local chat app with
11
+ **n8r-surface Researcher 0.1.5 already installed** and access to both that source
12
+ folder and your local vault. You do not need to install or run the
13
+ chosen application. Use public source files without credentials or private data.
14
+
15
+ Pick a short run name, such as `another-chat-001`. Choose an unused name for each
16
+ new investigation; existing runs stay available for comparison.
17
+ Follow the [fresh-context guidance](researcher-vault.md#start-with-fresh-context) before
18
+ the first prompt in each test chat.
19
+
20
+ ## Tasks
21
+
22
+ - [ ] **1. Introduce the project.** Start a fresh local chat in your local vault
23
+ folder and select **n8r-surface Researcher** (`n8r-surface:research`). Give
24
+ it the location of the other repository by adding that folder to the chat's
25
+ accessible sources or pasting its full path. Name it as the source. In the prompt
26
+ below, replace `another-chat-001` with your chosen run name, then paste:
27
+
28
+ > Investigate the other chat-system repository I supplied. Start by confirming
29
+ > which project and source revision you can actually read. Describe how user
30
+ > input reaches AI processing, which model or inference services are supported,
31
+ > and how tools, stored data and authentication connect where the evidence
32
+ > supports them. Cite the source files behind the connections and identify
33
+ > important unknowns. Keep supported options distinct from a selected or running
34
+ > setup. Read source files only; do not install dependencies, start services or
35
+ > read credentials. Save a new numbered note under
36
+ > runs/another-chat-001/notes in this vault, creating the
37
+ > folder if needed, and give me a link to open it.
38
+ > Use the installed skill and the supplied sources only. Do not consult other
39
+ > chats, memories, projects, the web or the test walkthroughs.
40
+
41
+ **Look for:** the correct project, a readable connection map and actual source
42
+ references. If the chat cannot read the other folder, record **Blocked** rather
43
+ than accepting a description based only on the project's name. A downloaded
44
+ archive may lack a Git revision; that limitation should be stated, with the
45
+ inspected files identified instead.
46
+
47
+ - [ ] **2. Inspect the saved findings.** Open the note from its link. Pick two or
48
+ three connections you care about and open the files it cites. Read the cited
49
+ sections to see whether they support the description. A Mermaid diagram may
50
+ appear as text in some editors; its relationships should still be readable.
51
+
52
+ **Look for:** findings about this project, not a generic chat architecture.
53
+ Optional integrations should stay optional unless configuration selects them.
54
+ Missing information should remain unknown. Source code alone should not become
55
+ a claim that an endpoint is reachable or a service works. Record any claim you
56
+ cannot verify as **Needs review**, with the claim and its cited file.
57
+
58
+ - [ ] **3. Continue in a fresh chat.** Start a new local chat in your vault,
59
+ select Researcher, and supply the same source folder and saved note. Paste:
60
+
61
+ > Continue from this saved note. Trace one supported conversation path from
62
+ > incoming user text to the model request and back to the response. Identify
63
+ > which files support each part and where the evidence runs out. Retain the
64
+ > earlier component identities and open questions. Save a new numbered note
65
+ > alongside the first and leave the first unchanged.
66
+ > Use the installed skill, this note and the supplied repository only. Do not
67
+ > consult other chats, memories, projects, the web or the test walkthroughs.
68
+
69
+ **Look for:** a deeper explanation grounded in actual files, a second saved
70
+ note, and clear remaining gaps. It should build on the first investigation and
71
+ distinguish newly learned details from changes to the source. Reopen both files.
72
+
73
+ ## Record what happened
74
+
75
+ > Result: Pass / Fail / Blocked / Needs review
76
+ >
77
+ > Project and source revision, or archive/version supplied:
78
+ >
79
+ > App and Researcher version:
80
+ >
81
+ > Saved notes:
82
+ >
83
+ > Connections checked against source:
84
+ >
85
+ > Surprising findings, unsupported claims or unanswered questions:
86
+
87
+ **Pass** means the notes saved and reopened, the sampled claims matched the source,
88
+ and continuation retained earlier work. **Fail** means you found a wrong claim,
89
+ lost work or a failed save. **Blocked** means access or setup prevented the test.
90
+ **Needs review** means you could run it but cannot yet assess a substantive claim.
91
+ Wording and graph size may vary; a partial map with explicit gaps is useful.
92
+
93
+ Keep the run for review. This checks a sampled source investigation and
94
+ continuation; it does not establish complete coverage, runtime behavior or
95
+ compatibility with a Lab. See the [vault guide](researcher-vault.md) for storage and cleanup.
@@ -0,0 +1,84 @@
1
+ # Verify a Skeleton Surface and its successor
2
+
3
+ This tests a compact security-focused Markdown brief through the installed
4
+ Researcher. An interception point is a place to inspect or intervene in a call;
5
+ a binding maps a described role to a selected resource. No live service is needed.
6
+
7
+ ## Prerequisites and preparation
8
+
9
+ Use installed Researcher **0.1.8**, a local host with file access and a writable
10
+ vault. Reuse the [installation guide](researcher-skill.md#research-01-investigate-and-continue).
11
+ Choose a fresh `runs/skeleton-check/` folder within your vault; use another name
12
+ if it exists. Copy the two files from the
13
+ [synthetic source pack](../../examples/researcher-vault/interception-service/system.md)
14
+ into its `source/` folder. Create an empty `output/` folder alongside `source/`.
15
+ Keep repository originals unchanged. No accounts, credentials, services or Lab
16
+ installation are required. The pack is documentation, not executable software.
17
+
18
+ State X: installed skill, the two revision-1 source files, an empty output folder.
19
+ Input Y: the prompts below, separated by a deliberate source declaration change.
20
+ Outcome Z: two readable briefs with stable identities, evidence and gaps; the
21
+ first is preserved and the second distinguishes declarations from runtime facts.
22
+ Only trial outputs and the disposable settings copy should change.
23
+
24
+ ## Tester steps
25
+
26
+ - [ ] **SKELETON-01 — create the brief.** Open a fresh chat with the trial folder
27
+ available and select n8r-surface Researcher. Ask:
28
+
29
+ > Create a security-focused skeleton Surface from the supplied source folder.
30
+ > I want to know where a security integration could intercept LLM and actual
31
+ > tool calls, with its powers and coverage gaps. Keep the brief compact and link
32
+ > supporting evidence. Save it in the output folder. Stop before installation
33
+ > or configuration.
34
+
35
+ Open the returned file. Expect **Skeleton Surface v0.1**, a particular draft
36
+ revision, stable graph identities, source references and explicit unknown
37
+ bindings. It should distinguish backend inference from actual MCP execution,
38
+ the chat hook's allow/deny powers, the worker's bypass of that hook, and the
39
+ browser-direct inference route. The audit companion must not gain blocking
40
+ power merely because it is a companion process. No vendor compatibility or
41
+ working interception should be claimed. A short table is sufficient; no fixed
42
+ word/node count or detailed research appendix is required.
43
+ - [ ] **SKELETON-02 — change declarations outside the Lab.** Keep a preservation
44
+ copy of the first output. In the disposable `source/settings.txt`, replace the
45
+ first comment and the two indicated empty values with:
46
+
47
+ ```text
48
+ # Synthetic setup declaration, revision 2. No process has loaded these values.
49
+ MONGODB_URL=mongodb://database.example.test:27017/cedar
50
+ MODEL_BASE_URL=https://model-proxy.example.test/v1
51
+ ```
52
+
53
+ Leave the other fields unchanged. These reserved addresses are fictional; do
54
+ not connect to them. Open the first output again: it should remain unchanged.
55
+ Start a fresh chat with the trial folder and skill, supply that output and ask:
56
+
57
+ > Reconcile this saved skeleton with the current source folder and save a
58
+ > successor in the same output folder. Explain the changes and retain the
59
+ > security interception view. Stop before installation or configuration.
60
+
61
+ Open both outputs. Expect the same profile version, stable identities for the
62
+ database/inference roles and retained interception gaps. The successor should
63
+ identify the new database and inference target declarations with their source,
64
+ preserving the first output. It must not claim a process loaded them, a proxy
65
+ intercepted traffic, a specific proxy product was identified, or the database
66
+ works. The source pack cannot establish when any real change took effect.
67
+ - [ ] Report **Pass / Fail / Blocked**, skill/app versions, links to both outputs
68
+ and the step/evidence for any failure. Wording, IDs and unused file numbers may
69
+ vary; identities must remain stable between outputs. Missing files/evidence,
70
+ overwritten predecessors, lost bypasses or unsupported runtime claims fail.
71
+ These are chat interactions with no process exit code. Keep the trial folder
72
+ for review; optional cleanup removes only that folder after review.
73
+
74
+ ## Maintainer evidence checks
75
+
76
+ Record the exact candidate commit, installed skill/package digests and host
77
+ version separately from tester steps. Independently read the saved bytes, verify
78
+ source references/hashes, compare stable IDs and confirm unchanged predecessor
79
+ bytes. Check that neither source file changed during each research interaction.
80
+ The deliberate settings edit happens between interactions, not inside research.
81
+
82
+ Record actual results in [versioned verification](researcher-skill-verification.md#skeleton-surface-018).
83
+ An agent rehearsal is not human acceptance, Work UI lifecycle validation, runtime
84
+ enforcement, a Lab recording implementation or validated structured output.