@flyingrobots/graft 0.7.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +202 -0
- package/GUIDE.md +8 -3
- package/README.md +128 -85
- package/dist/adapters/fake-echo-kernel-transport.d.ts +33 -0
- package/dist/adapters/fake-echo-kernel-transport.d.ts.map +1 -0
- package/dist/adapters/fake-echo-kernel-transport.js +208 -0
- package/dist/adapters/fake-echo-kernel-transport.js.map +1 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +2 -0
- package/dist/api/index.js.map +1 -1
- package/dist/cli/cli-error.d.ts.map +1 -1
- package/dist/cli/cli-error.js +22 -3
- package/dist/cli/cli-error.js.map +1 -1
- package/dist/cli/command-parser.d.ts.map +1 -1
- package/dist/cli/command-parser.js +62 -6
- package/dist/cli/command-parser.js.map +1 -1
- package/dist/cli/dead-symbols-render.d.ts +2 -0
- package/dist/cli/dead-symbols-render.d.ts.map +1 -0
- package/dist/cli/dead-symbols-render.js +23 -0
- package/dist/cli/dead-symbols-render.js.map +1 -0
- package/dist/cli/doctor-render.d.ts +2 -0
- package/dist/cli/doctor-render.d.ts.map +1 -0
- package/dist/cli/doctor-render.js +80 -0
- package/dist/cli/doctor-render.js.map +1 -0
- package/dist/cli/entrypoint.d.ts +1 -0
- package/dist/cli/entrypoint.d.ts.map +1 -1
- package/dist/cli/entrypoint.js +1 -0
- package/dist/cli/entrypoint.js.map +1 -1
- package/dist/cli/git-graft-enhance-model.d.ts +33 -3
- package/dist/cli/git-graft-enhance-model.d.ts.map +1 -1
- package/dist/cli/git-graft-enhance-model.js +38 -0
- package/dist/cli/git-graft-enhance-model.js.map +1 -1
- package/dist/cli/git-graft-enhance-render.d.ts.map +1 -1
- package/dist/cli/git-graft-enhance-render.js +13 -0
- package/dist/cli/git-graft-enhance-render.js.map +1 -1
- package/dist/cli/git-graft-enhance.d.ts.map +1 -1
- package/dist/cli/git-graft-enhance.js +44 -1
- package/dist/cli/git-graft-enhance.js.map +1 -1
- package/dist/cli/index-cmd.d.ts +1 -0
- package/dist/cli/index-cmd.d.ts.map +1 -1
- package/dist/cli/index-cmd.js +3 -0
- package/dist/cli/index-cmd.js.map +1 -1
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +24 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/peer-command.d.ts.map +1 -1
- package/dist/cli/peer-command.js +25 -0
- package/dist/cli/peer-command.js.map +1 -1
- package/dist/cli/review-cooldown.d.ts +15 -0
- package/dist/cli/review-cooldown.d.ts.map +1 -0
- package/dist/cli/review-cooldown.js +136 -0
- package/dist/cli/review-cooldown.js.map +1 -0
- package/dist/cli/structural-blame-render.d.ts +2 -0
- package/dist/cli/structural-blame-render.d.ts.map +1 -0
- package/dist/cli/structural-blame-render.js +42 -0
- package/dist/cli/structural-blame-render.js.map +1 -0
- package/dist/cli/structural-review-render.d.ts +2 -0
- package/dist/cli/structural-review-render.d.ts.map +1 -0
- package/dist/cli/structural-review-render.js +56 -0
- package/dist/cli/structural-review-render.js.map +1 -0
- package/dist/cli/structural-test-coverage-render.d.ts +2 -0
- package/dist/cli/structural-test-coverage-render.d.ts.map +1 -0
- package/dist/cli/structural-test-coverage-render.js +46 -0
- package/dist/cli/structural-test-coverage-render.js.map +1 -0
- package/dist/contracts/capabilities.d.ts +9 -6
- package/dist/contracts/capabilities.d.ts.map +1 -1
- package/dist/contracts/capabilities.js +54 -1
- package/dist/contracts/capabilities.js.map +1 -1
- package/dist/contracts/causal-ontology.d.ts +17 -17
- package/dist/contracts/output-schema-cli.d.ts +106 -41
- package/dist/contracts/output-schema-cli.d.ts.map +1 -1
- package/dist/contracts/output-schema-cli.js +29 -0
- package/dist/contracts/output-schema-cli.js.map +1 -1
- package/dist/contracts/output-schema-fragments.d.ts +238 -76
- package/dist/contracts/output-schema-fragments.d.ts.map +1 -1
- package/dist/contracts/output-schema-fragments.js +27 -0
- package/dist/contracts/output-schema-fragments.js.map +1 -1
- package/dist/contracts/output-schema-mcp.d.ts +171 -62
- package/dist/contracts/output-schema-mcp.d.ts.map +1 -1
- package/dist/contracts/output-schema-mcp.js +49 -22
- package/dist/contracts/output-schema-mcp.js.map +1 -1
- package/dist/contracts/output-schema-meta.d.ts +2 -2
- package/dist/contracts/output-schema-meta.d.ts.map +1 -1
- package/dist/contracts/output-schemas.d.ts +7 -7
- package/dist/contracts/output-schemas.d.ts.map +1 -1
- package/dist/contracts/output-schemas.js +101 -1
- package/dist/contracts/output-schemas.js.map +1 -1
- package/dist/echo/canonical-cbor.d.ts +10 -0
- package/dist/echo/canonical-cbor.d.ts.map +1 -0
- package/dist/echo/canonical-cbor.js +213 -0
- package/dist/echo/canonical-cbor.js.map +1 -0
- package/dist/echo/codec-runtime.d.ts +72 -0
- package/dist/echo/codec-runtime.d.ts.map +1 -0
- package/dist/echo/codec-runtime.js +259 -0
- package/dist/echo/codec-runtime.js.map +1 -0
- package/dist/echo/structural-history-client.d.ts +68 -0
- package/dist/echo/structural-history-client.d.ts.map +1 -0
- package/dist/echo/structural-history-client.js +149 -0
- package/dist/echo/structural-history-client.js.map +1 -0
- package/dist/echo/structural-history-envelope-codec.d.ts +46 -0
- package/dist/echo/structural-history-envelope-codec.d.ts.map +1 -0
- package/dist/echo/structural-history-envelope-codec.js +121 -0
- package/dist/echo/structural-history-envelope-codec.js.map +1 -0
- package/dist/echo/structural-reading-adapter.d.ts +13 -0
- package/dist/echo/structural-reading-adapter.d.ts.map +1 -0
- package/dist/echo/structural-reading-adapter.js +120 -0
- package/dist/echo/structural-reading-adapter.js.map +1 -0
- package/dist/generated/graft-structural-history.codec.generated.d.ts +135 -0
- package/dist/generated/graft-structural-history.codec.generated.d.ts.map +1 -0
- package/dist/generated/graft-structural-history.codec.generated.js +545 -0
- package/dist/generated/graft-structural-history.codec.generated.js.map +1 -0
- package/dist/generated/graft-structural-history.d.ts +331 -0
- package/dist/generated/graft-structural-history.d.ts.map +1 -0
- package/dist/generated/graft-structural-history.js +47 -0
- package/dist/generated/graft-structural-history.js.map +1 -0
- package/dist/git/version-guard.d.ts +17 -0
- package/dist/git/version-guard.d.ts.map +1 -0
- package/dist/git/version-guard.js +51 -0
- package/dist/git/version-guard.js.map +1 -0
- package/dist/hooks/posttooluse-read.js +2 -2
- package/dist/hooks/posttooluse-read.js.map +1 -1
- package/dist/mcp/burden.d.ts.map +1 -1
- package/dist/mcp/burden.js +4 -0
- package/dist/mcp/burden.js.map +1 -1
- package/dist/mcp/context.d.ts +5 -1
- package/dist/mcp/context.d.ts.map +1 -1
- package/dist/mcp/context.js +11 -1
- package/dist/mcp/context.js.map +1 -1
- package/dist/mcp/daemon-server.d.ts.map +1 -1
- package/dist/mcp/daemon-server.js +2 -0
- package/dist/mcp/daemon-server.js.map +1 -1
- package/dist/mcp/persisted-local-history-graph.d.ts.map +1 -1
- package/dist/mcp/persisted-local-history-graph.js +2 -1
- package/dist/mcp/persisted-local-history-graph.js.map +1 -1
- package/dist/mcp/persisted-local-history.d.ts +5 -5
- package/dist/mcp/repo-tool-job.d.ts.map +1 -1
- package/dist/mcp/repo-tool-job.js +2 -0
- package/dist/mcp/repo-tool-job.js.map +1 -1
- package/dist/mcp/repo-tool-worker-context.d.ts.map +1 -1
- package/dist/mcp/repo-tool-worker-context.js +19 -0
- package/dist/mcp/repo-tool-worker-context.js.map +1 -1
- package/dist/mcp/server-context.d.ts.map +1 -1
- package/dist/mcp/server-context.js +17 -0
- package/dist/mcp/server-context.js.map +1 -1
- package/dist/mcp/server-invocation.d.ts.map +1 -1
- package/dist/mcp/server-invocation.js +206 -147
- package/dist/mcp/server-invocation.js.map +1 -1
- package/dist/mcp/server-tool-access.d.ts.map +1 -1
- package/dist/mcp/server-tool-access.js +4 -0
- package/dist/mcp/server-tool-access.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +184 -116
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/stdio-server.d.ts.map +1 -1
- package/dist/mcp/stdio-server.js +2 -0
- package/dist/mcp/stdio-server.js.map +1 -1
- package/dist/mcp/tool-registry.d.ts.map +1 -1
- package/dist/mcp/tool-registry.js +9 -1
- package/dist/mcp/tool-registry.js.map +1 -1
- package/dist/mcp/tools/changed-since.d.ts.map +1 -1
- package/dist/mcp/tools/changed-since.js +10 -3
- package/dist/mcp/tools/changed-since.js.map +1 -1
- package/dist/mcp/tools/dead-symbols.d.ts +3 -0
- package/dist/mcp/tools/dead-symbols.d.ts.map +1 -0
- package/dist/mcp/tools/dead-symbols.js +32 -0
- package/dist/mcp/tools/dead-symbols.js.map +1 -0
- package/dist/mcp/tools/map.d.ts.map +1 -1
- package/dist/mcp/tools/map.js +2 -0
- package/dist/mcp/tools/map.js.map +1 -1
- package/dist/mcp/tools/precision-warp.d.ts.map +1 -1
- package/dist/mcp/tools/precision-warp.js +2 -6
- package/dist/mcp/tools/precision-warp.js.map +1 -1
- package/dist/mcp/tools/refactor-difficulty.d.ts.map +1 -1
- package/dist/mcp/tools/refactor-difficulty.js +2 -0
- package/dist/mcp/tools/refactor-difficulty.js.map +1 -1
- package/dist/mcp/tools/safe-read.d.ts.map +1 -1
- package/dist/mcp/tools/safe-read.js +10 -105
- package/dist/mcp/tools/safe-read.js.map +1 -1
- package/dist/mcp/tools/structural-blame.d.ts.map +1 -1
- package/dist/mcp/tools/structural-blame.js +3 -0
- package/dist/mcp/tools/structural-blame.js.map +1 -1
- package/dist/mcp/tools/structural-review.d.ts.map +1 -1
- package/dist/mcp/tools/structural-review.js +9 -22
- package/dist/mcp/tools/structural-review.js.map +1 -1
- package/dist/mcp/tools/structural-test-coverage.d.ts +3 -0
- package/dist/mcp/tools/structural-test-coverage.d.ts.map +1 -0
- package/dist/mcp/tools/structural-test-coverage.js +35 -0
- package/dist/mcp/tools/structural-test-coverage.js.map +1 -0
- package/dist/mcp/tools/workspace-list-opened.d.ts +3 -0
- package/dist/mcp/tools/workspace-list-opened.d.ts.map +1 -0
- package/dist/mcp/tools/workspace-list-opened.js +10 -0
- package/dist/mcp/tools/workspace-list-opened.js.map +1 -0
- package/dist/mcp/tools/workspace-open.d.ts +3 -0
- package/dist/mcp/tools/workspace-open.d.ts.map +1 -0
- package/dist/mcp/tools/workspace-open.js +34 -0
- package/dist/mcp/tools/workspace-open.js.map +1 -0
- package/dist/mcp/workspace-router-model.d.ts +27 -0
- package/dist/mcp/workspace-router-model.d.ts.map +1 -1
- package/dist/mcp/workspace-router-model.js.map +1 -1
- package/dist/mcp/workspace-router.d.ts +9 -2
- package/dist/mcp/workspace-router.d.ts.map +1 -1
- package/dist/mcp/workspace-router.js +145 -1
- package/dist/mcp/workspace-router.js.map +1 -1
- package/dist/operations/cached-file.d.ts +6 -2
- package/dist/operations/cached-file.d.ts.map +1 -1
- package/dist/operations/cached-file.js +30 -6
- package/dist/operations/cached-file.js.map +1 -1
- package/dist/operations/export-surface-diff.d.ts.map +1 -1
- package/dist/operations/export-surface-diff.js +2 -0
- package/dist/operations/export-surface-diff.js.map +1 -1
- package/dist/operations/file-outline.js +2 -2
- package/dist/operations/file-outline.js.map +1 -1
- package/dist/operations/graft-diff.d.ts.map +1 -1
- package/dist/operations/graft-diff.js +2 -0
- package/dist/operations/graft-diff.js.map +1 -1
- package/dist/operations/projection-safety.d.ts.map +1 -1
- package/dist/operations/projection-safety.js +2 -0
- package/dist/operations/projection-safety.js.map +1 -1
- package/dist/operations/repo-workspace.d.ts.map +1 -1
- package/dist/operations/repo-workspace.js +26 -8
- package/dist/operations/repo-workspace.js.map +1 -1
- package/dist/operations/review-cooldown-status.d.ts +27 -0
- package/dist/operations/review-cooldown-status.d.ts.map +1 -0
- package/dist/operations/review-cooldown-status.js +115 -0
- package/dist/operations/review-cooldown-status.js.map +1 -0
- package/dist/operations/safe-read.js +2 -2
- package/dist/operations/safe-read.js.map +1 -1
- package/dist/operations/sludge-detector.d.ts.map +1 -1
- package/dist/operations/sludge-detector.js +2 -1
- package/dist/operations/sludge-detector.js.map +1 -1
- package/dist/operations/structural-review.js +8 -8
- package/dist/operations/structural-review.js.map +1 -1
- package/dist/operations/structural-test-coverage-map.d.ts +44 -0
- package/dist/operations/structural-test-coverage-map.d.ts.map +1 -0
- package/dist/operations/structural-test-coverage-map.js +331 -0
- package/dist/operations/structural-test-coverage-map.js.map +1 -0
- package/dist/operations/structured-buffer-compare.d.ts.map +1 -1
- package/dist/operations/structured-buffer-compare.js +4 -1
- package/dist/operations/structured-buffer-compare.js.map +1 -1
- package/dist/operations/structured-buffer-model.d.ts +15 -13
- package/dist/operations/structured-buffer-model.d.ts.map +1 -1
- package/dist/operations/structured-buffer-model.js +24 -5
- package/dist/operations/structured-buffer-model.js.map +1 -1
- package/dist/operations/structured-buffer-query.d.ts.map +1 -1
- package/dist/operations/structured-buffer-query.js +21 -12
- package/dist/operations/structured-buffer-query.js.map +1 -1
- package/dist/parser/extractors/common.d.ts +16 -0
- package/dist/parser/extractors/common.d.ts.map +1 -0
- package/dist/parser/extractors/common.js +23 -0
- package/dist/parser/extractors/common.js.map +1 -0
- package/dist/parser/extractors/go.d.ts +18 -0
- package/dist/parser/extractors/go.d.ts.map +1 -0
- package/dist/parser/extractors/go.js +200 -0
- package/dist/parser/extractors/go.js.map +1 -0
- package/dist/parser/extractors/graphql.d.ts +26 -0
- package/dist/parser/extractors/graphql.d.ts.map +1 -0
- package/dist/parser/extractors/graphql.js +239 -0
- package/dist/parser/extractors/graphql.js.map +1 -0
- package/dist/parser/extractors/index.d.ts +4 -0
- package/dist/parser/extractors/index.d.ts.map +1 -0
- package/dist/parser/extractors/index.js +26 -0
- package/dist/parser/extractors/index.js.map +1 -0
- package/dist/parser/extractors/json.d.ts +10 -0
- package/dist/parser/extractors/json.d.ts.map +1 -0
- package/dist/parser/extractors/json.js +75 -0
- package/dist/parser/extractors/json.js.map +1 -0
- package/dist/parser/extractors/python.d.ts +16 -0
- package/dist/parser/extractors/python.d.ts.map +1 -0
- package/dist/parser/extractors/python.js +145 -0
- package/dist/parser/extractors/python.js.map +1 -0
- package/dist/parser/extractors/rust.d.ts +12 -0
- package/dist/parser/extractors/rust.d.ts.map +1 -0
- package/dist/parser/extractors/rust.js +122 -0
- package/dist/parser/extractors/rust.js.map +1 -0
- package/dist/parser/extractors/toml.d.ts +10 -0
- package/dist/parser/extractors/toml.d.ts.map +1 -0
- package/dist/parser/extractors/toml.js +74 -0
- package/dist/parser/extractors/toml.js.map +1 -0
- package/dist/parser/extractors/typescript.d.ts +13 -0
- package/dist/parser/extractors/typescript.d.ts.map +1 -0
- package/dist/parser/extractors/typescript.js +179 -0
- package/dist/parser/extractors/typescript.js.map +1 -0
- package/dist/parser/extractors/yaml.d.ts +13 -0
- package/dist/parser/extractors/yaml.d.ts.map +1 -0
- package/dist/parser/extractors/yaml.js +93 -0
- package/dist/parser/extractors/yaml.js.map +1 -0
- package/dist/parser/lang.d.ts +2 -2
- package/dist/parser/lang.d.ts.map +1 -1
- package/dist/parser/lang.js +19 -1
- package/dist/parser/lang.js.map +1 -1
- package/dist/parser/outline.d.ts +4 -0
- package/dist/parser/outline.d.ts.map +1 -1
- package/dist/parser/outline.js +32 -221
- package/dist/parser/outline.js.map +1 -1
- package/dist/parser/runtime.d.ts +7 -0
- package/dist/parser/runtime.d.ts.map +1 -1
- package/dist/parser/runtime.js +99 -10
- package/dist/parser/runtime.js.map +1 -1
- package/dist/parser/types.d.ts +1 -1
- package/dist/parser/types.d.ts.map +1 -1
- package/dist/parser/types.js.map +1 -1
- package/dist/ports/echo-kernel-transport.d.ts +12 -0
- package/dist/ports/echo-kernel-transport.d.ts.map +1 -0
- package/dist/ports/echo-kernel-transport.js +13 -0
- package/dist/ports/echo-kernel-transport.js.map +1 -0
- package/dist/ports/provenance-timeline.d.ts +10 -0
- package/dist/ports/provenance-timeline.d.ts.map +1 -0
- package/dist/ports/provenance-timeline.js +17 -0
- package/dist/ports/provenance-timeline.js.map +1 -0
- package/dist/ports/semantic-enrichment.d.ts +47 -0
- package/dist/ports/semantic-enrichment.d.ts.map +1 -0
- package/dist/ports/semantic-enrichment.js +2 -0
- package/dist/ports/semantic-enrichment.js.map +1 -0
- package/dist/ports/structural-reading.d.ts +100 -0
- package/dist/ports/structural-reading.d.ts.map +1 -0
- package/dist/ports/structural-reading.js +41 -0
- package/dist/ports/structural-reading.js.map +1 -0
- package/dist/warp/ast-import-resolver.d.ts.map +1 -1
- package/dist/warp/ast-import-resolver.js +2 -1
- package/dist/warp/ast-import-resolver.js.map +1 -1
- package/dist/warp/dead-symbols.d.ts.map +1 -1
- package/dist/warp/dead-symbols.js +4 -7
- package/dist/warp/dead-symbols.js.map +1 -1
- package/dist/warp/index-head.d.ts +4 -0
- package/dist/warp/index-head.d.ts.map +1 -1
- package/dist/warp/index-head.js +255 -22
- package/dist/warp/index-head.js.map +1 -1
- package/dist/warp/observers.d.ts.map +1 -1
- package/dist/warp/observers.js +3 -2
- package/dist/warp/observers.js.map +1 -1
- package/dist/warp/refactor-difficulty.d.ts.map +1 -1
- package/dist/warp/refactor-difficulty.js +4 -9
- package/dist/warp/refactor-difficulty.js.map +1 -1
- package/dist/warp/references.d.ts.map +1 -1
- package/dist/warp/references.js +2 -1
- package/dist/warp/references.js.map +1 -1
- package/dist/warp/semantic-enrichment.d.ts +14 -0
- package/dist/warp/semantic-enrichment.d.ts.map +1 -0
- package/dist/warp/semantic-enrichment.js +55 -0
- package/dist/warp/semantic-enrichment.js.map +1 -0
- package/dist/warp/structural-queries.d.ts.map +1 -1
- package/dist/warp/structural-queries.js +7 -14
- package/dist/warp/structural-queries.js.map +1 -1
- package/dist/warp/structural-reading-adapter.d.ts +28 -0
- package/dist/warp/structural-reading-adapter.d.ts.map +1 -0
- package/dist/warp/structural-reading-adapter.js +94 -0
- package/dist/warp/structural-reading-adapter.js.map +1 -0
- package/dist/warp/sym-id-codec.d.ts +14 -0
- package/dist/warp/sym-id-codec.d.ts.map +1 -0
- package/dist/warp/sym-id-codec.js +47 -0
- package/dist/warp/sym-id-codec.js.map +1 -0
- package/dist/warp/symbol-timeline.d.ts.map +1 -1
- package/dist/warp/symbol-timeline.js +6 -14
- package/dist/warp/symbol-timeline.js.map +1 -1
- package/dist/warp/warp-structural-churn.d.ts.map +1 -1
- package/dist/warp/warp-structural-churn.js +6 -10
- package/dist/warp/warp-structural-churn.js.map +1 -1
- package/dist/warp/warp-structural-log.d.ts.map +1 -1
- package/dist/warp/warp-structural-log.js +8 -10
- package/dist/warp/warp-structural-log.js.map +1 -1
- package/docs/CLI.md +63 -5
- package/docs/MCP.md +12 -6
- package/docs/SETUP.md +12 -6
- package/package.json +13 -4
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,208 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.9.0] - 2026-06-10
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Fake Echo-shaped TypeScript witness**: Graft proves its Echo-facing seam
|
|
15
|
+
before any real Echo runtime exists. The canonical schema gains its first
|
|
16
|
+
Intent (`recordGitWarpImportBatch`), Wesley 0.0.5 emits LE-binary var
|
|
17
|
+
codecs (`src/generated/graft-structural-history.codec.generated.ts`), and
|
|
18
|
+
a new app-safe stack — `EchoKernelTransport` byte seam, EINT v1 +
|
|
19
|
+
canonical-CBOR envelope codec, typed structural-history client, and an
|
|
20
|
+
Echo-backed `StructuralReadingPort` adapter mapping Echo's
|
|
21
|
+
`ContractObstructionKind` taxonomy into Graft freshness/residual posture —
|
|
22
|
+
is exercised end to end by a deterministic fake transport. The fake
|
|
23
|
+
mirrors Echo's wire-level authority enforcement (`FORBIDDEN_CONTROL_INTENT`
|
|
24
|
+
for the reserved control op id), and guard tests keep the Echo adapter out
|
|
25
|
+
of production contexts. No public surface changes.
|
|
26
|
+
- **Structural-history Echo package descriptor**: Graft now carries a
|
|
27
|
+
deterministic descriptor for the structural-history package it expects Echo
|
|
28
|
+
to host later, with repo-root-relative schema and generated-artifact
|
|
29
|
+
identities, descriptor-only Echo posture, and a local drift check wired into
|
|
30
|
+
`pnpm schema:structural-history:check`.
|
|
31
|
+
- **Structural history schema authority**: Graft now carries a canonical
|
|
32
|
+
`schemas/graft-structural-history.graphql` schema with Wesley-generated
|
|
33
|
+
TypeScript contracts and a deterministic artifact drift check, establishing
|
|
34
|
+
the schema-first Echo migration boundary without changing Echo or Wesley.
|
|
35
|
+
- **Structural source span invariants**: The canonical structural-history schema
|
|
36
|
+
now rejects source spans whose end offsets or present end lines precede their
|
|
37
|
+
starts.
|
|
38
|
+
- **Opened workspace paths**: MCP sessions can now call `workspace_open` to
|
|
39
|
+
open another git worktree path, activate it by default, and inspect opened
|
|
40
|
+
paths through `workspace_list_opened` without adding per-tool `cwd` routing.
|
|
41
|
+
- **Symbol history locations**: `graft_blame` and `graft symbol history`
|
|
42
|
+
now carry per-version path and available line-range facts from WARP symbol
|
|
43
|
+
timelines without adding a second `code_show` history response shape.
|
|
44
|
+
|
|
45
|
+
### Changed
|
|
46
|
+
|
|
47
|
+
- **Structural history generation gate**: `pnpm schema:structural-history:check`
|
|
48
|
+
now requires a configured Wesley CLI, verifies the pinned CLI version and L1
|
|
49
|
+
registry hash, regenerates the TypeScript artifact from GraphQL, and
|
|
50
|
+
byte-compares it with the committed generated file. CI and release workflows
|
|
51
|
+
install Wesley from a pinned release commit before running the check, and
|
|
52
|
+
`pnpm release:check` includes the same gate.
|
|
53
|
+
- **Structural reading boundary**: `graft_review` impact counts and
|
|
54
|
+
`graft_dead_symbols` now read through a Graft-owned
|
|
55
|
+
`StructuralReadingPort` with explicit `echo-native`,
|
|
56
|
+
`git-warp-imported`, and `fallback-translated` evidence labels, preserving
|
|
57
|
+
existing public response shapes while preventing current git-warp readings
|
|
58
|
+
from masquerading as Echo-native witnesshood.
|
|
59
|
+
|
|
60
|
+
### Fixed
|
|
61
|
+
|
|
62
|
+
- **Structural reading residual posture**: Reference-count readings now
|
|
63
|
+
report a partial residual posture when committed import-scan fallback
|
|
64
|
+
evidence is unavailable after a zero-count WARP graph reading.
|
|
65
|
+
|
|
66
|
+
### Security
|
|
67
|
+
|
|
68
|
+
- **Dependency audit posture**: Patched audited transitive dependencies through
|
|
69
|
+
pnpm overrides for `brace-expansion` and `qs`, preserving a clean release
|
|
70
|
+
security gate.
|
|
71
|
+
|
|
72
|
+
## [0.8.0] - 2026-05-13
|
|
73
|
+
|
|
74
|
+
### Added
|
|
75
|
+
|
|
76
|
+
- **Top-level structural review CLI**: `graft review --base <ref>
|
|
77
|
+
[--head <ref>]` now renders a human-readable structural review summary
|
|
78
|
+
from the existing `graft_review` model, while `--json` keeps the
|
|
79
|
+
schema-validated `graft.cli.struct_review` payload for agents.
|
|
80
|
+
- **Structural test coverage map**: `graft_test_coverage` and
|
|
81
|
+
`graft struct test-coverage [--src <path>] [--tests <path>]` now
|
|
82
|
+
report exported source symbols with or without bounded test-directory
|
|
83
|
+
references, explicitly labeled as structural/reference coverage rather
|
|
84
|
+
than execution coverage.
|
|
85
|
+
- **Git enhance provenance hints**: `git graft enhance --since <ref>`
|
|
86
|
+
now adds a bounded provenance-hints section for changed symbols using
|
|
87
|
+
WARP-backed blame facts when available, including ambiguity,
|
|
88
|
+
creation/signature-change commits, reference count, and unavailable
|
|
89
|
+
blame reasons.
|
|
90
|
+
- **Symbol history timeline**: `graft symbol history <symbol>
|
|
91
|
+
[--path <path>]` now renders a timeline-first human view over the
|
|
92
|
+
existing provenance-backed `graft_blame` facts while preserving the
|
|
93
|
+
`graft.cli.symbol_blame` JSON schema.
|
|
94
|
+
- **Dead symbol detection**: `graft_dead_symbols` and `graft struct
|
|
95
|
+
dead-symbols [--limit <n>]` now list symbols removed from indexed WARP
|
|
96
|
+
history and not subsequently re-added.
|
|
97
|
+
- **Review cooldown status helper**: `graft review cooldown [--pr
|
|
98
|
+
<number>]` now reads PR comments via `gh pr view --json comments`,
|
|
99
|
+
detects CodeRabbit rate-limit markers, and reports local ready,
|
|
100
|
+
cooldown, or unknown status; `--comments-file` supports fixture-backed
|
|
101
|
+
checks.
|
|
102
|
+
- **Rust structural parsing**: parser-backed outlines, governed reads,
|
|
103
|
+
structural diffs, and WARP indexing now recognize `.rs` files using
|
|
104
|
+
the bundled Rust tree-sitter grammar.
|
|
105
|
+
- **GraphQL structural parsing**: parser-backed outlines, governed
|
|
106
|
+
reads, structural diffs, and WARP indexing now recognize `.graphql`,
|
|
107
|
+
`.gql`, and `.graphqls` files using a compatible GraphQL
|
|
108
|
+
tree-sitter WASM grammar with GraphQL-specific outline kinds for
|
|
109
|
+
objects, fields, inputs, scalars, unions, directives, operations,
|
|
110
|
+
fragments, schema declarations, and enum values, with fixture coverage
|
|
111
|
+
for Continuum/Wesley-style contract schemas.
|
|
112
|
+
- **Python structural parsing**: parser-backed outlines, governed reads,
|
|
113
|
+
structural diffs, and WARP indexing now recognize `.py` and `.pyi`
|
|
114
|
+
files using the bundled Python tree-sitter grammar. Outlines cover
|
|
115
|
+
functions, async functions, classes, public methods, class fields, and
|
|
116
|
+
uppercase module constants.
|
|
117
|
+
- **Go structural parsing**: parser-backed outlines, governed reads,
|
|
118
|
+
structural diffs, and WARP indexing now recognize `.go` files using
|
|
119
|
+
the bundled Go tree-sitter grammar. Outlines cover packages,
|
|
120
|
+
functions, receiver methods, structs, interfaces, constants, and
|
|
121
|
+
variables.
|
|
122
|
+
- **JSON structured config projection**: parser-backed outlines,
|
|
123
|
+
governed reads, structural diffs, and WARP indexing now recognize
|
|
124
|
+
`.json` files using the bundled JSON tree-sitter grammar. Outlines
|
|
125
|
+
summarize top-level config keys with bounded nested object children.
|
|
126
|
+
- **TOML structured config projection**: parser-backed outlines,
|
|
127
|
+
governed reads, structural diffs, and WARP indexing now recognize
|
|
128
|
+
`.toml` files using the bundled TOML tree-sitter grammar. Outlines
|
|
129
|
+
summarize tables, array tables, and bounded package/tool fields.
|
|
130
|
+
- **YAML structured config projection**: parser-backed outlines,
|
|
131
|
+
governed reads, structural diffs, and WARP indexing now recognize
|
|
132
|
+
`.yaml` and `.yml` files using the bundled YAML tree-sitter grammar.
|
|
133
|
+
Outlines summarize top-level keys and bounded nested mapping anchors.
|
|
134
|
+
- **Docker auto-start helper**: the isolated test runner now attempts to
|
|
135
|
+
launch Docker Desktop on macOS before failing the Docker daemon
|
|
136
|
+
preflight, while keeping the existing explicit fallback guidance for
|
|
137
|
+
unsupported or failed startup paths.
|
|
138
|
+
- **Bounded WARP semantic enrichment seam**: `indexHead` accepts an
|
|
139
|
+
optional semantic enrichment provider for explicit-path indexing,
|
|
140
|
+
emits same-file `calls` edges and `typeof` symbol properties from
|
|
141
|
+
accepted provider facts, caps per-file semantic facts, and reports
|
|
142
|
+
unavailable providers without breaking tree-sitter indexing.
|
|
143
|
+
- **Git version startup guard**: CLI, stdio MCP, and daemon startup now
|
|
144
|
+
fail early when the installed Git is below the plumbing baseline
|
|
145
|
+
needed for flags such as `--path-format`. Hosts can also call
|
|
146
|
+
`ensureGitVersionSupportsGraft(...)` from the root package export.
|
|
147
|
+
- **Method glossary**: `docs/method/GLOSSARY.md` defines core project
|
|
148
|
+
terms including WARP, causal provenance, strand, worldline, checkout
|
|
149
|
+
epoch, and workspace overlay.
|
|
150
|
+
|
|
151
|
+
### Changed
|
|
152
|
+
|
|
153
|
+
- **Lazy parser runtime**: Tree-sitter and grammar WASM loading now
|
|
154
|
+
happens through an explicit `ensureParserReady()` path instead of
|
|
155
|
+
top-level await, reducing cold-start pressure for runtimes that do
|
|
156
|
+
not parse immediately.
|
|
157
|
+
- **MCP orchestration staging**: MCP invocation and server construction
|
|
158
|
+
are split into named stages and factories, preserving tool behavior
|
|
159
|
+
while reducing orchestration debt.
|
|
160
|
+
- **Unified governed read logic**: MCP `safe_read` delegates cache and
|
|
161
|
+
structural-diff decisions to `RepoWorkspace.safeRead`, keeping the
|
|
162
|
+
MCP and direct library surfaces aligned.
|
|
163
|
+
- **WARP symbol identity hardening**: symbol-id encoding and decoding
|
|
164
|
+
now route through `SymIdCodec`, and `indexHead` uses a lighter patch
|
|
165
|
+
payload estimator instead of serializing full patch JSON for budget
|
|
166
|
+
checks.
|
|
167
|
+
|
|
168
|
+
### Fixed
|
|
169
|
+
|
|
170
|
+
- **Structural test coverage review fix**: `graft struct
|
|
171
|
+
test-coverage` now skips tracked test files deleted from the working
|
|
172
|
+
tree before running reference searches, so unstaged or staged test
|
|
173
|
+
deletions degrade to uncovered symbols instead of failing on missing
|
|
174
|
+
paths.
|
|
175
|
+
- **Review truth follow-up**: CodeRabbit cooldown detection now ignores
|
|
176
|
+
unauthored rate-limit text by default, structural test coverage batches
|
|
177
|
+
symbol reference searches per run, CLI render schemas use strict object
|
|
178
|
+
definitions directly, and review-facing model/render tests cover empty
|
|
179
|
+
history plus provenance-hint output.
|
|
180
|
+
- **Review truth collision follow-up**: CodeRabbit cooldown detection now
|
|
181
|
+
returns unknown when any authored rate-limit marker lacks timestamp or
|
|
182
|
+
duration evidence, and structural test coverage avoids substring
|
|
183
|
+
matches while attributing duplicate exported symbol names to the
|
|
184
|
+
referenced source file.
|
|
185
|
+
- **Structural review PR feedback**: `graft review` and
|
|
186
|
+
`graft struct review` now require `--base` at parse time, nested
|
|
187
|
+
object-literal defaults no longer compact into malformed signatures,
|
|
188
|
+
and Rust impl/trait extraction uses the grammar's `body` field
|
|
189
|
+
without a dead fallback.
|
|
190
|
+
- **PR review hardening follow-up**: Docker auto-start polling no longer
|
|
191
|
+
uses `Atomics.wait` on the main thread, Docker probe subprocesses are
|
|
192
|
+
bounded, parser warmup fire-and-forget paths consume rejected promises,
|
|
193
|
+
`SymIdCodec` rejects malformed IDs and escapes delimiter characters,
|
|
194
|
+
WARP structural path filters are directory-boundary safe, the MCP server
|
|
195
|
+
passes injected Git clients through `ToolContext`, and playback tests avoid
|
|
196
|
+
Node 21-only `import.meta.dirname`.
|
|
197
|
+
- **Release gate stability**: the Docker-isolated test runner now bounds
|
|
198
|
+
default Vitest worker concurrency unless an explicit `--maxWorkers`
|
|
199
|
+
argument is supplied, keeping full-suite release validation stable under
|
|
200
|
+
constrained Docker resources.
|
|
201
|
+
- **Parser readiness follow-up**: root library hosts can now call
|
|
202
|
+
`ensureParserReady()` before synchronous structured-buffer use, while
|
|
203
|
+
pre-warm sync projection bundles return explicit partial parser
|
|
204
|
+
unavailable results instead of throwing. Outline cache writes are
|
|
205
|
+
best-effort after successful governed reads, lazy outline snapshots
|
|
206
|
+
share in-flight work, and WARP indexing reuses the parsed tree for
|
|
207
|
+
outline extraction.
|
|
208
|
+
- **Projection bundle README example**: direct `StructuredBuffer` usage
|
|
209
|
+
now shows explicit disposal, while `createProjectionBundle(...)` is
|
|
210
|
+
documented as the lifecycle-owning wrapper.
|
|
211
|
+
|
|
10
212
|
## [0.7.1] - 2026-04-30
|
|
11
213
|
|
|
12
214
|
### Fixed
|
package/GUIDE.md
CHANGED
|
@@ -18,7 +18,7 @@ Manually enforce policies or inspect structural history from your terminal.
|
|
|
18
18
|
### 3. Shared Daemon Mode
|
|
19
19
|
Run the central execution authority for multi-repo work and persistent monitors.
|
|
20
20
|
- **Run**: `npx @flyingrobots/graft daemon`
|
|
21
|
-
- **Read**: [docs/SETUP.md](./docs/SETUP.md) (Daemon bootstrap and `
|
|
21
|
+
- **Read**: [docs/SETUP.md](./docs/SETUP.md) (Daemon bootstrap and `workspace_open`)
|
|
22
22
|
- **Read**: [Architecture](./ARCHITECTURE.md) (Daemon section)
|
|
23
23
|
|
|
24
24
|
## Big Picture: System Orchestration
|
|
@@ -33,9 +33,9 @@ Graft is a tiered governor. It manages the context burden across three layers:
|
|
|
33
33
|
|
|
34
34
|
- [ ] **I am setting up a new project**: Start with `README.md` Quick Start.
|
|
35
35
|
- [ ] **I am configuring Claude Code**: Use `npx graft init --write-claude-hooks`.
|
|
36
|
-
- [ ] **I am using daemon mode in a generic MCP client**: Read [docs/SETUP.md](./docs/SETUP.md) and expect
|
|
36
|
+
- [ ] **I am using daemon mode in a generic MCP client**: Read [docs/SETUP.md](./docs/SETUP.md) and expect `workspace_open` as the normal agent-facing path.
|
|
37
37
|
- [ ] **I am debugging a structural diff**: Use `npx graft struct diff --json`.
|
|
38
|
-
- [ ] **I am contributing to Graft**: Read `METHOD.md
|
|
38
|
+
- [ ] **I am contributing to Graft**: Read `CONTRIBUTING.md`, `METHOD.md`, and [docs/github-issues-mirroring.md](./docs/github-issues-mirroring.md).
|
|
39
39
|
|
|
40
40
|
## Rule of Thumb
|
|
41
41
|
|
|
@@ -49,5 +49,10 @@ If you need to know "what's true right now," use [docs/BEARING.md](./docs/BEARIN
|
|
|
49
49
|
|
|
50
50
|
If you are just starting, use the [README.md](./README.md) and the setup instructions in [docs/SETUP.md](./docs/SETUP.md).
|
|
51
51
|
|
|
52
|
+
If you are reporting a bug or feature idea as a newcomer, use
|
|
53
|
+
[GitHub Issues](https://github.com/flyingrobots/graft/issues). Issues are
|
|
54
|
+
the public discovery surface; execution details stay in Method backlog and
|
|
55
|
+
design packets.
|
|
56
|
+
|
|
52
57
|
---
|
|
53
58
|
**The goal is inevitably. Every feature is defined by its tests.**
|
package/README.md
CHANGED
|
@@ -2,100 +2,132 @@
|
|
|
2
2
|
|
|
3
3
|
A context governor for coding agents. Graft enforces read policy so agents consume the smallest structurally correct view of a codebase instead of dumping raw files into their context window.
|
|
4
4
|
|
|
5
|
-
Graft is designed for the operator who demands precision and the architect who needs a stable foundation for agentic work. It scales from simple policy-aware reads to high-fidelity causal provenance tracking across multi-session worktrees.
|
|
6
|
-
|
|
7
5
|
[](https://www.npmjs.com/package/@flyingrobots/graft)
|
|
8
6
|
|
|
9
7
|

|
|
10
8
|
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## TL;DR — Up and Running in 30 Seconds
|
|
12
|
+
|
|
13
|
+
**What it is**: Graft sits between your AI coding agent and the filesystem. Instead of dumping entire files into the context window, it returns the minimum structurally correct view — full content for small files, AST-derived outlines for large ones, hard refusals for secrets and binaries. Every response carries a receipt so agents know exactly how much context they've consumed.
|
|
14
|
+
|
|
15
|
+
**Why you want it**: Agents that read files naively fill their context window with lockfiles, minified output, and 2,000-line modules they only needed 10 lines of. Graft fixes that automatically.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Install and bootstrap your repo
|
|
19
|
+
npx @flyingrobots/graft init --write-claude-hooks --write-codex-mcp
|
|
20
|
+
|
|
21
|
+
# Start serving (MCP over stdio — point your agent at this)
|
|
22
|
+
npx @flyingrobots/graft serve
|
|
23
|
+
|
|
24
|
+
# Or try a governed read from the CLI right now
|
|
25
|
+
npx @flyingrobots/graft read safe src/app.ts
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
That's it. `init` scaffolds `.graftignore` and writes the MCP config your agent needs. `serve` starts listening on stdio. Your agent calls `safe_read` instead of reading files directly, and Graft handles the rest.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## The Problem
|
|
33
|
+
|
|
34
|
+
AI coding agents read files the same way a first-year developer does: grab the whole thing, every time. A 2,000-line module goes straight into the context window. So does the lockfile. So does the compiled output. So does the `.env`.
|
|
35
|
+
|
|
36
|
+
Context windows are finite. Once they fill up, the agent starts forgetting what it already read. Performance degrades. Hallucinations increase. You burn tokens on noise.
|
|
37
|
+
|
|
38
|
+
Graft sits between the agent and the filesystem and enforces a simple rule: **return the minimum structurally correct view**.
|
|
39
|
+
|
|
40
|
+
- Small file? Full content.
|
|
41
|
+
- Large file? A structural outline — function names, signatures, line ranges. The agent can drill in with a range read if it needs a specific function body.
|
|
42
|
+
- Binary, secret, or lockfile? Hard refusal with a machine-readable reason code and a suggested alternative.
|
|
43
|
+
|
|
44
|
+
Every response carries a receipt: bytes consumed, bytes avoided, session depth, policy decision. Agents can self-regulate. Operators can audit.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
11
48
|
## Why Graft?
|
|
12
49
|
|
|
13
|
-
|
|
50
|
+
- **Parser-backed outlines.** Outlines come from Tree-Sitter ASTs, not heuristic line-scanning. Function signatures, class hierarchies, and jump tables are structurally accurate across JavaScript, TypeScript, Rust, Python, Go, GraphQL, JSON, TOML, YAML, Markdown, and more.
|
|
14
51
|
|
|
15
|
-
- **
|
|
16
|
-
- **Machine-Readable Contracts**: Responses carry versioned `_schema` metadata and decision receipts so agents can reason about outcomes without scraping prose.
|
|
17
|
-
- **Structural Memory**: Uses WARP (Structural Worldline Memory) to track AST evolution across Git commits. Query what changed structurally without reading a single byte of source code.
|
|
18
|
-
- **Causal Provenance**: Tracks the *why* behind structural changes by logging read, stage, and transition activity into strand-scoped causal workspaces.
|
|
19
|
-
- **Industrial-Grade Daemon**: A same-user local runtime that manages multi-repo authorization, background indexing, and shared-machine worker pools.
|
|
52
|
+
- **Machine-readable contracts.** Every response carries versioned `_schema` metadata and a decision receipt. Agents reason about outcomes without scraping prose. Receipts accumulate cumulative session stats so agents know when they're burning budget.
|
|
20
53
|
|
|
21
|
-
|
|
54
|
+
- **Structural memory across Git history.** WARP (Structural Worldline Memory) indexes AST outlines per commit into a Git-backed graph. Query what changed structurally — which symbols were added, removed, or renamed — without reading a single byte of source. No checkout required.
|
|
55
|
+
|
|
56
|
+
- **Session governance.** The `GovernorTracker` watches for anti-patterns: runaway tool loops, late-session large reads, edit/bash thrash. Tripwire signals surface in receipts so agents and operators can act before context is exhausted.
|
|
57
|
+
|
|
58
|
+
- **Industrial-grade daemon.** A same-user local runtime manages multi-repo authorization, background indexing, and shared worker pools. WARP graphs stay warm in memory across sessions. Multi-repo work happens without file conflicts.
|
|
59
|
+
|
|
60
|
+
---
|
|
22
61
|
|
|
23
|
-
|
|
62
|
+
## Four Official Surfaces
|
|
24
63
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
64
|
+
Graft exposes the same core capabilities through four integration points. Choose based on your deployment context.
|
|
65
|
+
|
|
66
|
+
### 1. CLI — Operator and Debugging Workflows
|
|
28
67
|
|
|
29
|
-
### 1. Bootstrap a Repo
|
|
30
|
-
Scaffold `.graftignore`, setup git hooks, and seed agent instructions.
|
|
31
68
|
```bash
|
|
32
|
-
npx @flyingrobots/graft
|
|
69
|
+
npx @flyingrobots/graft read safe src/app.ts
|
|
70
|
+
npx @flyingrobots/graft struct since HEAD~3
|
|
71
|
+
npx @flyingrobots/graft struct dead-symbols --limit 20
|
|
72
|
+
npx @flyingrobots/graft symbol history createUser --path src/users.ts
|
|
73
|
+
npx @flyingrobots/graft review --base HEAD~1
|
|
74
|
+
npx @flyingrobots/graft review cooldown --pr 48
|
|
33
75
|
```
|
|
34
76
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
77
|
+
Stateless. Print and exit. Good for scripting, spot-checking policy decisions, and inspecting structural history.
|
|
78
|
+
|
|
79
|
+
### 2. MCP Stdio — Repo-Local Agent Sessions
|
|
80
|
+
|
|
81
|
+
The simplest path for single-repo agent work. The current checkout is the authority. No workspace binding required.
|
|
82
|
+
|
|
39
83
|
```bash
|
|
40
84
|
npx @flyingrobots/graft serve
|
|
41
85
|
```
|
|
42
86
|
|
|
43
|
-
|
|
44
|
-
|
|
87
|
+
Point your MCP client at this process. Graft speaks JSON-RPC over stdin/stdout. The same binary auto-detects non-TTY stdio and enters serve mode automatically — so `npx @flyingrobots/graft` with no arguments works as an MCP server when piped.
|
|
88
|
+
|
|
89
|
+
### 3. MCP Daemon — Multi-Repo and Multi-Session
|
|
90
|
+
|
|
91
|
+
A persistent same-user runtime for long-running or multi-repo agent work. WARP graphs stay warm between sessions.
|
|
92
|
+
|
|
45
93
|
```bash
|
|
46
|
-
npx @flyingrobots/graft
|
|
47
|
-
npx @flyingrobots/graft struct since HEAD~3
|
|
94
|
+
npx @flyingrobots/graft daemon
|
|
48
95
|
```
|
|
49
96
|
|
|
50
|
-
|
|
51
|
-
Embed Graft in-process when you want direct access without MCP transport
|
|
52
|
-
or CLI process orchestration.
|
|
53
|
-
```ts
|
|
54
|
-
import { createRepoLocalGraft, callGraftTool } from "@flyingrobots/graft";
|
|
97
|
+
Daemon sessions start unbound. The normal agent flow:
|
|
55
98
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
99
|
+
1. `workspace_open` with the target repo's `cwd`
|
|
100
|
+
2. Optionally `workspace_list_opened` to inspect active workspaces
|
|
101
|
+
3. Use repository-scoped tools: `safe_read`, `file_outline`, `graft_diff`, etc.
|
|
102
|
+
|
|
103
|
+
See [docs/SETUP.md](./docs/SETUP.md) for client-specific bootstrap and daemon control-plane configuration.
|
|
59
104
|
|
|
60
|
-
|
|
61
|
-
lets host tools call Graft directly inside the same process.
|
|
105
|
+
### 4. Library API — In-Process Integration
|
|
62
106
|
|
|
63
|
-
|
|
64
|
-
|
|
107
|
+
Embed Graft directly when you want structural reads or syntax data without spawning a subprocess or going through MCP transport.
|
|
108
|
+
|
|
109
|
+
**Governed repo reads** (same policy enforcement as MCP, no receipts):
|
|
65
110
|
```ts
|
|
66
111
|
import { createRepoWorkspace } from "@flyingrobots/graft";
|
|
67
112
|
|
|
68
113
|
const workspace = await createRepoWorkspace({ cwd: process.cwd() });
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
const outline = await workspace.fileOutline({ path: "src/app.ts" });
|
|
114
|
+
const result = await workspace.safeRead({ path: "src/app.ts" });
|
|
115
|
+
// result.projection: "content" | "outline" | "refused"
|
|
72
116
|
```
|
|
73
117
|
|
|
74
|
-
|
|
75
|
-
surface uses for `safe_read`, `file_outline`, `read_range`, and
|
|
76
|
-
`changed_since`, but without going through MCP receipts at all.
|
|
77
|
-
|
|
78
|
-
For close editor integration, use the buffer-native surface directly:
|
|
118
|
+
**In-process tool calls with receipts** (full MCP behavior, no subprocess):
|
|
79
119
|
```ts
|
|
80
|
-
import {
|
|
120
|
+
import { createRepoLocalGraft, callGraftTool } from "@flyingrobots/graft";
|
|
81
121
|
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const spans = buffer.syntaxSpans({
|
|
86
|
-
viewport: {
|
|
87
|
-
start: { row: 0, column: 0 },
|
|
88
|
-
end: { row: 80, column: 0 },
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
const context = buffer.nodeAt({ row: 24, column: 12 });
|
|
92
|
-
const rename = buffer.renamePreview({
|
|
93
|
-
position: { row: 24, column: 12 },
|
|
94
|
-
nextName: "nextValue",
|
|
95
|
-
});
|
|
122
|
+
const graft = createRepoLocalGraft({ cwd: process.cwd() });
|
|
123
|
+
const outline = await callGraftTool(graft, "file_outline", { path: "src/app.ts" });
|
|
124
|
+
```
|
|
96
125
|
|
|
97
|
-
|
|
98
|
-
|
|
126
|
+
**Editor-native syntax highlighting** (Tree-Sitter WASM, no I/O, viewport-aware):
|
|
127
|
+
```ts
|
|
128
|
+
import { createProjectionBundle, ensureParserReady } from "@flyingrobots/graft";
|
|
129
|
+
|
|
130
|
+
await ensureParserReady();
|
|
99
131
|
|
|
100
132
|
const bundle = createProjectionBundle("src/app.tsx", liveEditorText, {
|
|
101
133
|
basis: { kind: "editor_head", headId: "head-42", tick: 17 },
|
|
@@ -104,40 +136,51 @@ const bundle = createProjectionBundle("src/app.tsx", liveEditorText, {
|
|
|
104
136
|
end: { row: 80, column: 0 },
|
|
105
137
|
},
|
|
106
138
|
});
|
|
107
|
-
|
|
108
|
-
console.log(bundle.parseStatus.status);
|
|
139
|
+
// bundle.syntax.spans — highlight ranges for the visible viewport only
|
|
109
140
|
```
|
|
110
141
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
142
|
+
`createProjectionBundle` owns the WASM buffer lifecycle internally. Use `createStructuredBuffer` directly if you need to hold a buffer across multiple operations and manage `dispose()` yourself.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Quick Start
|
|
147
|
+
|
|
114
148
|
```bash
|
|
115
|
-
|
|
149
|
+
# 1. Bootstrap the repo: scaffold .graftignore, seed agent instructions
|
|
150
|
+
npx @flyingrobots/graft init --write-claude-hooks --write-codex-mcp
|
|
151
|
+
|
|
152
|
+
# 2. Start serving (repo-local stdio MCP)
|
|
153
|
+
npx @flyingrobots/graft serve
|
|
116
154
|
```
|
|
117
155
|
|
|
118
|
-
|
|
119
|
-
daemon instead of repo-local stdio, the first repo-scoped flow is:
|
|
156
|
+
## Contributing with public visibility
|
|
120
157
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
158
|
+
For bugs, capability requests, and ideas, start at
|
|
159
|
+
[GitHub Issues](https://github.com/flyingrobots/graft/issues).
|
|
160
|
+
That queue is the public view for priorities and discussion. Internal execution and design rigor still lives in
|
|
161
|
+
`docs/method/backlog/` and `docs/design/` so details remain deterministic for contributors.
|
|
124
162
|
|
|
125
|
-
|
|
126
|
-
daemon control-plane posture.
|
|
163
|
+
---
|
|
127
164
|
|
|
128
165
|
## Documentation
|
|
129
166
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
167
|
+
| Document | What it covers |
|
|
168
|
+
|----------|---------------|
|
|
169
|
+
| [Technical Teardown](./docs/TECHNICAL_TEARDOWN.md) | Zero-to-hero deep dive: entry points, golden paths, data schemas, policy engine, WARP, session governance, trade-offs |
|
|
170
|
+
| [Guide](./GUIDE.md) | Orientation, the fast path, and agent bootstrap |
|
|
171
|
+
| [Setup Guide](./docs/SETUP.md) | Client-specific MCP setup, daemon posture, and workspace binding |
|
|
172
|
+
| [Advanced Guide](./ADVANCED_GUIDE.md) | Pipeline internals, worldlines, and daemon mechanics |
|
|
173
|
+
| [Architecture](./ARCHITECTURE.md) | Authoritative structural reference: Ports, Adapters, WARP |
|
|
174
|
+
| [Public API Contract](./docs/public-api.md) | Semver-public root import surface and stability policy |
|
|
175
|
+
| [Three-Surface Capability Matrix](./docs/three-surface-capability-matrix.md) | API / CLI / MCP feature baseline and peer posture |
|
|
176
|
+
| [Repo Topology](./docs/repo-topology.md) | Where API, CLI, MCP, and core live in the source tree |
|
|
177
|
+
| [Security Model](./docs/strategy/security-model.md) | Same-user daemon trust boundaries, authz, and observability |
|
|
178
|
+
| [Causal Provenance](./docs/strategy/causal-provenance.md) | Transport sessions, causal workspaces, strands, and handoff truth |
|
|
179
|
+
| [North Star](./NORTHSTAR.md) | Long-term stack position and Continuum-shaped direction |
|
|
180
|
+
| [Vision](./docs/VISION.md) | Core tenets and the provenance-aware mission |
|
|
181
|
+
| [Method](./METHOD.md) | Repo work doctrine and the cycle loop |
|
|
182
|
+
| [Issue visibility and backlog mapping](./docs/github-issues-mirroring.md) | Public issue triage plus internal backlog synchronization |
|
|
141
183
|
|
|
142
184
|
---
|
|
185
|
+
|
|
143
186
|
Built with precision by [FLYING ROBOTS](https://github.com/flyingrobots)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type EchoKernelTransport } from "../ports/echo-kernel-transport.js";
|
|
2
|
+
export interface FakeDeadSymbolFixture {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly kind: string;
|
|
5
|
+
readonly filePath: string;
|
|
6
|
+
readonly exported: boolean;
|
|
7
|
+
readonly removedInCommit: string;
|
|
8
|
+
}
|
|
9
|
+
export interface FakeSymbolReferenceFixture {
|
|
10
|
+
readonly symbol: string;
|
|
11
|
+
readonly filePath: string;
|
|
12
|
+
readonly referenceCount: number;
|
|
13
|
+
readonly referencingFiles: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
export interface FakeQueryObstructionFixture {
|
|
16
|
+
readonly code: string;
|
|
17
|
+
readonly message: string;
|
|
18
|
+
readonly recovery?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface FakeEchoFixture {
|
|
21
|
+
readonly basisId?: string;
|
|
22
|
+
readonly deadSymbols?: readonly FakeDeadSymbolFixture[];
|
|
23
|
+
readonly symbolReferences?: readonly FakeSymbolReferenceFixture[];
|
|
24
|
+
readonly rejectImportBatchIds?: readonly string[];
|
|
25
|
+
readonly admissionObstructedBatchIds?: readonly string[];
|
|
26
|
+
readonly queryObstruction?: FakeQueryObstructionFixture;
|
|
27
|
+
readonly retainedEvidencePosture?: "retained" | "missing" | "obstructed";
|
|
28
|
+
}
|
|
29
|
+
export interface CreateFakeEchoKernelTransportOptions {
|
|
30
|
+
readonly fixture?: FakeEchoFixture;
|
|
31
|
+
}
|
|
32
|
+
export declare function createFakeEchoKernelTransport(options?: CreateFakeEchoKernelTransportOptions): EchoKernelTransport;
|
|
33
|
+
//# sourceMappingURL=fake-echo-kernel-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fake-echo-kernel-transport.d.ts","sourceRoot":"","sources":["../../src/adapters/fake-echo-kernel-transport.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,mCAAmC,CAAC;AA0B3C,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9C;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACxD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,0BAA0B,EAAE,CAAC;IAClE,QAAQ,CAAC,oBAAoB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClD,QAAQ,CAAC,2BAA2B,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACzD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,2BAA2B,CAAC;IACxD,QAAQ,CAAC,uBAAuB,CAAC,EAAE,UAAU,GAAG,SAAS,GAAG,YAAY,CAAC;CAC1E;AAED,MAAM,WAAW,oCAAoC;IACnD,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC;CACpC;AAkDD,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,oCAAyC,GACjD,mBAAmB,CA6JrB"}
|