diff --git a/.docs/marketplace-cli-examples-20261014/README.md b/.docs/marketplace-cli-examples-20261014/README.md new file mode 100644 index 000000000..d52810089 --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/README.md @@ -0,0 +1,24 @@ +# Marketplace CLI examples — actual output verification + +The VS Code package README and Continue bundle README now contain runnable examples for both `terraphim-grep` and `terraphim-agent`, with separate installation instructions, clients v1.21.20 links, `synonyms::` concept Markdown, and the public search, memory and hooks tutorials. This is a documentation amendment; extension/integration versions and runtime code are unchanged. + +## Executed examples + +Both new README command blocks were executed on macOS ARM64 using exact released clients **1.21.20**, with isolated child profiles so authored fixture captures did not enter the user's memory. The user-facing commands intentionally use the current user's OS-local memory store; their working directory does not establish memory isolation. + +- The existing editor-exported `integrations/continue/risk-concern.exported.json` was supplied as an input. It is not a newly authored graph from these runs. +- The corpus contains only `Risk: supplier delays require a backup plan.` An explicit empty graph returns zero passages; the exported Risk/Concern graph returns one actual Risk passage for `concern` with `answer: null`. +- Both exact capture/Python-ID-extraction/show blocks persisted and read back `Risk requires a Decision: approve a second supplier as the mitigation.` with the `provenance:public-project-brief` tag and matching generated ID. Capturing authored text does not import the editor graph or configure an agent retrieval role. +- The VS Code `--answer` example was also executed on the single-passage corpus and correctly returned no generated answer. The README explains this insufficient-evidence result and that synthesis requires a configured provider. These runs do not claim provider synthesis; the linked tutorial shows the fuller comparison. + +[receipt.json](receipt.json) preserves exact shell blocks, binary versions/digests and output filenames. Its original execution-document hashes are retained; `finalDocumentSha256` additionally binds the final explanatory prose, and every executed block was verified unchanged. The adjacent stdout/JSON files are actual outputs. Empty stderr files are intentional; grep's harmless fresh-directory/no-Git warning is retained where emitted. + +## Existing integration tests + +All six Continue tests passed, including real SDK/CLI transport, installer preservation, package determinism and immutable tag/source checks. The existing real transport test now also proves graph-restart behavior: changing graph bytes is refused by the running process; restarting the same server arguments admits the reviewed graph's new digest and retrieves Risk for the added Hazard alias. The changed graph is a labelled test input, not an editor operation. See [continue-transport.json](continue-transport.json) and [continue-tests.txt](continue-tests.txt). + +The binary digest is explicitly pinned in generated Continue arguments. The graph digest is captured at process startup. A new graph path requires an explicit config edit; the installer refuses existing configuration. No existing profile or model configuration was overwritten. + +## Publication scope + +Microsoft/Open VSX consume the packaged VS Code README. Continue packages its own README via the explicit existing allowlist, and future CI release notes now reference both separately installed CLIs. A repository merge alone does not update existing marketplace package bytes. A subsequent versioned CI release, registry readback and package inspection are required; this change does not republish or replace any immutable release. diff --git a/.docs/marketplace-cli-examples-20261014/SHA256SUMS.json b/.docs/marketplace-cli-examples-20261014/SHA256SUMS.json new file mode 100644 index 000000000..55175f85c --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/SHA256SUMS.json @@ -0,0 +1,25 @@ +{ + "README.md": "c05cee5cf386877417c6fbde98fbb2abd33410494c0b654c6156af67db41a760", + "continue-baseline.json": "fc56c1d4a44f506af409eee56121a46f3cc8477672d2dc34607a5559e163d617", + "continue-capture-show.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "continue-capture-show.stdout": "e5fd1c5aa1783a0da04fbed0b389e1ecb7344f6ac1cb20ecedfb557e92026103", + "continue-captured-memory.json": "04598be71f4ef9f78535258588944e67303e7a270b743f77d4a583dc5c10dd12", + "continue-search.stderr": "fd9b782d80809409e53acc3a49dbe0fc009d41b235cf153389437d6806223ef9", + "continue-search.stdout": "27e0cb3fb1ce06daf373ce34d71e2fe5b8ba4a08ee2f727c8308a3035c3cba2e", + "continue-tests.txt": "91261bedbe9c06eae4ae6c74caafb74732d2d9be76392df488b9d358d82fce82", + "continue-transport.json": "ea01b415502a8effa682d6eca4d44a7f1b9795727fa3e5a38d679e96c1691e0c", + "continue-versions.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "continue-versions.stdout": "6d96d08f85b37470dca867aae9df25ed2fb4d1ccc25f8539b324c570f9d1a49f", + "receipt.json": "85e150bc097f740f3a9dcb25ac805b91972682b7b872ab2092dcfe841e5620f1", + "static-checks.json": "87d7be0ce01887f0e50b383b28428aa20b60707f02d958561a3c6dad5c8833b3", + "vscode-answer-insufficient.stderr": "b55d7f29bf9762191acbc3f70d2905006a6d059f57a8d47c2dc5d7fc1235f7f5", + "vscode-answer-insufficient.stdout": "623221ece392aeed5ac519a6ff483c6e8921c7b855ef2cf90808330d1749f7bf", + "vscode-baseline.json": "92332236148e9dc48f88fb18c15cf5fdbec30a89ada1b7d73643d2f59fbc1594", + "vscode-capture-show.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "vscode-capture-show.stdout": "31c7e3c2ebf571379de99f5a76eaa1a93726e65d06aa87d72c993ef701cb983c", + "vscode-captured-memory.json": "d83d41daa409a962d3347ce3a062b51c8b88a7031c818bf1ac6571a0dfda886e", + "vscode-search.stderr": "016a2974e7e5485ec65cce01cf92f24fb4cbbb1b0683b597a48d336ba6f6041e", + "vscode-search.stdout": "27e0cb3fb1ce06daf373ce34d71e2fe5b8ba4a08ee2f727c8308a3035c3cba2e", + "vscode-versions.stderr": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "vscode-versions.stdout": "6d96d08f85b37470dca867aae9df25ed2fb4d1ccc25f8539b324c570f9d1a49f" +} diff --git a/.docs/marketplace-cli-examples-20261014/continue-baseline.json b/.docs/marketplace-cli-examples-20261014/continue-baseline.json new file mode 100644 index 000000000..a036888bc --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/continue-baseline.json @@ -0,0 +1,13 @@ +{ + "chunks": [], + "answer": null, + "concepts": [], + "sufficiency": "RlmInsufficient", + "sufficiency_explanation": "No chunks or knowledge-graph concepts matched the query; there is nothing to synthesise an answer from.", + "stats": { + "search_latency_ms": 3, + "rlm_latency_ms": null, + "chunks_returned": 0, + "kg_hits": 0 + } +} diff --git a/.docs/marketplace-cli-examples-20261014/continue-capture-show.stderr b/.docs/marketplace-cli-examples-20261014/continue-capture-show.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/.docs/marketplace-cli-examples-20261014/continue-capture-show.stdout b/.docs/marketplace-cli-examples-20261014/continue-capture-show.stdout new file mode 100644 index 000000000..2a6da6313 --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/continue-capture-show.stdout @@ -0,0 +1,19 @@ +{ + "action": "show", + "id": "a95a88a6-4d17-4359-a7be-5231f26ea724", + "lesson": null, + "memory_item": { + "access_count": 0, + "associations": {}, + "content": "Risk requires a Decision: approve a second supplier as the mitigation.", + "created_at": "2026-10-14T18:36:58.842432Z", + "id": "a95a88a6-4d17-4359-a7be-5231f26ea724", + "importance": "Medium", + "item_type": "Experience", + "last_accessed": null, + "tags": [ + "provenance:public-project-brief" + ] + }, + "status": "ok" +} diff --git a/.docs/marketplace-cli-examples-20261014/continue-captured-memory.json b/.docs/marketplace-cli-examples-20261014/continue-captured-memory.json new file mode 100644 index 000000000..f5ba4b22c --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/continue-captured-memory.json @@ -0,0 +1 @@ +{"action":"capture","memory_id":"a95a88a6-4d17-4359-a7be-5231f26ea724","provenance_tag":"public-project-brief","status":"ok"} diff --git a/.docs/marketplace-cli-examples-20261014/continue-search.stderr b/.docs/marketplace-cli-examples-20261014/continue-search.stderr new file mode 100644 index 000000000..4a0f7dc22 --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/continue-search.stderr @@ -0,0 +1 @@ +2026-10-14T18:36:57.313842Z WARN fff_search::file_picker: No git repository found for path: ./briefs diff --git a/.docs/marketplace-cli-examples-20261014/continue-search.stdout b/.docs/marketplace-cli-examples-20261014/continue-search.stdout new file mode 100644 index 000000000..4a4ad5d9e --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/continue-search.stdout @@ -0,0 +1,35 @@ +{ + "chunks": [ + { + "content": "Risk: supplier delays require a backup plan.", + "source": "decision.md", + "line_start": 1, + "line_end": 1, + "relevance_score": 2.0, + "haystack": "code" + } + ], + "answer": null, + "concepts": [ + { + "id": 0, + "name": "concern", + "display_value": null, + "score": 1.0 + }, + { + "id": 0, + "name": "risk", + "display_value": null, + "score": 1.0 + } + ], + "sufficiency": "RlmInsufficient", + "sufficiency_explanation": "Only 1 chunk(s) and 2 KG concept(s) were retrieved; the minimum for a meaningful answer is 3 chunks, and coverage was 1.00. Too little evidence to synthesise -- try broadening the query or the searched paths.", + "stats": { + "search_latency_ms": 3, + "rlm_latency_ms": null, + "chunks_returned": 1, + "kg_hits": 2 + } +} diff --git a/.docs/marketplace-cli-examples-20261014/continue-tests.txt b/.docs/marketplace-cli-examples-20261014/continue-tests.txt new file mode 100644 index 000000000..f8f8e3192 --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/continue-tests.txt @@ -0,0 +1,13 @@ +test_project_install_preserves_existing_configuration (test_install.InstallTests.test_project_install_preserves_existing_configuration) ... ok +test_symlink_directory_refused (test_install.InstallTests.test_symlink_directory_refused) ... ok +test_complete_allowlisted_bundle_and_refuse_overwrite (test_package.PackageTests.test_complete_allowlisted_bundle_and_refuse_overwrite) ... ok +test_actual_git_tag_gate_and_moved_tag_refusal (test_source.SourceTests.test_actual_git_tag_gate_and_moved_tag_refusal) ... ok +test_lightweight_and_annotated_tag_identity (test_source.SourceTests.test_lightweight_and_annotated_tag_identity) ... ok +test_real_retrieval_and_refusals (test_transport.TransportTests.test_real_retrieval_and_refusals) ... 2026-10-14T18:39:03.186811Z WARN fff_search::file_picker: No git repository found for path: /var/folders/rb/l4_6j2nx0lnfhysk974ldpg40000gn/T/tmp28vhpcy7/corpus +Tool 'terraphim_answer' not listed, no validation will be performed +ok + +---------------------------------------------------------------------- +Ran 6 tests in 2.325s + +OK diff --git a/.docs/marketplace-cli-examples-20261014/continue-transport.json b/.docs/marketplace-cli-examples-20261014/continue-transport.json new file mode 100644 index 000000000..5e9a1b482 --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/continue-transport.json @@ -0,0 +1,128 @@ +{ + "baseline": { + "chunks": [], + "answer": null, + "concepts": [], + "sufficiency": "RlmInsufficient", + "sufficiency_explanation": "No chunks or knowledge-graph concepts matched the query; there is nothing to synthesise an answer from.", + "stats": { + "search_latency_ms": 3, + "rlm_latency_ms": null, + "chunks_returned": 0, + "kg_hits": 0 + } + }, + "retrieval": { + "mode": "retrieval-only", + "binarySha256": "95491857b6a115ce7f4ec2a9d24bd0f7b8efcc1a52bd1403b34a62dd704012ab", + "graphSha256": "f8648b16470e764bdff5c95064078419d71e8d41d2ca30d4b1508017c166a45d", + "argv": [ + "/private/tmp/published-continue-skills-audit-20261014/clients-1.21.20/extracted/terraphim-grep", + "--search-only", + "--json", + "--thesaurus", + "/private/var/folders/rb/l4_6j2nx0lnfhysk974ldpg40000gn/T/tmp28vhpcy7/graph.json", + "--paths", + "/private/var/folders/rb/l4_6j2nx0lnfhysk974ldpg40000gn/T/tmp28vhpcy7/corpus", + "-n", + "8", + "--", + "Concern" + ], + "output": { + "chunks": [ + { + "content": "Risk: supplier delays require a backup plan.", + "source": "brief.md", + "line_start": 1, + "line_end": 1, + "relevance_score": 2.0, + "haystack": "code" + } + ], + "answer": null, + "concepts": [ + { + "id": 0, + "name": "concern", + "display_value": null, + "score": 1.0 + }, + { + "id": 0, + "name": "risk", + "display_value": null, + "score": 1.0 + } + ], + "sufficiency": "RlmInsufficient", + "sufficiency_explanation": "Only 1 chunk(s) and 2 KG concept(s) were retrieved; the minimum for a meaningful answer is 3 chunks, and coverage was 1.00. Too little evidence to synthesise -- try broadening the query or the searched paths.", + "stats": { + "search_latency_ms": 2, + "rlm_latency_ms": null, + "chunks_returned": 1, + "kg_hits": 2 + } + } + }, + "changedGraphRefused": "Admitted binary or graph changed; restart after reviewing new inputs", + "reviewedGraphAfterRestart": { + "mode": "retrieval-only", + "binarySha256": "95491857b6a115ce7f4ec2a9d24bd0f7b8efcc1a52bd1403b34a62dd704012ab", + "graphSha256": "fb637650f150f1db0b71537956ddcc07655888bb286f378624cca06013b101e2", + "argv": [ + "/private/tmp/published-continue-skills-audit-20261014/clients-1.21.20/extracted/terraphim-grep", + "--search-only", + "--json", + "--thesaurus", + "/private/var/folders/rb/l4_6j2nx0lnfhysk974ldpg40000gn/T/tmp28vhpcy7/graph.json", + "--paths", + "/private/var/folders/rb/l4_6j2nx0lnfhysk974ldpg40000gn/T/tmp28vhpcy7/corpus", + "-n", + "8", + "--", + "Hazard" + ], + "output": { + "chunks": [ + { + "content": "Risk: supplier delays require a backup plan.", + "source": "brief.md", + "line_start": 1, + "line_end": 1, + "relevance_score": 2.0, + "haystack": "code" + } + ], + "answer": null, + "concepts": [ + { + "id": 0, + "name": "concern", + "display_value": null, + "score": 1.0 + }, + { + "id": 0, + "name": "hazard", + "display_value": null, + "score": 1.0 + }, + { + "id": 0, + "name": "risk", + "display_value": null, + "score": 1.0 + } + ], + "sufficiency": "RlmInsufficient", + "sufficiency_explanation": "Only 1 chunk(s) and 3 KG concept(s) were retrieved; the minimum for a meaningful answer is 3 chunks, and coverage was 1.00. Too little evidence to synthesise -- try broadening the query or the searched paths.", + "stats": { + "search_latency_ms": 2, + "rlm_latency_ms": null, + "chunks_returned": 1, + "kg_hits": 3 + } + } + } +} \ No newline at end of file diff --git a/.docs/marketplace-cli-examples-20261014/continue-versions.stderr b/.docs/marketplace-cli-examples-20261014/continue-versions.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/.docs/marketplace-cli-examples-20261014/continue-versions.stdout b/.docs/marketplace-cli-examples-20261014/continue-versions.stdout new file mode 100644 index 000000000..12489a3a9 --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/continue-versions.stdout @@ -0,0 +1,2 @@ +terraphim-grep 1.21.20 +terraphim-agent 1.21.20 diff --git a/.docs/marketplace-cli-examples-20261014/receipt.json b/.docs/marketplace-cli-examples-20261014/receipt.json new file mode 100644 index 000000000..65820fe6c --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/receipt.json @@ -0,0 +1,89 @@ +{ + "checkedAt": "2026-10-14T18:36:54.066022+00:00", + "host": { + "system": "Darwin", + "architecture": "arm64" + }, + "release": "https://github.com/terraphim/terraphim-clients/releases/tag/v1.21.20", + "binaries": { + "terraphim-grep": { + "sha256": "95491857b6a115ce7f4ec2a9d24bd0f7b8efcc1a52bd1403b34a62dd704012ab", + "version": "terraphim-grep 1.21.20" + }, + "terraphim-agent": { + "sha256": "bff31dc42d6d1a99bf51291039d7719c6a48c2326e582e5e24eaa1eaf11e17ec", + "version": "terraphim-agent 1.21.20" + } + }, + "cases": [ + { + "name": "vscode", + "sourceDocument": "vs-code-terraphim-it/README.md", + "sourceSha256": "c14dfef1378e99015bb8a921fa186be7be1ce732d308302f7d1c830b4378d8ea", + "graphSha256": "f8648b16470e764bdff5c95064078419d71e8d41d2ca30d4b1508017c166a45d", + "graphProvenance": "Existing editor-exported graph at integrations/continue/risk-concern.exported.json; labelled input.", + "profileIsolation": "Dedicated child HOME/config/data directories; no real user memory used; provider/credential environment names omitted.", + "commands": [ + { + "block": "terraphim-grep --version\nterraphim-agent --version", + "exitCode": 0, + "stdout": "vscode-versions.stdout", + "stderr": "vscode-versions.stderr" + }, + { + "block": "terraphim-grep concern --search-only --haystack all \\\n --paths ./briefs --thesaurus ./brief.knowledge-graph.json --json -n 3", + "exitCode": 0, + "stdout": "vscode-search.stdout", + "stderr": "vscode-search.stderr" + }, + { + "block": "terraphim-grep concern --answer --haystack all \\\n --paths ./briefs --thesaurus ./brief.knowledge-graph.json --json -n 3", + "exitCode": 0, + "stdout": "vscode-answer-insufficient.stdout", + "stderr": "vscode-answer-insufficient.stderr" + }, + { + "block": "terraphim-agent --format json memory capture \\\n --content 'Risk requires a Decision: approve a second supplier as the mitigation.' \\\n --provenance-tag 'public-project-brief' > captured-memory.json\nmemory_id=\"$(python3 -c 'import json; print(json.load(open(\"captured-memory.json\"))[\"memory_id\"])')\"\nterraphim-agent memory show \"$memory_id\" --json", + "exitCode": 0, + "stdout": "vscode-capture-show.stdout", + "stderr": "vscode-capture-show.stderr" + } + ], + "baseline": "Zero passages with explicit empty graph; one Risk passage with existing editor export.", + "finalDocumentSha256": "065ac3ecaaf3f9d92873b245edd39fae5102dcca79ca6cc02f89b78616fac06f", + "executedBlocksUnchangedInFinalDocument": true + }, + { + "name": "continue", + "sourceDocument": "integrations/continue/README.md", + "sourceSha256": "898de9de9b482123ae30ff0b8c22810342f7d17e463ee1ca6b402e29a00d2dc4", + "graphSha256": "f8648b16470e764bdff5c95064078419d71e8d41d2ca30d4b1508017c166a45d", + "graphProvenance": "Existing editor-exported graph at integrations/continue/risk-concern.exported.json; labelled input.", + "profileIsolation": "Dedicated child HOME/config/data directories; no real user memory used; provider/credential environment names omitted.", + "commands": [ + { + "block": "terraphim-grep --version\nterraphim-agent --version", + "exitCode": 0, + "stdout": "continue-versions.stdout", + "stderr": "continue-versions.stderr" + }, + { + "block": "mkdir briefs\nprintf '%s\\n' 'Risk: supplier delays require a backup plan.' > briefs/decision.md\nterraphim-grep concern --search-only --haystack all \\\n --paths ./briefs --thesaurus ./risk-concern.exported.json --json -n 3", + "exitCode": 0, + "stdout": "continue-search.stdout", + "stderr": "continue-search.stderr" + }, + { + "block": "terraphim-agent --format json memory capture \\\n --content 'Risk requires a Decision: approve a second supplier as the mitigation.' \\\n --provenance-tag 'public-project-brief' > captured-memory.json\nmemory_id=\"$(python3 -c 'import json; print(json.load(open(\"captured-memory.json\"))[\"memory_id\"])')\"\nterraphim-agent memory show \"$memory_id\" --json", + "exitCode": 0, + "stdout": "continue-capture-show.stdout", + "stderr": "continue-capture-show.stderr" + } + ], + "baseline": "Zero passages with explicit empty graph; one Risk passage with existing editor export.", + "finalDocumentSha256": "ca2e1f9e5e87e1e863e5015f4d6847bfda222ddb8d3b0abcf79f5063a1adc66b", + "executedBlocksUnchangedInFinalDocument": true + } + ], + "scope": "Exact new README shell blocks executed with released binaries in fresh child-only local profiles. The graph is an existing editor export supplied as labelled input; these CLI runs do not claim a new editor operation or provider synthesis." +} diff --git a/.docs/marketplace-cli-examples-20261014/static-checks.json b/.docs/marketplace-cli-examples-20261014/static-checks.json new file mode 100644 index 000000000..da88d8ddf --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/static-checks.json @@ -0,0 +1,16 @@ +{ + "changedTest": "integrations/continue/test_transport.py", + "current": { + "critical": 2, + "warning": 5, + "exitCode": 1 + }, + "base": { + "critical": 2, + "warning": 3, + "exitCode": 1 + }, + "review": "The two taint findings identify the pre-existing intentionally selected released test executable from TERRAPHIM_GREP_BINARY, passed as argv without shell. Existing unbounded baseline subprocess is unchanged. Two new warnings identify json.loads calls on test fixture/actual MCP output: malformed JSON must fail this assertion-based integration test, not be swallowed. No production runtime changed.", + "actionlint": "PASS .github/workflows/continue-integration.yml", + "diffCheck": "PASS" +} diff --git a/.docs/marketplace-cli-examples-20261014/vscode-answer-insufficient.stderr b/.docs/marketplace-cli-examples-20261014/vscode-answer-insufficient.stderr new file mode 100644 index 000000000..57690e03f --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/vscode-answer-insufficient.stderr @@ -0,0 +1 @@ +2026-10-14T18:36:54.150537Z WARN fff_search::file_picker: No git repository found for path: ./briefs diff --git a/.docs/marketplace-cli-examples-20261014/vscode-answer-insufficient.stdout b/.docs/marketplace-cli-examples-20261014/vscode-answer-insufficient.stdout new file mode 100644 index 000000000..36fbf43c1 --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/vscode-answer-insufficient.stdout @@ -0,0 +1,35 @@ +{ + "chunks": [ + { + "content": "Risk: supplier delays require a backup plan.", + "source": "decision.md", + "line_start": 1, + "line_end": 1, + "relevance_score": 2.0, + "haystack": "code" + } + ], + "answer": null, + "concepts": [ + { + "id": 0, + "name": "concern", + "display_value": null, + "score": 1.0 + }, + { + "id": 0, + "name": "risk", + "display_value": null, + "score": 1.0 + } + ], + "sufficiency": "RlmInsufficient", + "sufficiency_explanation": "Only 1 chunk(s) and 2 KG concept(s) were retrieved; the minimum for a meaningful answer is 3 chunks, and coverage was 1.00. Too little evidence to synthesise -- try broadening the query or the searched paths.", + "stats": { + "search_latency_ms": 2, + "rlm_latency_ms": null, + "chunks_returned": 1, + "kg_hits": 2 + } +} diff --git a/.docs/marketplace-cli-examples-20261014/vscode-baseline.json b/.docs/marketplace-cli-examples-20261014/vscode-baseline.json new file mode 100644 index 000000000..aef3a99b7 --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/vscode-baseline.json @@ -0,0 +1,13 @@ +{ + "chunks": [], + "answer": null, + "concepts": [], + "sufficiency": "RlmInsufficient", + "sufficiency_explanation": "No chunks or knowledge-graph concepts matched the query; there is nothing to synthesise an answer from.", + "stats": { + "search_latency_ms": 2, + "rlm_latency_ms": null, + "chunks_returned": 0, + "kg_hits": 0 + } +} diff --git a/.docs/marketplace-cli-examples-20261014/vscode-capture-show.stderr b/.docs/marketplace-cli-examples-20261014/vscode-capture-show.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/.docs/marketplace-cli-examples-20261014/vscode-capture-show.stdout b/.docs/marketplace-cli-examples-20261014/vscode-capture-show.stdout new file mode 100644 index 000000000..150f540a4 --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/vscode-capture-show.stdout @@ -0,0 +1,19 @@ +{ + "action": "show", + "id": "02cc5963-1330-4f35-957a-d67fc5ba40b6", + "lesson": null, + "memory_item": { + "access_count": 0, + "associations": {}, + "content": "Risk requires a Decision: approve a second supplier as the mitigation.", + "created_at": "2026-10-14T18:36:55.684078Z", + "id": "02cc5963-1330-4f35-957a-d67fc5ba40b6", + "importance": "Medium", + "item_type": "Experience", + "last_accessed": null, + "tags": [ + "provenance:public-project-brief" + ] + }, + "status": "ok" +} diff --git a/.docs/marketplace-cli-examples-20261014/vscode-captured-memory.json b/.docs/marketplace-cli-examples-20261014/vscode-captured-memory.json new file mode 100644 index 000000000..2004f9e69 --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/vscode-captured-memory.json @@ -0,0 +1 @@ +{"action":"capture","memory_id":"02cc5963-1330-4f35-957a-d67fc5ba40b6","provenance_tag":"public-project-brief","status":"ok"} diff --git a/.docs/marketplace-cli-examples-20261014/vscode-search.stderr b/.docs/marketplace-cli-examples-20261014/vscode-search.stderr new file mode 100644 index 000000000..ed9cee960 --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/vscode-search.stderr @@ -0,0 +1 @@ +2026-10-14T18:36:54.135393Z WARN fff_search::file_picker: No git repository found for path: ./briefs diff --git a/.docs/marketplace-cli-examples-20261014/vscode-search.stdout b/.docs/marketplace-cli-examples-20261014/vscode-search.stdout new file mode 100644 index 000000000..4a4ad5d9e --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/vscode-search.stdout @@ -0,0 +1,35 @@ +{ + "chunks": [ + { + "content": "Risk: supplier delays require a backup plan.", + "source": "decision.md", + "line_start": 1, + "line_end": 1, + "relevance_score": 2.0, + "haystack": "code" + } + ], + "answer": null, + "concepts": [ + { + "id": 0, + "name": "concern", + "display_value": null, + "score": 1.0 + }, + { + "id": 0, + "name": "risk", + "display_value": null, + "score": 1.0 + } + ], + "sufficiency": "RlmInsufficient", + "sufficiency_explanation": "Only 1 chunk(s) and 2 KG concept(s) were retrieved; the minimum for a meaningful answer is 3 chunks, and coverage was 1.00. Too little evidence to synthesise -- try broadening the query or the searched paths.", + "stats": { + "search_latency_ms": 3, + "rlm_latency_ms": null, + "chunks_returned": 1, + "kg_hits": 2 + } +} diff --git a/.docs/marketplace-cli-examples-20261014/vscode-versions.stderr b/.docs/marketplace-cli-examples-20261014/vscode-versions.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/.docs/marketplace-cli-examples-20261014/vscode-versions.stdout b/.docs/marketplace-cli-examples-20261014/vscode-versions.stdout new file mode 100644 index 000000000..12489a3a9 --- /dev/null +++ b/.docs/marketplace-cli-examples-20261014/vscode-versions.stdout @@ -0,0 +1,2 @@ +terraphim-grep 1.21.20 +terraphim-agent 1.21.20 diff --git a/.github/workflows/continue-integration.yml b/.github/workflows/continue-integration.yml index fa3ad12ec..e58f936d6 100644 --- a/.github/workflows/continue-integration.yml +++ b/.github/workflows/continue-integration.yml @@ -93,7 +93,7 @@ jobs: cmp terraphim-continue-SHA256SUMS existing/terraphim-continue-SHA256SUMS else qualify_source - gh release create "$RELEASE_TAG" --verify-tag --draft --title "Terraphim Continue integration $version" --notes "Agent-mode MCP tools backed by released terraphim-grep. Actual SDK transport qualified; native Continue UI and full editor parity remain unqualified." --latest=false + gh release create "$RELEASE_TAG" --verify-tag --draft --title "Terraphim Continue integration $version" --notes "Agent-mode MCP tools backed by separately installed terraphim-grep. The packaged README includes runnable terraphim-grep synonym-search and terraphim-agent authored-memory capture/readback examples, verified with clients v1.21.20. See https://terraphim.ai/how-tos/synonym-search/ and https://terraphim.ai/posts/cold-start-tax-agentic-memory/. Actual SDK transport qualified; native Continue UI and full editor parity remain unqualified." --latest=false qualify_source gh release upload "$RELEASE_TAG" "$CONTINUE_ARCHIVE_NAME" terraphim-continue-SHA256SUMS fi diff --git a/README-alternative-control.md b/README-alternative-control.md index 842052983..37de782aa 100644 --- a/README-alternative-control.md +++ b/README-alternative-control.md @@ -1,3 +1,5 @@ # Terraphim It: Alternative Control [Read the integration guide and current acceptance scope](vs-code-terraphim-it/README-alternative-control.md) for the Terraphim It VS Code extension, including document persistence, undo/redo, synonym graph export and preview limitations. + +The [packaged CLI examples](vs-code-terraphim-it/README.md#use-the-graph-with-terraphim-grep-and-terraphim-agent) show how to search the exported graph with separately installed `terraphim-grep` and save/read back authored decisions with `terraphim-agent`. Both examples specify the tested clients release and link the public walkthroughs. diff --git a/integrations/continue/README.md b/integrations/continue/README.md index 390b9a1d6..7e76e989b 100644 --- a/integrations/continue/README.md +++ b/integrations/continue/README.md @@ -26,6 +26,47 @@ python3 -m venv .venv This creates only `.continue/mcpServers/terraphim.json` and `.continue/rules/terraphim.md` in that project; existing files are refused and existing model settings retained. The generated config uses this venv's Python and the bundle's absolute path. Open the project in the existing Continue extension, select Agent mode and inspect its MCP tool list. Ask it to call `terraphim_retrieve` for `Concern`, then inspect the returned Risk excerpt. Explicitly request the answer tool only if installed and desired. Do not treat a model's narrative as proof that a tool ran. +## Use both CLIs directly + +The integration calls `terraphim-grep`; `terraphim-agent` is a separate CLI for memory and learning. Install both separately from the [clients v1.21.20 release](https://github.com/terraphim/terraphim-clients/releases/tag/v1.21.20): select your platform archives, verify `SHA256SUMS`, extract them and add the executables to `PATH`. Neither CLI is bundled here. The commands below were checked with **1.21.20** on macOS ARM64; the existing MCP transport CI separately pins grep 1.21.19. + +```sh +terraphim-grep --version +terraphim-agent --version +``` + +The shared concept uses Logseq-compatible `synonyms::` syntax in a Markdown knowledge-base note: + +```markdown +# Risk +synonyms:: Concern +``` + +The adapter and CLI consume its compiled JSON graph. Run this example in a fresh working directory. It uses the graph exported from the editor, included as `risk-concern.exported.json` in this bundle. Copy that file into the working directory first. The clean corpus contains Risk but no literal Concern: + +```sh +mkdir briefs +printf '%s\n' 'Risk: supplier delays require a backup plan.' > briefs/decision.md +terraphim-grep concern --search-only --haystack all \ + --paths ./briefs --thesaurus ./risk-concern.exported.json --json -n 3 +``` + +The returned `chunks` contain the Risk sentence and `answer` is `null`. To adopt a newly authored synonym, review the editor export, replace the file at the configured `--graph` path, and restart the MCP server. The running server refuses changed graph bytes; a new process records the reviewed graph's digest at startup. If you use a different graph path, update `--graph` in `.continue/mcpServers/terraphim.json` first. The installer refuses existing configuration rather than overwriting it. The [synonym-search tutorial](https://terraphim.ai/how-tos/synonym-search/) includes the editor steps, video and downloadable examples. + +To compare retrieval with provider synthesis on a corpus with several relevant passages, run the same search with `--answer` instead of `--search-only`. That requires a configured provider and can send the retrieved context to it; inspect the returned passages, answer and citations separately. The Continue adapter exposes this mode only when installed with `--allow-synthesis`. + +Preserve an authored decision using agent memory, then read the actual saved item (Python 3 extracts the returned ID): + +```sh +terraphim-agent --format json memory capture \ + --content 'Risk requires a Decision: approve a second supplier as the mitigation.' \ + --provenance-tag 'public-project-brief' > captured-memory.json +memory_id="$(python3 -c 'import json; print(json.load(open("captured-memory.json"))["memory_id"])')" +terraphim-agent memory show "$memory_id" --json +``` + +The readback's `memory_item.content` contains that sentence, with the `provenance:public-project-brief` tag. Capture writes to the current user's OS-local memory store (independent of the working directory). It does not consume the exported graph, configure a retrieval role or add a memory tool to this MCP adapter. Follow the [memory walkthrough](https://terraphim.ai/posts/cold-start-tax-agentic-memory/) for role-aware retrieval and the [hooks walkthrough](https://terraphim.ai/posts/native-hook-support/) for reviewed command corrections. + ## Verification and packaging ```sh diff --git a/integrations/continue/test_transport.py b/integrations/continue/test_transport.py index 9c32e4d74..a7d9a08f8 100644 --- a/integrations/continue/test_transport.py +++ b/integrations/continue/test_transport.py @@ -50,10 +50,26 @@ async def exercise(): self.assertTrue(invalid.isError) disabled = await session.call_tool('terraphim_answer', {'query': 'Concern'}) self.assertTrue(disabled.isError) - local_graph.write_text('{}') + updated_graph = json.loads(local_graph.read_text()) + updated_graph['data']['hazard'] = updated_graph['data']['risk'] + local_graph.write_text(json.dumps(updated_graph)) drift = await session.call_tool('terraphim_retrieve', {'query': 'Concern'}) self.assertTrue(drift.isError) self.assertIn('changed', drift.content[0].text) + receipt['changedGraphRefused'] = drift.content[0].text + # The graph is pinned for one server process, unlike the explicit + # released-binary digest in the generated configuration. + async with stdio_client(params) as streams: + async with ClientSession(*streams) as session: + await session.initialize() + result = await session.call_tool('terraphim_retrieve', {'query': 'Hazard'}) + self.assertFalse(result.isError) + restarted = json.loads(result.content[0].text) + self.assertNotEqual(restarted['graphSha256'], actual['graphSha256']) + self.assertEqual(restarted['graphSha256'], hashlib.sha256(local_graph.read_bytes()).hexdigest()) + self.assertEqual(restarted['output']['chunks'][0]['content'], 'Risk: supplier delays require a backup plan.') + self.assertIsNone(restarted['output']['answer']) + receipt['reviewedGraphAfterRestart'] = restarted asyncio.run(exercise()) if os.environ.get('TERRAPHIM_CONTINUE_RECEIPT'): Path(os.environ['TERRAPHIM_CONTINUE_RECEIPT']).write_text(json.dumps(receipt, indent=2)) diff --git a/vs-code-terraphim-it/README-alternative-control.md b/vs-code-terraphim-it/README-alternative-control.md index ad535f003..498c2d8bc 100644 --- a/vs-code-terraphim-it/README-alternative-control.md +++ b/vs-code-terraphim-it/README-alternative-control.md @@ -6,6 +6,14 @@ The view bundles the released terraphim-editor v0.1.0-rc.2 UI, WASM and source-p **Export Document Knowledge Graph** waits for the current edit to be acknowledged, reads that exact source, and uses the shared Rust `synonyms::` parser/types to create the portable graph. It refuses malformed annotations or ambiguous concepts. The document and active role are unchanged. Save, undo, redo and reopen determine which aliases exist in the export. +## Companion command-line tools + +The [packaged README](https://github.com/terraphim/terraphim-ai/blob/main/vs-code-terraphim-it/README.md#use-the-graph-with-terraphim-grep-and-terraphim-agent) includes runnable examples for both separately installed CLIs: `terraphim-grep` consumes the exported synonym graph, and `terraphim-agent` captures authored text and reads the saved memory item by its returned ID. The commands are checked against [clients v1.21.20](https://github.com/terraphim/terraphim-clients/releases/tag/v1.21.20). Neither executable is bundled with the extension, and agent memory capture does not import a graph or configure a role. + +The same packaged README supplies the Microsoft Marketplace and Open VSX listing content, including compatible Cursor installs. README changes reach those listings with the next qualified VSIX release; updating repository documentation alone does not update an existing immutable package. The Continue integration ships its own [README and direct CLI examples](https://github.com/terraphim/terraphim-ai/tree/main/integrations/continue#use-both-clis-directly) through its separate release workflow. + +## Building and publication + A fresh checkout runs `npm ci --ignore-scripts`, `npm run editor:fetch`, `npm run compile`, `npm run lint`, `npm run test:assets`, `npm run test:host`, `npm run test:export`, then `npm run package:vsix`. Release inputs are pinned by URL/commit/SHA-256 in `editor-release.json`; every imported file is checked. Runtime dependencies are included. Generated binaries stay out of Git. CI builds one VSIX and tests that package in native Linux, macOS and Windows VS Code profiles. Tag release and marketplace workflows promote the same verified package. Publisher identity setup is documented in `docs/plans/design-extension-marketplaces.md` in the repository. diff --git a/vs-code-terraphim-it/README.md b/vs-code-terraphim-it/README.md index ce834dbec..7210f0fdb 100644 --- a/vs-code-terraphim-it/README.md +++ b/vs-code-terraphim-it/README.md @@ -6,14 +6,61 @@ Keep alternatives beside your writing, swap wording, and share their knowledge g 2. Select a word such as **Risk**, add **Concern** as an alternative, and choose which wording is active. 3. Save the document. VS Code owns persistence and undo/redo; the annotation block preserves the alternatives. 4. Run **Terraphim: Export Document Knowledge Graph**, or use the editor's **Share with search** dialog. Save the JSON and export clean Markdown into a corpus folder. -5. Search it with a released CLI: +5. Use the exported graph with `terraphim-grep`, then preserve a useful decision with `terraphim-agent` as shown below. + +Exporting a graph is explicit: it does not automatically modify a shared role or upload your document. + +## Use the graph with terraphim-grep and terraphim-agent + +Install the two CLIs separately from the [Terraphim clients v1.21.20 release](https://github.com/terraphim/terraphim-clients/releases/tag/v1.21.20). Choose the archives for your operating system, verify them against that release's `SHA256SUMS`, extract them and put the executables on your `PATH`. The extension bundles its editor engine; it does not install either CLI. These examples were checked with both CLIs at **1.21.20** on macOS ARM64. Run the following in a terminal; the memory readback also uses Python 3. + +```sh +terraphim-grep --version +terraphim-agent --version +``` + +### Search by an alternative + +For a small example, write `Risk: supplier delays require a backup plan.` in the editor, add **Concern** as an alternative, and keep **Risk** active. Export the graph as `brief.knowledge-graph.json` and clean Markdown as `briefs/decision.md`. Keep only the clean brief in `briefs`, so a hit for Concern comes from the synonym graph rather than annotation text. + +The concept can also be written as a knowledge-base note using Logseq-compatible `synonyms::` syntax: + +```markdown +# Risk +synonyms:: Concern +``` + +The editor export is the compiled JSON representation used by the search command. + +```sh +terraphim-grep concern --search-only --haystack all \ + --paths ./briefs --thesaurus ./brief.knowledge-graph.json --json -n 3 +``` + +The returned `chunks` include the Risk sentence, while `answer` is `null`. See the [editor → synonym → search walkthrough](https://terraphim.ai/how-tos/synonym-search/) for the video and downloadable examples. + +For a corpus with several relevant passages, request synthesis explicitly: + +```sh +terraphim-grep concern --answer --haystack all \ + --paths ./briefs --thesaurus ./brief.knowledge-graph.json --json -n 3 +``` + +`--answer` uses your configured synthesis provider and can send retrieved context to it. Inspect the returned passages and citations alongside the answer. A small or unmatched corpus can return no generated answer. + +### Save a decision in agent memory + +`terraphim-agent` can retain authored text for later readback. This command writes to the current user's OS-local memory store (independent of the working directory); it does not import the editor's graph or configure a retrieval role. ```sh -terraphim-grep concern --paths ./briefs --thesaurus ./brief.knowledge-graph.json --search-only --json -terraphim-grep concern --paths ./briefs --thesaurus ./brief.knowledge-graph.json --answer --json +terraphim-agent --format json memory capture \ + --content 'Risk requires a Decision: approve a second supplier as the mitigation.' \ + --provenance-tag 'public-project-brief' > captured-memory.json +memory_id="$(python3 -c 'import json; print(json.load(open("captured-memory.json"))["memory_id"])')" +terraphim-agent memory show "$memory_id" --json ``` -The first command retrieves matching sources. `--answer` additionally uses your configured synthesis provider. Exporting a graph is explicit: it does not automatically modify a shared role or upload your document. +The readback's `memory_item.content` contains the authored sentence and its tags include `provenance:public-project-brief`. Use the returned ID, rather than copying an ID from an example. The [agent memory walkthrough](https://terraphim.ai/posts/cold-start-tax-agentic-memory/) explains retrieval and role setup; the [hooks walkthrough](https://terraphim.ai/posts/native-hook-support/) covers reviewed command corrections and actual tool execution. This preview targets desktop VS Code 1.126+. Editing and KG export run locally using bundled Terraphim WASM. Suggestions from the built-in graph are synonyms, not generated LLM rewrites. [Integration details and current acceptance scope](README-alternative-control.md). @@ -53,7 +100,7 @@ Configure the extension through VS Code settings: ## Getting Started -1. **Install the preview VSIX** from a qualified build; marketplace publication is a separate release gate +1. **Install Terraphim It** from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=applied-knowledge-systems.terraphim-it) or [Open VSX](https://open-vsx.org/extension/applied-knowledge-systems/terraphim-it). Compatible Cursor installations use the Open VSX package. 2. **Configure your server** settings in VS Code preferences 3. **Start your Terraphim server** (if using local server): ```bash