@aligndottech/cli 0.49.0 → 0.50.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/README.md +4 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +26 -8
- package/dist/cli.js.map +1 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +4 -1
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +18 -2
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/connect.d.ts +5 -0
- package/dist/commands/connect.d.ts.map +1 -1
- package/dist/commands/connect.js +24 -0
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/import/confluence.d.ts.map +1 -1
- package/dist/commands/import/confluence.js +24 -5
- package/dist/commands/import/confluence.js.map +1 -1
- package/dist/commands/import/docs.js +2 -2
- package/dist/commands/import/git.d.ts.map +1 -1
- package/dist/commands/import/git.js +15 -5
- package/dist/commands/import/git.js.map +1 -1
- package/dist/commands/import/github.d.ts.map +1 -1
- package/dist/commands/import/github.js +34 -7
- package/dist/commands/import/github.js.map +1 -1
- package/dist/commands/import/gitlab.d.ts.map +1 -1
- package/dist/commands/import/gitlab.js +10 -5
- package/dist/commands/import/gitlab.js.map +1 -1
- package/dist/commands/import/jira.d.ts.map +1 -1
- package/dist/commands/import/jira.js +10 -5
- package/dist/commands/import/jira.js.map +1 -1
- package/dist/commands/import/linear.d.ts.map +1 -1
- package/dist/commands/import/linear.js +10 -5
- package/dist/commands/import/linear.js.map +1 -1
- package/dist/commands/import/notion.d.ts.map +1 -1
- package/dist/commands/import/notion.js +10 -5
- package/dist/commands/import/notion.js.map +1 -1
- package/dist/commands/import/sessions.js +2 -2
- package/dist/commands/import/slack.d.ts.map +1 -1
- package/dist/commands/import/slack.js +12 -7
- package/dist/commands/import/slack.js.map +1 -1
- package/dist/commands/import/teams.d.ts.map +1 -1
- package/dist/commands/import/teams.js +10 -5
- package/dist/commands/import/teams.js.map +1 -1
- package/dist/commands/import/zoom.d.ts.map +1 -1
- package/dist/commands/import/zoom.js +10 -5
- package/dist/commands/import/zoom.js.map +1 -1
- package/dist/commands/import.d.ts.map +1 -1
- package/dist/commands/import.js +43 -1
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/local.d.ts.map +1 -1
- package/dist/commands/local.js +76 -4
- package/dist/commands/local.js.map +1 -1
- package/dist/commands/mark.d.ts +37 -0
- package/dist/commands/mark.d.ts.map +1 -0
- package/dist/commands/mark.js +105 -0
- package/dist/commands/mark.js.map +1 -0
- package/dist/commands/mcp.d.ts +141 -2
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +72 -14
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/registry.d.ts.map +1 -1
- package/dist/commands/registry.js +8 -2
- package/dist/commands/registry.js.map +1 -1
- package/dist/commands/setup.d.ts +39 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +65 -50
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/share.d.ts +7 -0
- package/dist/commands/share.d.ts.map +1 -0
- package/dist/commands/share.js +60 -0
- package/dist/commands/share.js.map +1 -0
- package/dist/commands/sync.d.ts +55 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +278 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/telemetry.d.ts +3 -3
- package/dist/commands/telemetry.js +6 -6
- package/dist/commands/telemetry.js.map +1 -1
- package/dist/commands/why.d.ts.map +1 -1
- package/dist/commands/why.js +6 -1
- package/dist/commands/why.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/backfill-state.d.ts +116 -0
- package/dist/lib/backfill-state.d.ts.map +1 -0
- package/dist/lib/backfill-state.js +342 -0
- package/dist/lib/backfill-state.js.map +1 -0
- package/dist/lib/backup-copy.d.ts +17 -0
- package/dist/lib/backup-copy.d.ts.map +1 -0
- package/dist/lib/backup-copy.js +13 -0
- package/dist/lib/backup-copy.js.map +1 -0
- package/dist/lib/capture-report.d.ts +22 -18
- package/dist/lib/capture-report.d.ts.map +1 -1
- package/dist/lib/capture-report.js +64 -2
- package/dist/lib/capture-report.js.map +1 -1
- package/dist/lib/config.d.ts +31 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +139 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/confirm-timeout.d.ts +8 -0
- package/dist/lib/confirm-timeout.d.ts.map +1 -0
- package/dist/lib/confirm-timeout.js +18 -0
- package/dist/lib/confirm-timeout.js.map +1 -0
- package/dist/lib/curation/check-marks.d.ts +48 -0
- package/dist/lib/curation/check-marks.d.ts.map +1 -0
- package/dist/lib/curation/check-marks.js +81 -0
- package/dist/lib/curation/check-marks.js.map +1 -0
- package/dist/lib/curation/guardrail.d.ts +39 -0
- package/dist/lib/curation/guardrail.d.ts.map +1 -0
- package/dist/lib/curation/guardrail.js +93 -0
- package/dist/lib/curation/guardrail.js.map +1 -0
- package/dist/lib/curation/judge.d.ts +3 -0
- package/dist/lib/curation/judge.d.ts.map +1 -0
- package/dist/lib/curation/judge.js +9 -0
- package/dist/lib/curation/judge.js.map +1 -0
- package/dist/lib/curation/judgements-db.d.ts +96 -0
- package/dist/lib/curation/judgements-db.d.ts.map +1 -0
- package/dist/lib/curation/judgements-db.js +200 -0
- package/dist/lib/curation/judgements-db.js.map +1 -0
- package/dist/lib/curation/last-check.d.ts +32 -0
- package/dist/lib/curation/last-check.d.ts.map +1 -0
- package/dist/lib/curation/last-check.js +81 -0
- package/dist/lib/curation/last-check.js.map +1 -0
- package/dist/lib/curation/mark.d.ts +76 -0
- package/dist/lib/curation/mark.d.ts.map +1 -0
- package/dist/lib/curation/mark.js +359 -0
- package/dist/lib/curation/mark.js.map +1 -0
- package/dist/lib/curation/text.d.ts +6 -0
- package/dist/lib/curation/text.d.ts.map +1 -0
- package/dist/lib/curation/text.js +35 -0
- package/dist/lib/curation/text.js.map +1 -0
- package/dist/lib/fetchers/capture.d.ts +49 -2
- package/dist/lib/fetchers/capture.d.ts.map +1 -1
- package/dist/lib/fetchers/capture.js +7 -1
- package/dist/lib/fetchers/capture.js.map +1 -1
- package/dist/lib/fetchers/confluence.d.ts +2 -2
- package/dist/lib/fetchers/confluence.d.ts.map +1 -1
- package/dist/lib/fetchers/confluence.js.map +1 -1
- package/dist/lib/fetchers/git.d.ts +1 -0
- package/dist/lib/fetchers/git.d.ts.map +1 -1
- package/dist/lib/fetchers/git.js +3 -1
- package/dist/lib/fetchers/git.js.map +1 -1
- package/dist/lib/fetchers/github.d.ts +44 -5
- package/dist/lib/fetchers/github.d.ts.map +1 -1
- package/dist/lib/fetchers/github.js +122 -5
- package/dist/lib/fetchers/github.js.map +1 -1
- package/dist/lib/fetchers/gitlab.d.ts +2 -2
- package/dist/lib/fetchers/gitlab.d.ts.map +1 -1
- package/dist/lib/fetchers/gitlab.js.map +1 -1
- package/dist/lib/fetchers/jira.d.ts +2 -2
- package/dist/lib/fetchers/jira.d.ts.map +1 -1
- package/dist/lib/fetchers/jira.js.map +1 -1
- package/dist/lib/fetchers/linear.d.ts +2 -2
- package/dist/lib/fetchers/linear.d.ts.map +1 -1
- package/dist/lib/fetchers/linear.js.map +1 -1
- package/dist/lib/fetchers/notion.d.ts +2 -2
- package/dist/lib/fetchers/notion.d.ts.map +1 -1
- package/dist/lib/fetchers/notion.js.map +1 -1
- package/dist/lib/fetchers/slack.d.ts +2 -3
- package/dist/lib/fetchers/slack.d.ts.map +1 -1
- package/dist/lib/fetchers/slack.js.map +1 -1
- package/dist/lib/fetchers/teams.d.ts +2 -2
- package/dist/lib/fetchers/teams.d.ts.map +1 -1
- package/dist/lib/fetchers/teams.js.map +1 -1
- package/dist/lib/fetchers/zoom.d.ts +2 -2
- package/dist/lib/fetchers/zoom.d.ts.map +1 -1
- package/dist/lib/fetchers/zoom.js.map +1 -1
- package/dist/lib/gateway-client.d.ts +34 -0
- package/dist/lib/gateway-client.d.ts.map +1 -1
- package/dist/lib/gateway-client.js +19 -1
- package/dist/lib/gateway-client.js.map +1 -1
- package/dist/lib/github-text.d.ts +3 -0
- package/dist/lib/github-text.d.ts.map +1 -0
- package/dist/lib/github-text.js +18 -0
- package/dist/lib/github-text.js.map +1 -0
- package/dist/lib/hook-context.d.ts +10 -0
- package/dist/lib/hook-context.d.ts.map +1 -1
- package/dist/lib/hook-context.js +14 -0
- package/dist/lib/hook-context.js.map +1 -1
- package/dist/lib/import-defaults.d.ts +39 -23
- package/dist/lib/import-defaults.d.ts.map +1 -1
- package/dist/lib/import-defaults.js +28 -26
- package/dist/lib/import-defaults.js.map +1 -1
- package/dist/lib/launch/adapters/aider.d.ts +17 -0
- package/dist/lib/launch/adapters/aider.d.ts.map +1 -0
- package/dist/lib/launch/adapters/aider.js +30 -0
- package/dist/lib/launch/adapters/aider.js.map +1 -0
- package/dist/lib/launch/adapters/auggie.d.ts +18 -0
- package/dist/lib/launch/adapters/auggie.d.ts.map +1 -0
- package/dist/lib/launch/adapters/auggie.js +34 -0
- package/dist/lib/launch/adapters/auggie.js.map +1 -0
- package/dist/lib/launch/adapters/cline.d.ts +10 -0
- package/dist/lib/launch/adapters/cline.d.ts.map +1 -0
- package/dist/lib/launch/adapters/cline.js +41 -0
- package/dist/lib/launch/adapters/cline.js.map +1 -0
- package/dist/lib/launch/adapters/continue.d.ts +22 -0
- package/dist/lib/launch/adapters/continue.d.ts.map +1 -0
- package/dist/lib/launch/adapters/continue.js +46 -0
- package/dist/lib/launch/adapters/continue.js.map +1 -0
- package/dist/lib/launch/adapters/gemini-cli.d.ts +13 -14
- package/dist/lib/launch/adapters/gemini-cli.d.ts.map +1 -1
- package/dist/lib/launch/adapters/gemini-cli.js +38 -53
- package/dist/lib/launch/adapters/gemini-cli.js.map +1 -1
- package/dist/lib/launch/adapters/goose.d.ts +20 -0
- package/dist/lib/launch/adapters/goose.d.ts.map +1 -0
- package/dist/lib/launch/adapters/goose.js +47 -0
- package/dist/lib/launch/adapters/goose.js.map +1 -0
- package/dist/lib/launch/adapters/notes.d.ts +7 -0
- package/dist/lib/launch/adapters/notes.d.ts.map +1 -0
- package/dist/lib/launch/adapters/notes.js +5 -0
- package/dist/lib/launch/adapters/notes.js.map +1 -0
- package/dist/lib/launch/agents.d.ts +2 -0
- package/dist/lib/launch/agents.d.ts.map +1 -1
- package/dist/lib/launch/agents.js +3 -1
- package/dist/lib/launch/agents.js.map +1 -1
- package/dist/lib/launch/auggie-state.d.ts +25 -0
- package/dist/lib/launch/auggie-state.d.ts.map +1 -0
- package/dist/lib/launch/auggie-state.js +74 -0
- package/dist/lib/launch/auggie-state.js.map +1 -0
- package/dist/lib/launch/cline-state.d.ts +32 -0
- package/dist/lib/launch/cline-state.d.ts.map +1 -0
- package/dist/lib/launch/cline-state.js +108 -0
- package/dist/lib/launch/cline-state.js.map +1 -0
- package/dist/lib/launch/config-writes.d.ts +4 -0
- package/dist/lib/launch/config-writes.d.ts.map +1 -1
- package/dist/lib/launch/config-writes.js +8 -3
- package/dist/lib/launch/config-writes.js.map +1 -1
- package/dist/lib/launch/continue-state.d.ts +41 -0
- package/dist/lib/launch/continue-state.d.ts.map +1 -0
- package/dist/lib/launch/continue-state.js +142 -0
- package/dist/lib/launch/continue-state.js.map +1 -0
- package/dist/lib/launch/detect.d.ts.map +1 -1
- package/dist/lib/launch/detect.js +3 -1
- package/dist/lib/launch/detect.js.map +1 -1
- package/dist/lib/launch/gemini-state.d.ts +26 -20
- package/dist/lib/launch/gemini-state.d.ts.map +1 -1
- package/dist/lib/launch/gemini-state.js +95 -37
- package/dist/lib/launch/gemini-state.js.map +1 -1
- package/dist/lib/launch/gemini-system-file.d.ts +17 -0
- package/dist/lib/launch/gemini-system-file.d.ts.map +1 -0
- package/dist/lib/launch/gemini-system-file.js +55 -0
- package/dist/lib/launch/gemini-system-file.js.map +1 -0
- package/dist/lib/launch/gemini-trust.d.ts +3 -1
- package/dist/lib/launch/gemini-trust.d.ts.map +1 -1
- package/dist/lib/launch/gemini-trust.js +10 -3
- package/dist/lib/launch/gemini-trust.js.map +1 -1
- package/dist/lib/launch/goose-state.d.ts +53 -0
- package/dist/lib/launch/goose-state.d.ts.map +1 -0
- package/dist/lib/launch/goose-state.js +137 -0
- package/dist/lib/launch/goose-state.js.map +1 -0
- package/dist/lib/launch/launch-files.d.ts.map +1 -1
- package/dist/lib/launch/launch-files.js +3 -2
- package/dist/lib/launch/launch-files.js.map +1 -1
- package/dist/lib/launch/launch.d.ts +17 -2
- package/dist/lib/launch/launch.d.ts.map +1 -1
- package/dist/lib/launch/launch.js +36 -3
- package/dist/lib/launch/launch.js.map +1 -1
- package/dist/lib/launch/mcp-child-env.d.ts +30 -0
- package/dist/lib/launch/mcp-child-env.d.ts.map +1 -0
- package/dist/lib/launch/mcp-child-env.js +151 -0
- package/dist/lib/launch/mcp-child-env.js.map +1 -0
- package/dist/lib/launch/pick-agent.d.ts.map +1 -1
- package/dist/lib/launch/pick-agent.js +4 -4
- package/dist/lib/launch/pick-agent.js.map +1 -1
- package/dist/lib/launch/picker-options.d.ts.map +1 -1
- package/dist/lib/launch/picker-options.js +7 -2
- package/dist/lib/launch/picker-options.js.map +1 -1
- package/dist/lib/launch/registry/agents/aider.d.ts +3 -0
- package/dist/lib/launch/registry/agents/aider.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/aider.js +13 -0
- package/dist/lib/launch/registry/agents/aider.js.map +1 -0
- package/dist/lib/launch/registry/agents/auggie.d.ts +3 -0
- package/dist/lib/launch/registry/agents/auggie.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/auggie.js +11 -0
- package/dist/lib/launch/registry/agents/auggie.js.map +1 -0
- package/dist/lib/launch/registry/agents/cline.d.ts +3 -0
- package/dist/lib/launch/registry/agents/cline.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/cline.js +19 -0
- package/dist/lib/launch/registry/agents/cline.js.map +1 -0
- package/dist/lib/launch/registry/agents/continue.d.ts +3 -0
- package/dist/lib/launch/registry/agents/continue.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/continue.js +20 -0
- package/dist/lib/launch/registry/agents/continue.js.map +1 -0
- package/dist/lib/launch/registry/agents/gemini-cli.js +2 -2
- package/dist/lib/launch/registry/agents/gemini-cli.js.map +1 -1
- package/dist/lib/launch/registry/agents/goose.d.ts +3 -0
- package/dist/lib/launch/registry/agents/goose.d.ts.map +1 -0
- package/dist/lib/launch/registry/agents/goose.js +20 -0
- package/dist/lib/launch/registry/agents/goose.js.map +1 -0
- package/dist/lib/launch/registry/index.d.ts +1 -1
- package/dist/lib/launch/registry/index.d.ts.map +1 -1
- package/dist/lib/launch/registry/index.js +7 -2
- package/dist/lib/launch/registry/index.js.map +1 -1
- package/dist/lib/launch/registry/types.d.ts +12 -1
- package/dist/lib/launch/registry/types.d.ts.map +1 -1
- package/dist/lib/launch/strict-entry.d.ts +22 -2
- package/dist/lib/launch/strict-entry.d.ts.map +1 -1
- package/dist/lib/launch/strict-entry.js +80 -2
- package/dist/lib/launch/strict-entry.js.map +1 -1
- package/dist/lib/launch/yaml-scan.d.ts +59 -0
- package/dist/lib/launch/yaml-scan.d.ts.map +1 -0
- package/dist/lib/launch/yaml-scan.js +275 -0
- package/dist/lib/launch/yaml-scan.js.map +1 -0
- package/dist/lib/local-db-epoch.d.ts +4 -0
- package/dist/lib/local-db-epoch.d.ts.map +1 -0
- package/dist/lib/local-db-epoch.js +19 -0
- package/dist/lib/local-db-epoch.js.map +1 -0
- package/dist/lib/local-db-migrate.d.ts +85 -0
- package/dist/lib/local-db-migrate.d.ts.map +1 -0
- package/dist/lib/local-db-migrate.js +484 -0
- package/dist/lib/local-db-migrate.js.map +1 -0
- package/dist/lib/local-db-v10.d.ts +28 -0
- package/dist/lib/local-db-v10.d.ts.map +1 -0
- package/dist/lib/local-db-v10.js +49 -0
- package/dist/lib/local-db-v10.js.map +1 -0
- package/dist/lib/local-db-v11.d.ts +24 -0
- package/dist/lib/local-db-v11.d.ts.map +1 -0
- package/dist/lib/local-db-v11.js +25 -0
- package/dist/lib/local-db-v11.js.map +1 -0
- package/dist/lib/local-db-v7.d.ts +30 -0
- package/dist/lib/local-db-v7.d.ts.map +1 -0
- package/dist/lib/local-db-v7.js +285 -0
- package/dist/lib/local-db-v7.js.map +1 -0
- package/dist/lib/local-db-v8.d.ts +22 -0
- package/dist/lib/local-db-v8.d.ts.map +1 -0
- package/dist/lib/local-db-v8.js +33 -0
- package/dist/lib/local-db-v8.js.map +1 -0
- package/dist/lib/local-db-v9.d.ts +10 -0
- package/dist/lib/local-db-v9.d.ts.map +1 -0
- package/dist/lib/local-db-v9.js +8 -0
- package/dist/lib/local-db-v9.js.map +1 -0
- package/dist/lib/local-db.d.ts +61 -11
- package/dist/lib/local-db.d.ts.map +1 -1
- package/dist/lib/local-db.js +186 -371
- package/dist/lib/local-db.js.map +1 -1
- package/dist/lib/local-embeddings.d.ts.map +1 -1
- package/dist/lib/local-embeddings.js +2 -2
- package/dist/lib/local-embeddings.js.map +1 -1
- package/dist/lib/local-gateway-client.d.ts +30 -87
- package/dist/lib/local-gateway-client.d.ts.map +1 -1
- package/dist/lib/local-gateway-client.js +182 -171
- package/dist/lib/local-gateway-client.js.map +1 -1
- package/dist/lib/local-ingest.d.ts +129 -0
- package/dist/lib/local-ingest.d.ts.map +1 -0
- package/dist/lib/local-ingest.js +81 -0
- package/dist/lib/local-ingest.js.map +1 -0
- package/dist/lib/local-link-pass.d.ts +15 -0
- package/dist/lib/local-link-pass.d.ts.map +1 -0
- package/dist/lib/local-link-pass.js +61 -0
- package/dist/lib/local-link-pass.js.map +1 -0
- package/dist/lib/local-mode.d.ts +4 -1
- package/dist/lib/local-mode.d.ts.map +1 -1
- package/dist/lib/local-mode.js +16 -1
- package/dist/lib/local-mode.js.map +1 -1
- package/dist/lib/local-provenance.d.ts +14 -0
- package/dist/lib/local-provenance.d.ts.map +1 -0
- package/dist/lib/local-provenance.js +14 -0
- package/dist/lib/local-provenance.js.map +1 -0
- package/dist/lib/local-thresholds.d.ts +70 -0
- package/dist/lib/local-thresholds.d.ts.map +1 -0
- package/dist/lib/local-thresholds.js +79 -0
- package/dist/lib/local-thresholds.js.map +1 -0
- package/dist/lib/mcp/mark-tool.d.ts +27 -0
- package/dist/lib/mcp/mark-tool.d.ts.map +1 -0
- package/dist/lib/mcp/mark-tool.js +103 -0
- package/dist/lib/mcp/mark-tool.js.map +1 -0
- package/dist/lib/mcp/share-tool.d.ts +46 -0
- package/dist/lib/mcp/share-tool.d.ts.map +1 -0
- package/dist/lib/mcp/share-tool.js +68 -0
- package/dist/lib/mcp/share-tool.js.map +1 -0
- package/dist/lib/mcp/tool-rules.d.ts +30 -0
- package/dist/lib/mcp/tool-rules.d.ts.map +1 -0
- package/dist/lib/mcp/tool-rules.js +84 -0
- package/dist/lib/mcp/tool-rules.js.map +1 -0
- package/dist/lib/mcp-backfill.d.ts +89 -0
- package/dist/lib/mcp-backfill.d.ts.map +1 -0
- package/dist/lib/mcp-backfill.js +194 -0
- package/dist/lib/mcp-backfill.js.map +1 -0
- package/dist/lib/mcp-scope.d.ts +90 -0
- package/dist/lib/mcp-scope.d.ts.map +1 -0
- package/dist/lib/mcp-scope.js +125 -0
- package/dist/lib/mcp-scope.js.map +1 -0
- package/dist/lib/mcp-sync.d.ts +64 -0
- package/dist/lib/mcp-sync.d.ts.map +1 -0
- package/dist/lib/mcp-sync.js +183 -0
- package/dist/lib/mcp-sync.js.map +1 -0
- package/dist/lib/personal-import.d.ts +7 -0
- package/dist/lib/personal-import.d.ts.map +1 -1
- package/dist/lib/personal-import.js +13 -1
- package/dist/lib/personal-import.js.map +1 -1
- package/dist/lib/safe-config-write.d.ts.map +1 -1
- package/dist/lib/safe-config-write.js +39 -2
- package/dist/lib/safe-config-write.js.map +1 -1
- package/dist/lib/scope-choices.d.ts +51 -0
- package/dist/lib/scope-choices.d.ts.map +1 -0
- package/dist/lib/scope-choices.js +193 -0
- package/dist/lib/scope-choices.js.map +1 -0
- package/dist/lib/scope-connect.d.ts +82 -0
- package/dist/lib/scope-connect.d.ts.map +1 -0
- package/dist/lib/scope-connect.js +258 -0
- package/dist/lib/scope-connect.js.map +1 -0
- package/dist/lib/scope-defaults.d.ts +3 -0
- package/dist/lib/scope-defaults.d.ts.map +1 -0
- package/dist/lib/scope-defaults.js +42 -0
- package/dist/lib/scope-defaults.js.map +1 -0
- package/dist/lib/scope-real.d.ts +223 -0
- package/dist/lib/scope-real.d.ts.map +1 -0
- package/dist/lib/scope-real.js +58 -0
- package/dist/lib/scope-real.js.map +1 -0
- package/dist/lib/scope-values.d.ts +76 -0
- package/dist/lib/scope-values.d.ts.map +1 -0
- package/dist/lib/scope-values.js +169 -0
- package/dist/lib/scope-values.js.map +1 -0
- package/dist/lib/scope.d.ts +161 -0
- package/dist/lib/scope.d.ts.map +1 -0
- package/dist/lib/scope.js +323 -0
- package/dist/lib/scope.js.map +1 -0
- package/dist/lib/share/command.d.ts +32 -0
- package/dist/lib/share/command.d.ts.map +1 -0
- package/dist/lib/share/command.js +136 -0
- package/dist/lib/share/command.js.map +1 -0
- package/dist/lib/share/ledger.d.ts +59 -0
- package/dist/lib/share/ledger.d.ts.map +1 -0
- package/dist/lib/share/ledger.js +135 -0
- package/dist/lib/share/ledger.js.map +1 -0
- package/dist/lib/share/payload.d.ts +92 -0
- package/dist/lib/share/payload.d.ts.map +1 -0
- package/dist/lib/share/payload.js +138 -0
- package/dist/lib/share/payload.js.map +1 -0
- package/dist/lib/share/pending.d.ts +48 -0
- package/dist/lib/share/pending.d.ts.map +1 -0
- package/dist/lib/share/pending.js +130 -0
- package/dist/lib/share/pending.js.map +1 -0
- package/dist/lib/share/preview.d.ts +18 -0
- package/dist/lib/share/preview.d.ts.map +1 -0
- package/dist/lib/share/preview.js +72 -0
- package/dist/lib/share/preview.js.map +1 -0
- package/dist/lib/share/run.d.ts +115 -0
- package/dist/lib/share/run.d.ts.map +1 -0
- package/dist/lib/share/run.js +261 -0
- package/dist/lib/share/run.js.map +1 -0
- package/dist/lib/share/salt.d.ts +2 -0
- package/dist/lib/share/salt.d.ts.map +1 -0
- package/dist/lib/share/salt.js +44 -0
- package/dist/lib/share/salt.js.map +1 -0
- package/dist/lib/share/secret-patterns.json +100 -0
- package/dist/lib/share/secret-scan.d.ts +19 -0
- package/dist/lib/share/secret-scan.d.ts.map +1 -0
- package/dist/lib/share/secret-scan.js +75 -0
- package/dist/lib/share/secret-scan.js.map +1 -0
- package/dist/lib/share/tty.d.ts +4 -0
- package/dist/lib/share/tty.d.ts.map +1 -0
- package/dist/lib/share/tty.js +57 -0
- package/dist/lib/share/tty.js.map +1 -0
- package/dist/lib/share/visible.d.ts +4 -0
- package/dist/lib/share/visible.d.ts.map +1 -0
- package/dist/lib/share/visible.js +30 -0
- package/dist/lib/share/visible.js.map +1 -0
- package/dist/lib/share/wire.d.ts +98 -0
- package/dist/lib/share/wire.d.ts.map +1 -0
- package/dist/lib/share/wire.js +43 -0
- package/dist/lib/share/wire.js.map +1 -0
- package/dist/lib/similarity/embedding-matrix.d.ts +64 -0
- package/dist/lib/similarity/embedding-matrix.d.ts.map +1 -0
- package/dist/lib/similarity/embedding-matrix.js +119 -0
- package/dist/lib/similarity/embedding-matrix.js.map +1 -0
- package/dist/lib/since-flag.d.ts +11 -0
- package/dist/lib/since-flag.d.ts.map +1 -0
- package/dist/lib/since-flag.js +24 -0
- package/dist/lib/since-flag.js.map +1 -0
- package/dist/lib/since.d.ts +59 -0
- package/dist/lib/since.d.ts.map +1 -0
- package/dist/lib/since.js +86 -0
- package/dist/lib/since.js.map +1 -0
- package/dist/lib/source-key.d.ts +13 -0
- package/dist/lib/source-key.d.ts.map +1 -0
- package/dist/lib/source-key.js +60 -0
- package/dist/lib/source-key.js.map +1 -0
- package/dist/lib/source-sync-state.d.ts +12 -0
- package/dist/lib/source-sync-state.d.ts.map +1 -0
- package/dist/lib/source-sync-state.js +43 -0
- package/dist/lib/source-sync-state.js.map +1 -0
- package/dist/lib/startup-backfill-track.d.ts +2 -0
- package/dist/lib/startup-backfill-track.d.ts.map +1 -0
- package/dist/lib/startup-backfill-track.js +6 -0
- package/dist/lib/startup-backfill-track.js.map +1 -0
- package/dist/lib/startup-xdg.d.ts +2 -0
- package/dist/lib/startup-xdg.d.ts.map +1 -0
- package/dist/lib/startup-xdg.js +9 -0
- package/dist/lib/startup-xdg.js.map +1 -0
- package/dist/lib/sync/after-connect.d.ts +2 -0
- package/dist/lib/sync/after-connect.d.ts.map +1 -0
- package/dist/lib/sync/after-connect.js +18 -0
- package/dist/lib/sync/after-connect.js.map +1 -0
- package/dist/lib/sync/bg-claim.d.ts +14 -0
- package/dist/lib/sync/bg-claim.d.ts.map +1 -0
- package/dist/lib/sync/bg-claim.js +97 -0
- package/dist/lib/sync/bg-claim.js.map +1 -0
- package/dist/lib/sync/blocked.d.ts +8 -0
- package/dist/lib/sync/blocked.d.ts.map +1 -0
- package/dist/lib/sync/blocked.js +44 -0
- package/dist/lib/sync/blocked.js.map +1 -0
- package/dist/lib/sync/classify.d.ts +34 -0
- package/dist/lib/sync/classify.d.ts.map +1 -0
- package/dist/lib/sync/classify.js +91 -0
- package/dist/lib/sync/classify.js.map +1 -0
- package/dist/lib/sync/drain.d.ts +16 -0
- package/dist/lib/sync/drain.d.ts.map +1 -0
- package/dist/lib/sync/drain.js +33 -0
- package/dist/lib/sync/drain.js.map +1 -0
- package/dist/lib/sync/forget.d.ts +12 -0
- package/dist/lib/sync/forget.d.ts.map +1 -0
- package/dist/lib/sync/forget.js +32 -0
- package/dist/lib/sync/forget.js.map +1 -0
- package/dist/lib/sync/launch-hook.d.ts +42 -0
- package/dist/lib/sync/launch-hook.d.ts.map +1 -0
- package/dist/lib/sync/launch-hook.js +117 -0
- package/dist/lib/sync/launch-hook.js.map +1 -0
- package/dist/lib/sync/lock.d.ts +35 -0
- package/dist/lib/sync/lock.d.ts.map +1 -0
- package/dist/lib/sync/lock.js +175 -0
- package/dist/lib/sync/lock.js.map +1 -0
- package/dist/lib/sync/purge.d.ts +38 -0
- package/dist/lib/sync/purge.d.ts.map +1 -0
- package/dist/lib/sync/purge.js +61 -0
- package/dist/lib/sync/purge.js.map +1 -0
- package/dist/lib/sync/real-env.d.ts +208 -0
- package/dist/lib/sync/real-env.d.ts.map +1 -0
- package/dist/lib/sync/real-env.js +47 -0
- package/dist/lib/sync/real-env.js.map +1 -0
- package/dist/lib/sync/relink.d.ts +14 -0
- package/dist/lib/sync/relink.d.ts.map +1 -0
- package/dist/lib/sync/relink.js +36 -0
- package/dist/lib/sync/relink.js.map +1 -0
- package/dist/lib/sync/report.d.ts +3 -0
- package/dist/lib/sync/report.d.ts.map +1 -0
- package/dist/lib/sync/report.js +54 -0
- package/dist/lib/sync/report.js.map +1 -0
- package/dist/lib/sync/run-all.d.ts +23 -0
- package/dist/lib/sync/run-all.d.ts.map +1 -0
- package/dist/lib/sync/run-all.js +30 -0
- package/dist/lib/sync/run-all.js.map +1 -0
- package/dist/lib/sync/run-source.d.ts +73 -0
- package/dist/lib/sync/run-source.d.ts.map +1 -0
- package/dist/lib/sync/run-source.js +262 -0
- package/dist/lib/sync/run-source.js.map +1 -0
- package/dist/lib/sync/safe-read.d.ts +4 -0
- package/dist/lib/sync/safe-read.d.ts.map +1 -0
- package/dist/lib/sync/safe-read.js +40 -0
- package/dist/lib/sync/safe-read.js.map +1 -0
- package/dist/lib/sync/should-background-sync.d.ts +31 -0
- package/dist/lib/sync/should-background-sync.d.ts.map +1 -0
- package/dist/lib/sync/should-background-sync.js +69 -0
- package/dist/lib/sync/should-background-sync.js.map +1 -0
- package/dist/lib/sync/source-ids.d.ts +10 -0
- package/dist/lib/sync/source-ids.d.ts.map +1 -0
- package/dist/lib/sync/source-ids.js +9 -0
- package/dist/lib/sync/source-ids.js.map +1 -0
- package/dist/lib/sync/sources.d.ts +33 -0
- package/dist/lib/sync/sources.d.ts.map +1 -0
- package/dist/lib/sync/sources.js +37 -0
- package/dist/lib/sync/sources.js.map +1 -0
- package/dist/lib/sync/spawn-background.d.ts +27 -0
- package/dist/lib/sync/spawn-background.d.ts.map +1 -0
- package/dist/lib/sync/spawn-background.js +66 -0
- package/dist/lib/sync/spawn-background.js.map +1 -0
- package/dist/lib/sync/status.d.ts +57 -0
- package/dist/lib/sync/status.d.ts.map +1 -0
- package/dist/lib/sync/status.js +166 -0
- package/dist/lib/sync/status.js.map +1 -0
- package/dist/lib/sync/summary-read.d.ts +19 -0
- package/dist/lib/sync/summary-read.d.ts.map +1 -0
- package/dist/lib/sync/summary-read.js +39 -0
- package/dist/lib/sync/summary-read.js.map +1 -0
- package/dist/lib/sync/summary.d.ts +10 -0
- package/dist/lib/sync/summary.d.ts.map +1 -0
- package/dist/lib/sync/summary.js +80 -0
- package/dist/lib/sync/summary.js.map +1 -0
- package/dist/lib/sync/sync-state.d.ts +128 -0
- package/dist/lib/sync/sync-state.d.ts.map +1 -0
- package/dist/lib/sync/sync-state.js +253 -0
- package/dist/lib/sync/sync-state.js.map +1 -0
- package/dist/lib/sync/telemetry.d.ts +20 -0
- package/dist/lib/sync/telemetry.d.ts.map +1 -0
- package/dist/lib/sync/telemetry.js +31 -0
- package/dist/lib/sync/telemetry.js.map +1 -0
- package/dist/lib/sync/threads.d.ts +48 -0
- package/dist/lib/sync/threads.d.ts.map +1 -0
- package/dist/lib/sync/threads.js +82 -0
- package/dist/lib/sync/threads.js.map +1 -0
- package/dist/lib/sync/window.d.ts +72 -0
- package/dist/lib/sync/window.d.ts.map +1 -0
- package/dist/lib/sync/window.js +112 -0
- package/dist/lib/sync/window.js.map +1 -0
- package/dist/lib/team-cta.d.ts +11 -0
- package/dist/lib/team-cta.d.ts.map +1 -0
- package/dist/lib/team-cta.js +16 -0
- package/dist/lib/team-cta.js.map +1 -0
- package/dist/lib/telemetry-ci.d.ts +2 -0
- package/dist/lib/telemetry-ci.d.ts.map +1 -0
- package/dist/lib/telemetry-ci.js +21 -0
- package/dist/lib/telemetry-ci.js.map +1 -0
- package/dist/lib/telemetry-consent.d.ts +44 -23
- package/dist/lib/telemetry-consent.d.ts.map +1 -1
- package/dist/lib/telemetry-consent.js +74 -35
- package/dist/lib/telemetry-consent.js.map +1 -1
- package/dist/lib/telemetry-env.d.ts +1 -1
- package/dist/lib/usage-telemetry.d.ts +87 -22
- package/dist/lib/usage-telemetry.d.ts.map +1 -1
- package/dist/lib/usage-telemetry.js +263 -74
- package/dist/lib/usage-telemetry.js.map +1 -1
- package/dist/lib/xdg.d.ts +27 -0
- package/dist/lib/xdg.d.ts.map +1 -0
- package/dist/lib/xdg.js +56 -0
- package/dist/lib/xdg.js.map +1 -0
- package/package.json +3 -2
- package/dist/commands/push.d.ts +0 -25
- package/dist/commands/push.d.ts.map +0 -1
- package/dist/commands/push.js +0 -98
- package/dist/commands/push.js.map +0 -1
|
@@ -1,111 +1,25 @@
|
|
|
1
|
-
import { createLocalDb, normaliseDecidedAt } from './local-db.js';
|
|
1
|
+
import { createLocalDb, identifyingSourceUrl, normaliseDecidedAt } from './local-db.js';
|
|
2
2
|
import { deriveDeciderKind } from './decider-kind.js';
|
|
3
|
+
import { provenanceOf } from './local-provenance.js';
|
|
3
4
|
import { currentRepoIdentity, repoFromSourceUrl } from './repo-identity.js';
|
|
4
5
|
import { cosineSimilarity, EMBEDDING_MODEL_ID, getEmbedding } from './local-embeddings.js';
|
|
5
6
|
import { classifyRelationship } from './local-relationship-classifier.js';
|
|
6
|
-
import {
|
|
7
|
+
import { noProviderHintInline, RECOMMENDED_OLLAMA_PULL } from './local-llm.js';
|
|
7
8
|
import { repositoryOf } from './decision-links.js';
|
|
8
9
|
import { localCitationFor } from './commit-cite.js';
|
|
9
10
|
import { extractRefs, refIdentityFor } from './decision-refs.js';
|
|
10
11
|
import { contentWordQuery } from './search-query.js';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export
|
|
22
|
-
/**
|
|
23
|
-
* Relevance floor for align_ask / align_search.
|
|
24
|
-
*
|
|
25
|
-
* Was an inline 0.1, the only unnamed threshold in this file and less than a quarter of
|
|
26
|
-
* its neighbours. It let align_ask answer "what happens when the brain service is down"
|
|
27
|
-
* with two unrelated decisions at 0.18 and 0.14 - noise the agent had to recognise by
|
|
28
|
-
* reading the decimals itself, and an audience cannot.
|
|
29
|
-
*
|
|
30
|
-
* 0.25 matches the gateway's own /decisions/smart-search floor, so the same question gets
|
|
31
|
-
* the same relevance bar in local and cloud mode. Lower than the 0.45 used for relatedness
|
|
32
|
-
* on purpose: search is a human asking a natural-language question, where a looser match is
|
|
33
|
-
* still worth showing, while relatedness is machinery acting on its own.
|
|
34
|
-
*
|
|
35
|
-
* An honest empty result is the point. "The graph has nothing on this" is a better answer
|
|
36
|
-
* than two wrong decisions, because the caller can act on it.
|
|
37
|
-
*/
|
|
38
|
-
export const SEARCH_THRESHOLD = 0.25;
|
|
39
|
-
/**
|
|
40
|
-
* Candidate floor for ADJUDICATION - the path that then pays an LLM per candidate.
|
|
41
|
-
*
|
|
42
|
-
* Deliberately higher than the retrieval floor below, because this surface is expensive in
|
|
43
|
-
* three ways the hook is not: up to 5 sequential calls to the user's own provider, ~11s of
|
|
44
|
-
* latency, and an exit code. A keyless CI runner that gets `no-context` today exits 0; the
|
|
45
|
-
* moment retrieval finds anything it gets `unknown` and exits 2. And the classifier cannot
|
|
46
|
-
* reject a candidate - its vocabulary is ten positive relations with no "unrelated" - so a
|
|
47
|
-
* loose candidate that reaches it is reported rather than filtered.
|
|
48
|
-
*
|
|
49
|
-
* Deliberately NOT recalibrated with the retrieval floor. Measured on the corpus, 0.30 would
|
|
50
|
-
* recover four more related pairs here too, and that trade is a separate decision with a
|
|
51
|
-
* separate blast radius (see relatedness-calibration.test.ts).
|
|
52
|
-
*/
|
|
53
|
-
export const RELATES_THRESHOLD = 0.45;
|
|
54
|
-
/**
|
|
55
|
-
* Candidate floor for RETRIEVAL ONLY (`depth: 'related'`, the agent editor hook).
|
|
56
|
-
*
|
|
57
|
-
* Measured, not chosen. Against fixtures/relatedness-corpus.json: 0.45 recovered 3 of 8 related
|
|
58
|
-
* pairs, 0.30 recovers 7 of 8, and neither admits a single unrelated pair. 0.25 scores the same
|
|
59
|
-
* 7 of 8, so the tie-break is margin over the worst false positive (0.2051): 0.30 clears it by
|
|
60
|
-
* 0.095 against 0.25's 0.045.
|
|
61
|
-
*
|
|
62
|
-
* 0.30 is also where this constant sat until commit 0cbef08 raised it to 0.45 inside a rename,
|
|
63
|
-
* unmentioned and unmeasured. So this is a revert with evidence attached rather than a new
|
|
64
|
-
* guess, and the evidence is a test that fails if the corpus stops supporting it.
|
|
65
|
-
*
|
|
66
|
-
* Safe to be looser here precisely because this path is cheap and honest: it returns above
|
|
67
|
-
* Stage 2, so it makes no provider call, and what the hook prints declines to assert anything
|
|
68
|
-
* ("related by content search and have NOT been adjudicated"). That is the same posture as
|
|
69
|
-
* `align search`, which has run at 0.25 all along - as has MCP `align_get_related_decisions`.
|
|
70
|
-
*/
|
|
71
|
-
export const RETRIEVAL_RELATES_THRESHOLD = 0.3;
|
|
72
|
-
// ALI-785: the ABSOLUTE floor above is unreachable for cross-register pairs on
|
|
73
|
-
// MiniLM-L6 - measured on a 403-decision six-source corpus, near-duplicates score
|
|
74
|
-
// ~0.95, genuine cross-tool paraphrases 0.45-0.62, background noise 0.28-0.40, and
|
|
75
|
-
// 0 of 1,729 links crossed a platform. So linking also takes each item's top few
|
|
76
|
-
// neighbours RELATIVE to its own ranking, floored where the noise band ends. 0.45 is
|
|
77
|
-
// the adjudication floor the product already uses elsewhere; text-cleaning schemes
|
|
78
|
-
// were lab-tested first and moved nothing (title+cleaned scored 0.274 vs 0.286 raw).
|
|
79
|
-
export const RELATED_TOP_K = 3;
|
|
80
|
-
export const RELATED_FLOOR = RELATES_THRESHOLD;
|
|
81
|
-
/**
|
|
82
|
-
* ALI-1065: the capture-time classification budget. Only the high-confidence tier
|
|
83
|
-
* (score >= SIMILARITY_THRESHOLD) is ever classified - the lower related-only tier stays
|
|
84
|
-
* a plain cosine `relates` edge, because typing a merely-related pair is exactly the
|
|
85
|
-
* manufactured-detection failure ALI-503 removed from the conflict counters.
|
|
86
|
-
*
|
|
87
|
-
* Capped at 3 regardless of how many candidates clear the high-confidence bar, and skipped
|
|
88
|
-
* entirely (0 calls) with no provider configured - see ingestOne. Worst case: 3 classifier
|
|
89
|
-
* calls per capture, each a single LLM round trip. Typical capture (0-1 near-duplicates)
|
|
90
|
-
* costs 0-1 calls.
|
|
91
|
-
*/
|
|
92
|
-
export const CAPTURE_CLASSIFY_TOP_K = 3;
|
|
93
|
-
// Below this similarity between a decision and new content, the content is
|
|
94
|
-
// considered to have drifted from the decision.
|
|
95
|
-
export const DRIFT_THRESHOLD = 0.5;
|
|
96
|
-
/**
|
|
97
|
-
* ALI-831: the provenance every decision payload carries, in wire spelling, so an agent
|
|
98
|
-
* reading this server can tell a claim from a rule. `ratified` is a boolean beside the
|
|
99
|
-
* stamp rather than instead of it: a consumer branches on the boolean and cites the stamp.
|
|
100
|
-
* A NULL column (a row from before the column existed) reads 'unknown', never a guess.
|
|
101
|
-
*/
|
|
102
|
-
function provenanceOf(row) {
|
|
103
|
-
return {
|
|
104
|
-
decider_kind: row.deciderKind ?? 'unknown',
|
|
105
|
-
ratified: row.ratifiedAt !== null,
|
|
106
|
-
...(row.ratifiedAt ? { ratified_at: row.ratifiedAt, ratified_by: row.ratifiedBy } : {}),
|
|
107
|
-
};
|
|
108
|
-
}
|
|
12
|
+
import { linkPass } from './local-link-pass.js';
|
|
13
|
+
import { EmbeddingMatrix, MATRIX_MAX_ROWS } from './similarity/embedding-matrix.js';
|
|
14
|
+
import { captureFieldsForUrl, ingestStep } from './local-ingest.js';
|
|
15
|
+
import { annotatePairs, anyJudgements, reviewConflicts } from './curation/guardrail.js';
|
|
16
|
+
import { defaultJudge } from './curation/judge.js';
|
|
17
|
+
import { bannerFor, checkNotes, emptyCheck, offeredFiles, splitRetrieved } from './curation/check-marks.js';
|
|
18
|
+
import { notADecisionMarks } from './curation/judgements-db.js';
|
|
19
|
+
import { contextKeyFor, filesFromDiff } from './curation/mark.js';
|
|
20
|
+
import { DRIFT_THRESHOLD, RELATED_FLOOR, RELATED_TOP_K, RELATES_THRESHOLD, RETRIEVAL_RELATES_THRESHOLD, SEARCH_THRESHOLD, SIMILARITY_THRESHOLD, } from './local-thresholds.js';
|
|
21
|
+
export { DRIFT_THRESHOLD, RELATED_FLOOR, RELATED_TOP_K, RELATES_THRESHOLD, RETRIEVAL_RELATES_THRESHOLD, SEARCH_THRESHOLD, SIMILARITY_THRESHOLD, };
|
|
22
|
+
export { CAPTURE_CLASSIFY_TOP_K } from './local-ingest.js';
|
|
109
23
|
export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
110
24
|
const db = createLocalDb(dbPath);
|
|
111
25
|
// Memoized: every retrieval call in one command invocation (a single `align ask`, one
|
|
@@ -120,6 +34,14 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
120
34
|
}
|
|
121
35
|
return cachedCurrentRepo;
|
|
122
36
|
}
|
|
37
|
+
/** LM: whose marks apply. Resolved only when the file holds any judgement, so a graph nobody marked never touches config. */
|
|
38
|
+
let cachedJudgeId;
|
|
39
|
+
async function activeJudge() {
|
|
40
|
+
if (!anyJudgements(dbPath))
|
|
41
|
+
return undefined;
|
|
42
|
+
cachedJudgeId ??= clientOpts.judgeId ?? (await defaultJudge()).judgeId;
|
|
43
|
+
return cachedJudgeId;
|
|
44
|
+
}
|
|
123
45
|
/**
|
|
124
46
|
* Resolves a `--repo <name>` argument against what actually exists, so a user can type
|
|
125
47
|
* the short repo name ("align-cli") or "owner/repo" instead of memorising the full
|
|
@@ -266,7 +188,28 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
266
188
|
}
|
|
267
189
|
return {};
|
|
268
190
|
}
|
|
269
|
-
|
|
191
|
+
/** What ranks a new item against the graph. Normally the in-memory matrix of every stored
|
|
192
|
+
* embedding, read from SQLite on first use and kept for the run (`session`) so N items read
|
|
193
|
+
* the table once. A kept matrix is trusted only while nothing under it moved: rowSetEpoch
|
|
194
|
+
* (this connection deleted or replaced rows, whichever code path did it) and dataVersion
|
|
195
|
+
* (ANOTHER connection committed) must both match what it was built at, else it is rebuilt.
|
|
196
|
+
* Above the row cap there is no matrix and each item streams the table, as before.
|
|
197
|
+
* Model-filtered exactly as findSimilar is: a stale-model vector must not be scored. */
|
|
198
|
+
function rankerFor(session) {
|
|
199
|
+
const epoch = db.rowSetEpoch();
|
|
200
|
+
const dataVersion = db.dataVersion();
|
|
201
|
+
if (session.matrix === undefined || session.epoch !== epoch || session.dataVersion !== dataVersion) {
|
|
202
|
+
session.matrix = undefined;
|
|
203
|
+
if (db.countEmbeddings() > (clientOpts.matrixMaxRows ?? MATRIX_MAX_ROWS)) {
|
|
204
|
+
return { topK: (q, k, o) => findSimilar(q, k, o?.threshold ?? 0, o?.excludeId) };
|
|
205
|
+
}
|
|
206
|
+
session.matrix = EmbeddingMatrix.fromRows(db.getAllEmbeddings({ model: EMBEDDING_MODEL_ID }));
|
|
207
|
+
session.epoch = epoch;
|
|
208
|
+
session.dataVersion = dataVersion;
|
|
209
|
+
}
|
|
210
|
+
return session.matrix;
|
|
211
|
+
}
|
|
212
|
+
async function ingestOne(input, platform, opts = {}, session = {}) {
|
|
270
213
|
let title = input.slice(0, 80);
|
|
271
214
|
let summary = input;
|
|
272
215
|
let sourceUrl = opts.sourceUrlOverride ?? null;
|
|
@@ -275,14 +218,17 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
275
218
|
try {
|
|
276
219
|
const url = new URL(input);
|
|
277
220
|
sourceUrl = url.href;
|
|
278
|
-
title = url
|
|
279
|
-
summary = `Captured from ${url.hostname}`;
|
|
221
|
+
({ title, summary } = captureFieldsForUrl(url));
|
|
280
222
|
capturedAsUrl = true;
|
|
281
223
|
}
|
|
282
224
|
catch { /* plain text - use as-is */ }
|
|
283
225
|
}
|
|
284
226
|
if (opts.titleOverride)
|
|
285
227
|
title = opts.titleOverride.slice(0, 80);
|
|
228
|
+
// L2: a capture of a URL whose item a connector already imported adds nothing to it.
|
|
229
|
+
const heldRow = capturedAsUrl ? db.noteCaptureOfHeldItem(sourceUrl) : null;
|
|
230
|
+
if (heldRow)
|
|
231
|
+
return { id: heldRow.id, title: heldRow.title, summary: heldRow.summary, sourceUrl: heldRow.sourceUrl, platform: heldRow.platform, related: [], created: false, changed: false };
|
|
286
232
|
// ALI-792: what the text points at, stored beside the decision. When the whole
|
|
287
233
|
// input IS the URL being captured, there is nothing to point at - and comparing
|
|
288
234
|
// the extracted ref against the WHATWG-normalized href leaks on every
|
|
@@ -302,80 +248,78 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
302
248
|
// refreshed, so this is the only moment the difference is visible. Without it a
|
|
303
249
|
// re-import reports every decision as imported while the graph does not move, which
|
|
304
250
|
// reads as having imported twice (ALI-770).
|
|
305
|
-
|
|
251
|
+
//
|
|
306
252
|
// ALI-829: a Slack thread arriving under a real title replaces the tombstone-titled row
|
|
307
|
-
// an older fetcher may have written for the same source_url (see local-db.ts).
|
|
253
|
+
// an older fetcher may have written for the same source_url (see local-db.ts). Removed
|
|
254
|
+
// BEFORE the lookup: L2 finds a Slack thread by its source_key, which the tombstone shares.
|
|
255
|
+
//
|
|
256
|
+
// One normalisation, used by both folds: the tombstone delete and insertDecision's own fold
|
|
257
|
+
// already trim, and a raw url here made the two disagree about which twin they were looking at.
|
|
258
|
+
const identity = identifyingSourceUrl(sourceUrl);
|
|
308
259
|
if (platform === 'slack')
|
|
309
|
-
db.deleteSlackTombstoneTwin(
|
|
260
|
+
db.deleteSlackTombstoneTwin(identity);
|
|
261
|
+
if (opts.keyed)
|
|
262
|
+
db.foldPendingTwin(identity, title, platform, true);
|
|
263
|
+
const existingId = db.findIdBySource(sourceUrl, title, platform, opts.keyed);
|
|
264
|
+
// L3: an items-first arrival over a complete row merges onto the stored discussion; the row stays complete.
|
|
265
|
+
let pending = opts.detailPending;
|
|
266
|
+
if (opts.keyed && existingId !== null) {
|
|
267
|
+
const kept = db.keepProtectedText(existingId, title, summary, opts.detailPending);
|
|
268
|
+
({ title, summary } = kept);
|
|
269
|
+
if (kept.keptDiscussion)
|
|
270
|
+
pending = false;
|
|
271
|
+
}
|
|
272
|
+
const created = existingId === null;
|
|
310
273
|
// ALI-829: the source's own date, normalised once. An unparseable date drops the FIELD,
|
|
311
274
|
// never the item: the summary is the thing the user came for.
|
|
312
275
|
const decidedAt = normaliseDecidedAt(opts.createdAt);
|
|
276
|
+
// L1/L2: connector imports (classify:false) only - capture re-ranks every time. Only the
|
|
277
|
+
// missing steps run (Decision 30): nothing for a finished row, the link pass alone for a
|
|
278
|
+
// row whose ingest died after storing its embedding. Refs stay current and citations INTO
|
|
279
|
+
// the row resolve either way: both are local and cheap.
|
|
280
|
+
if (opts.classify === false && existingId !== null) {
|
|
281
|
+
const step = ingestStep(db.getDecisionById(existingId), { title, summary, platform, repo, decidedAt }, db.getEmbeddingModel(existingId), EMBEDDING_MODEL_ID, db.getEnrichedAt(existingId));
|
|
282
|
+
const stored = step === 'full' ? null : db.getEmbedding(existingId);
|
|
283
|
+
if (stored !== null) {
|
|
284
|
+
db.replaceRefs(existingId, refs);
|
|
285
|
+
db.resolveRefs(existingId, refIdentityFor(platform, sourceUrl));
|
|
286
|
+
const related = step === 'relink' ? await linkPass(db, rankerFor(session), existingId, stored, title, summary, opts.classify) : [];
|
|
287
|
+
if (step === 'relink')
|
|
288
|
+
db.markEnriched(existingId);
|
|
289
|
+
return { id: existingId, title, summary, sourceUrl, platform, related, created: false, changed: false };
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
// Embed title + summary so URL captures (whose summary is just "Captured
|
|
293
|
+
// from <host>") still carry the path-derived title's semantic content. Embedded BEFORE the
|
|
294
|
+
// row is rewritten: a failed embed then leaves the row (and its enriched_at) as it was,
|
|
295
|
+
// rather than new text beside the old text's vector.
|
|
296
|
+
const embedText = title === summary ? summary : `${title}. ${summary}`;
|
|
297
|
+
const embedding = await getEmbedding(embedText);
|
|
313
298
|
// ALI-831: origin, from the platform - the same rule the cloud applies on insert.
|
|
314
299
|
const deciderKind = deriveDeciderKind(platform);
|
|
315
|
-
const id = db.insertDecision({ title, summary, sourceUrl, platform, repo, decidedAt, deciderKind });
|
|
300
|
+
const id = db.insertDecision({ title, summary, sourceUrl, platform, repo, decidedAt, deciderKind, keyed: opts.keyed, detailPending: pending });
|
|
316
301
|
db.replaceRefs(id, refs);
|
|
317
302
|
// ALI-796's payoff: if some earlier decision already cited THIS one (a git commit
|
|
318
303
|
// citing a Jira key before Jira was ever connected), resolve that gap into a real
|
|
319
304
|
// link now that the cited item has arrived. Harmless no-op for platforms with no
|
|
320
305
|
// citable identity (refIdentityFor returns [] for a plain git/slack/cli capture).
|
|
321
306
|
db.resolveRefs(id, refIdentityFor(platform, sourceUrl));
|
|
322
|
-
|
|
323
|
-
// from <host>") still carry the path-derived title's semantic content.
|
|
324
|
-
const embedText = title === summary ? summary : `${title}. ${summary}`;
|
|
325
|
-
const embedding = await getEmbedding(embedText);
|
|
307
|
+
const epochBefore = db.rowSetEpoch();
|
|
326
308
|
db.setEmbedding(id, embedding, EMBEDDING_MODEL_ID);
|
|
327
|
-
//
|
|
328
|
-
//
|
|
329
|
-
//
|
|
330
|
-
//
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
// ALI-1065: classify only the high-confidence tier, capped, and only with a provider
|
|
335
|
-
// configured - hasConfiguredProvider is an env-only check, so this costs nothing when
|
|
336
|
-
// no key exists (the common case for a fresh clone). chainStopped mirrors
|
|
337
|
-
// checkAlignment's own short-circuit: once one candidate's classification fails with a
|
|
338
|
-
// stopped provider, further calls in THIS capture are skipped rather than repeated.
|
|
339
|
-
const toClassify = hasConfiguredProvider()
|
|
340
|
-
? candidates.filter(c => c.score >= SIMILARITY_THRESHOLD).slice(0, CAPTURE_CLASSIFY_TOP_K)
|
|
341
|
-
: [];
|
|
342
|
-
const classifyIds = new Set(toClassify.map(c => c.decisionId));
|
|
343
|
-
const newDecision = { title, summary };
|
|
344
|
-
let chainStopped = false;
|
|
345
|
-
for (const c of candidates) {
|
|
346
|
-
if (classifyIds.has(c.decisionId) && !chainStopped) {
|
|
347
|
-
// The EXISTING decision is the subject (A); the new capture is the candidate (B) -
|
|
348
|
-
// "how does B relate to A" reads naturally as "does this new thing supersede/conflict
|
|
349
|
-
// with what's already there", which is the direction a capture-time check asks in.
|
|
350
|
-
const existingRow = db.getDecisionById(c.decisionId);
|
|
351
|
-
const outcome = existingRow
|
|
352
|
-
? await classifyRelationship({ title: existingRow.title, summary: existingRow.summary }, newDecision)
|
|
353
|
-
: { ok: false, reason: 'classifier_error' };
|
|
354
|
-
if (!outcome.ok && outcome.failure?.kind === 'provider_stopped')
|
|
355
|
-
chainStopped = true;
|
|
356
|
-
if (outcome.ok) {
|
|
357
|
-
// replaceLink, not insertLink: this upgrades the cosine `relates` edge findSimilar
|
|
358
|
-
// would otherwise also write below into a typed one, rather than leaving both on
|
|
359
|
-
// the pair (local-db.ts's unique index is per-relation, so both would coexist).
|
|
360
|
-
db.replaceLink({
|
|
361
|
-
sourceId: id,
|
|
362
|
-
targetId: c.decisionId,
|
|
363
|
-
relation: outcome.relationship.type,
|
|
364
|
-
confidence: outcome.relationship.confidence,
|
|
365
|
-
});
|
|
366
|
-
continue;
|
|
367
|
-
}
|
|
368
|
-
// Falls through to the untyped write below on any classifier failure - a candidate
|
|
369
|
-
// still worth surfacing as related even when nothing could type it.
|
|
370
|
-
}
|
|
371
|
-
// ALI-503: `relates`, not `conflicts_with`. This is a cosine score with no judgement
|
|
372
|
-
// behind it, and labelling it a conflict made `align local status` and the
|
|
373
|
-
// align_get_conflicts MCP tool report manufactured findings as detections.
|
|
374
|
-
db.insertLink({ sourceId: id, targetId: c.decisionId, relation: 'relates', confidence: c.score });
|
|
309
|
+
// This run's own write: the matrix learns it by append, so the bump setEmbedding makes when
|
|
310
|
+
// it REPLACES a vector is not a graph that moved under the copy. But only a matrix that was
|
|
311
|
+
// current before the write may absorb it; one the insert's own fold already outdated is
|
|
312
|
+
// left alone and rebuilt by rankerFor.
|
|
313
|
+
if (session.matrix !== undefined && session.epoch === epochBefore) {
|
|
314
|
+
session.matrix.add(id, embedding);
|
|
315
|
+
session.epoch = db.rowSetEpoch();
|
|
375
316
|
}
|
|
376
|
-
|
|
317
|
+
const candidates = await linkPass(db, rankerFor(session), id, embedding, title, summary, opts.classify);
|
|
318
|
+
// L2, Decision 30: the LAST write. Only now is the ingest done.
|
|
319
|
+
db.markEnriched(id);
|
|
320
|
+
return { id, title, summary, sourceUrl, platform, related: candidates, created, changed: true };
|
|
377
321
|
}
|
|
378
|
-
|
|
322
|
+
const client = {
|
|
379
323
|
/** Release the underlying SQLite handle (required on Windows before deleting the file). */
|
|
380
324
|
close() {
|
|
381
325
|
db.close();
|
|
@@ -395,17 +339,20 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
395
339
|
...(row ? provenanceOf(row) : {}),
|
|
396
340
|
};
|
|
397
341
|
},
|
|
398
|
-
async ingestBatch(items) {
|
|
342
|
+
async ingestBatch(items, opts = {}) {
|
|
399
343
|
const snapshots = [];
|
|
344
|
+
const session = {};
|
|
400
345
|
for (const item of items) {
|
|
401
346
|
const r = await ingestOne(item.raw_text, item.platform ?? 'cli', {
|
|
402
347
|
titleOverride: item.title,
|
|
403
348
|
sourceUrlOverride: item.source_url ?? null,
|
|
404
349
|
createdAt: item.created_at,
|
|
405
|
-
|
|
350
|
+
classify: opts.classify, keyed: opts.keyed, detailPending: item.detail_pending,
|
|
351
|
+
}, session);
|
|
406
352
|
snapshots.push({
|
|
407
353
|
id: r.id,
|
|
408
354
|
created: r.created,
|
|
355
|
+
changed: r.changed,
|
|
409
356
|
title: r.title,
|
|
410
357
|
summary: r.summary,
|
|
411
358
|
analysis: {
|
|
@@ -422,6 +369,39 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
422
369
|
}
|
|
423
370
|
return { snapshots };
|
|
424
371
|
},
|
|
372
|
+
/**
|
|
373
|
+
* L5, Decision 30: finish ingests that never finished (`enriched_at` NULL: every row after the
|
|
374
|
+
* v7 upgrade, or one that died between its embedding and its link pass). Runs only the
|
|
375
|
+
* missing step, the way ingestOne does for a connector re-ingest: a row that already holds a
|
|
376
|
+
* current-model embedding gets the link pass alone (no embed call); one that does not is
|
|
377
|
+
* re-ingested from its own stored text. A row with no URL and no embedding cannot be
|
|
378
|
+
* re-ingested without inserting a twin, so it is counted and left. Never classifies.
|
|
379
|
+
*/
|
|
380
|
+
async relinkUnfinished(rows) {
|
|
381
|
+
const session = {};
|
|
382
|
+
const out = { linked: 0, embedded: 0, skipped: 0 };
|
|
383
|
+
for (const { id, keyed, pending } of rows) {
|
|
384
|
+
const row = db.getDecisionById(id);
|
|
385
|
+
if (!row)
|
|
386
|
+
continue;
|
|
387
|
+
const stored = db.getEmbeddingModel(id) === EMBEDDING_MODEL_ID ? db.getEmbedding(id) : null;
|
|
388
|
+
if (stored !== null) {
|
|
389
|
+
await linkPass(db, rankerFor(session), id, stored, row.title, row.summary, false);
|
|
390
|
+
db.markEnriched(id);
|
|
391
|
+
out.linked += 1;
|
|
392
|
+
}
|
|
393
|
+
else if (row.sourceUrl === null) {
|
|
394
|
+
out.skipped += 1;
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
await ingestOne(row.summary, row.platform, { titleOverride: row.title, sourceUrlOverride: row.sourceUrl, createdAt: row.decidedAt ?? undefined, classify: false, keyed,
|
|
398
|
+
// The stored flag, passed through: a re-ingest that says nothing resets a row still waiting for its discussion.
|
|
399
|
+
detailPending: pending === true }, session);
|
|
400
|
+
out.embedded += 1;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
return out;
|
|
404
|
+
},
|
|
425
405
|
/**
|
|
426
406
|
* ALI-808: the confirm-each session importer's one write path. Ingests exactly like
|
|
427
407
|
* ingestBatch does above (same ingestOne, so platform 'agent-session' derives
|
|
@@ -560,7 +540,16 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
560
540
|
const { dbFilter, effectiveRepo } = await resolveScope(scope);
|
|
561
541
|
const boundedFilter = { ...dbFilter, createdBefore };
|
|
562
542
|
const embedding = await getEmbedding(query);
|
|
563
|
-
|
|
543
|
+
// LM: decisions this person marked not-a-decision are skipped, so ask for that many extra.
|
|
544
|
+
const judge = await activeJudge();
|
|
545
|
+
const hidden = judge ? notADecisionMarks(dbPath, judge) : new Map();
|
|
546
|
+
const dropNotes = [];
|
|
547
|
+
const visible = (rows) => {
|
|
548
|
+
const split = splitRetrieved(rows, hidden, limit, (id) => db.getDecisionById(id)?.title, 'answer');
|
|
549
|
+
dropNotes.splice(0, dropNotes.length, ...split.notes);
|
|
550
|
+
return split.kept;
|
|
551
|
+
};
|
|
552
|
+
let similar = visible(await findSimilar(embedding, limit + hidden.size, SEARCH_THRESHOLD, undefined, boundedFilter));
|
|
564
553
|
// A natural-language question embeds less densely than its subject does, so on a
|
|
565
554
|
// small graph it can miss a decision that its own content words hit. Retry once,
|
|
566
555
|
// only on an empty result, mirroring the gateway's own keyword-to-semantic
|
|
@@ -569,7 +558,7 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
569
558
|
if (!similar.length) {
|
|
570
559
|
const reduced = contentWordQuery(query);
|
|
571
560
|
if (reduced) {
|
|
572
|
-
similar = await findSimilar(await getEmbedding(reduced), limit, SEARCH_THRESHOLD, undefined, boundedFilter);
|
|
561
|
+
similar = visible(await findSimilar(await getEmbedding(reduced), limit + hidden.size, SEARCH_THRESHOLD, undefined, boundedFilter));
|
|
573
562
|
}
|
|
574
563
|
}
|
|
575
564
|
const results = similar
|
|
@@ -603,7 +592,7 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
603
592
|
};
|
|
604
593
|
})
|
|
605
594
|
.filter((d) => d !== null);
|
|
606
|
-
return { results, count: results.length, strategy: 'semantic', scope: effectiveRepo };
|
|
595
|
+
return { results, count: results.length, strategy: 'semantic', scope: effectiveRepo, ...(dropNotes.length ? { notes: dropNotes } : {}) };
|
|
607
596
|
},
|
|
608
597
|
async checkAlignment(diff, _context,
|
|
609
598
|
// 'exhaustive' deliberately collapses into 'full' here: local mode has no gateway
|
|
@@ -620,7 +609,10 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
620
609
|
// the stricter bar. One constant could not serve both.
|
|
621
610
|
const threshold = opts.depth === 'related' ? RETRIEVAL_RELATES_THRESHOLD : RELATES_THRESHOLD;
|
|
622
611
|
const embedding = await getEmbedding(diff);
|
|
623
|
-
const
|
|
612
|
+
const judge = await activeJudge();
|
|
613
|
+
const hidden = judge ? notADecisionMarks(dbPath, judge) : new Map();
|
|
614
|
+
const retrieved = splitRetrieved(await findSimilar(embedding, 5 + hidden.size, threshold), hidden, 5, (id) => db.getDecisionById(id)?.title);
|
|
615
|
+
const similar = retrieved.kept;
|
|
624
616
|
const candidates = similar
|
|
625
617
|
.map(s => {
|
|
626
618
|
const row = db.getDecisionById(s.decisionId);
|
|
@@ -628,7 +620,7 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
628
620
|
})
|
|
629
621
|
.filter((d) => d !== null);
|
|
630
622
|
if (!candidates.length) {
|
|
631
|
-
return
|
|
623
|
+
return emptyCheck(retrieved);
|
|
632
624
|
}
|
|
633
625
|
// `depth:'related'` means retrieval only, and honouring it matters more here than in the
|
|
634
626
|
// cloud client. The editor hook asks for it to fit a <=10s budget (check.ts), but in
|
|
@@ -656,6 +648,7 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
656
648
|
...provenanceOf(c),
|
|
657
649
|
})),
|
|
658
650
|
conflicts: [],
|
|
651
|
+
...(retrieved.notes.length ? { notes: [...bannerFor(retrieved.agentApplied), ...retrieved.notes] } : {}),
|
|
659
652
|
message: `Found ${candidates.length} related decision(s) - retrieval only, not adjudicated.`,
|
|
660
653
|
};
|
|
661
654
|
}
|
|
@@ -700,8 +693,13 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
700
693
|
similarity: c.score,
|
|
701
694
|
});
|
|
702
695
|
}
|
|
703
|
-
|
|
704
|
-
const
|
|
696
|
+
// LM: a decision a person said was replaced is named as replaced, with its successor.
|
|
697
|
+
const replacedBy = (id) => {
|
|
698
|
+
const r = relationFieldsFor(id);
|
|
699
|
+
return r.status === 'superseded' ? { status: r.status, successor: r.successor } : {};
|
|
700
|
+
};
|
|
701
|
+
const relevant_decisions = typed.map(t => ({ id: t.id, title: t.title, summary: t.summary, similarity: t.similarity, url: t.url, ...t.provenance, ...replacedBy(t.id) }));
|
|
702
|
+
const rawConflicts = typed
|
|
705
703
|
.filter(t => t.relationship === 'conflicts_with' || t.relationship === 'contradicts')
|
|
706
704
|
.map(t => ({
|
|
707
705
|
decision_id: t.id,
|
|
@@ -712,6 +710,13 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
712
710
|
reason: t.reason ?? 'Conflicts with an existing decision in your local graph',
|
|
713
711
|
severity: (t.confidence >= 0.8 ? 'critical' : 'warning'),
|
|
714
712
|
}));
|
|
713
|
+
// LM: this person's false-alarm marks hide a hit for exactly this set of files, or annotate it.
|
|
714
|
+
const files = filesFromDiff(diff);
|
|
715
|
+
const reviewed = judge ? reviewConflicts(dbPath, judge, rawConflicts, contextKeyFor(files), files) : { conflicts: rawConflicts, notes: [], agentApplied: [] };
|
|
716
|
+
const conflicts = reviewed.conflicts;
|
|
717
|
+
// LM: say what a mark changed - a decision left out, a decision a person declared replaced.
|
|
718
|
+
const allNotes = checkNotes(dbPath, judge, retrieved, relevant_decisions, reviewed, files);
|
|
719
|
+
const notes = allNotes.length ? { notes: allNotes } : {};
|
|
715
720
|
// ALI-414: a candidate we retrieved but could not classify is exactly the case
|
|
716
721
|
// where we do not know - it could be the conflict. Reporting `aligned` there is
|
|
717
722
|
// a fail-open, and an agent reads `aligned` as permission to proceed. A conflict
|
|
@@ -724,6 +729,8 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
724
729
|
confidence,
|
|
725
730
|
relevant_decisions,
|
|
726
731
|
conflicts,
|
|
732
|
+
...notes,
|
|
733
|
+
...(offeredFiles(files) ? { checked_files: files } : {}),
|
|
727
734
|
message: `This change conflicts with ${conflicts.length} existing decision(s) in your local graph - review before proceeding.`,
|
|
728
735
|
};
|
|
729
736
|
}
|
|
@@ -747,6 +754,7 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
747
754
|
confidence: 0,
|
|
748
755
|
relevant_decisions,
|
|
749
756
|
conflicts: [],
|
|
757
|
+
...notes,
|
|
750
758
|
message: `Could not check ${relevant_decisions.length} related decision(s) - the relationship classifier did not run. ` +
|
|
751
759
|
`This is NOT a pass: treat it as unchecked and review these decisions before proceeding.${hint}`,
|
|
752
760
|
};
|
|
@@ -756,6 +764,7 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
756
764
|
confidence,
|
|
757
765
|
relevant_decisions,
|
|
758
766
|
conflicts,
|
|
767
|
+
...notes,
|
|
759
768
|
message: `Found ${relevant_decisions.length} related decision(s) to review.`,
|
|
760
769
|
};
|
|
761
770
|
},
|
|
@@ -800,8 +809,10 @@ export function createLocalGatewayClient(dbPath, clientOpts = {}) {
|
|
|
800
809
|
...db.listLinks({ relation: 'conflicts_with' }),
|
|
801
810
|
...db.listLinks({ relation: 'contradicts' }),
|
|
802
811
|
];
|
|
803
|
-
|
|
812
|
+
const judge = await activeJudge();
|
|
813
|
+
return { links: judge ? annotatePairs(dbPath, judge, links) : links, conflict_count: links.length };
|
|
804
814
|
},
|
|
805
815
|
};
|
|
816
|
+
return client;
|
|
806
817
|
}
|
|
807
818
|
//# sourceMappingURL=local-gateway-client.js.map
|