usesteady 0.1.0-alpha.1
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/LICENSE +186 -0
- package/README.md +724 -0
- package/bin/use-steady.js +13 -0
- package/dist/server-store.d.ts +68 -0
- package/dist/server-store.d.ts.map +1 -0
- package/dist/server-store.js +133 -0
- package/dist/server-store.js.map +1 -0
- package/dist/server.d.ts +35 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +569 -0
- package/dist/server.js.map +1 -0
- package/dist/src/claude/adapters/api-adapter.d.ts +99 -0
- package/dist/src/claude/adapters/api-adapter.d.ts.map +1 -0
- package/dist/src/claude/adapters/api-adapter.js +415 -0
- package/dist/src/claude/adapters/api-adapter.js.map +1 -0
- package/dist/src/claude/adapters/stub-adapter.d.ts +73 -0
- package/dist/src/claude/adapters/stub-adapter.d.ts.map +1 -0
- package/dist/src/claude/adapters/stub-adapter.js +114 -0
- package/dist/src/claude/adapters/stub-adapter.js.map +1 -0
- package/dist/src/claude/artifact-mapper.d.ts +85 -0
- package/dist/src/claude/artifact-mapper.d.ts.map +1 -0
- package/dist/src/claude/artifact-mapper.js +187 -0
- package/dist/src/claude/artifact-mapper.js.map +1 -0
- package/dist/src/claude/delivery-gate.d.ts +136 -0
- package/dist/src/claude/delivery-gate.d.ts.map +1 -0
- package/dist/src/claude/delivery-gate.js +231 -0
- package/dist/src/claude/delivery-gate.js.map +1 -0
- package/dist/src/claude/index.d.ts +24 -0
- package/dist/src/claude/index.d.ts.map +1 -0
- package/dist/src/claude/index.js +23 -0
- package/dist/src/claude/index.js.map +1 -0
- package/dist/src/claude/types.d.ts +223 -0
- package/dist/src/claude/types.d.ts.map +1 -0
- package/dist/src/claude/types.js +64 -0
- package/dist/src/claude/types.js.map +1 -0
- package/dist/src/control/compiler.d.ts +125 -0
- package/dist/src/control/compiler.d.ts.map +1 -0
- package/dist/src/control/compiler.js +179 -0
- package/dist/src/control/compiler.js.map +1 -0
- package/dist/src/control/constraints.d.ts +42 -0
- package/dist/src/control/constraints.d.ts.map +1 -0
- package/dist/src/control/constraints.js +116 -0
- package/dist/src/control/constraints.js.map +1 -0
- package/dist/src/control/drift-detector.d.ts +49 -0
- package/dist/src/control/drift-detector.d.ts.map +1 -0
- package/dist/src/control/drift-detector.js +115 -0
- package/dist/src/control/drift-detector.js.map +1 -0
- package/dist/src/control/index.d.ts +44 -0
- package/dist/src/control/index.d.ts.map +1 -0
- package/dist/src/control/index.js +40 -0
- package/dist/src/control/index.js.map +1 -0
- package/dist/src/control/types.d.ts +144 -0
- package/dist/src/control/types.d.ts.map +1 -0
- package/dist/src/control/types.js +57 -0
- package/dist/src/control/types.js.map +1 -0
- package/dist/src/cursor/adapters/inprocess-adapter.d.ts +78 -0
- package/dist/src/cursor/adapters/inprocess-adapter.d.ts.map +1 -0
- package/dist/src/cursor/adapters/inprocess-adapter.js +308 -0
- package/dist/src/cursor/adapters/inprocess-adapter.js.map +1 -0
- package/dist/src/cursor/adapters/stub-adapter.d.ts +75 -0
- package/dist/src/cursor/adapters/stub-adapter.d.ts.map +1 -0
- package/dist/src/cursor/adapters/stub-adapter.js +120 -0
- package/dist/src/cursor/adapters/stub-adapter.js.map +1 -0
- package/dist/src/cursor/artifact-mapper.d.ts +81 -0
- package/dist/src/cursor/artifact-mapper.d.ts.map +1 -0
- package/dist/src/cursor/artifact-mapper.js +203 -0
- package/dist/src/cursor/artifact-mapper.js.map +1 -0
- package/dist/src/cursor/delivery-gate.d.ts +144 -0
- package/dist/src/cursor/delivery-gate.d.ts.map +1 -0
- package/dist/src/cursor/delivery-gate.js +208 -0
- package/dist/src/cursor/delivery-gate.js.map +1 -0
- package/dist/src/cursor/glob-matcher.d.ts +30 -0
- package/dist/src/cursor/glob-matcher.d.ts.map +1 -0
- package/dist/src/cursor/glob-matcher.js +68 -0
- package/dist/src/cursor/glob-matcher.js.map +1 -0
- package/dist/src/cursor/index.d.ts +43 -0
- package/dist/src/cursor/index.d.ts.map +1 -0
- package/dist/src/cursor/index.js +44 -0
- package/dist/src/cursor/index.js.map +1 -0
- package/dist/src/cursor/ocd-evaluator.d.ts +89 -0
- package/dist/src/cursor/ocd-evaluator.d.ts.map +1 -0
- package/dist/src/cursor/ocd-evaluator.js +142 -0
- package/dist/src/cursor/ocd-evaluator.js.map +1 -0
- package/dist/src/cursor/types.d.ts +309 -0
- package/dist/src/cursor/types.d.ts.map +1 -0
- package/dist/src/cursor/types.js +48 -0
- package/dist/src/cursor/types.js.map +1 -0
- package/dist/src/execution/claude/claude-execution-coordinator.d.ts +164 -0
- package/dist/src/execution/claude/claude-execution-coordinator.d.ts.map +1 -0
- package/dist/src/execution/claude/claude-execution-coordinator.js +198 -0
- package/dist/src/execution/claude/claude-execution-coordinator.js.map +1 -0
- package/dist/src/execution/claude/index.d.ts +13 -0
- package/dist/src/execution/claude/index.d.ts.map +1 -0
- package/dist/src/execution/claude/index.js +12 -0
- package/dist/src/execution/claude/index.js.map +1 -0
- package/dist/src/execution/cursor/cursor-execution-coordinator.d.ts +216 -0
- package/dist/src/execution/cursor/cursor-execution-coordinator.d.ts.map +1 -0
- package/dist/src/execution/cursor/cursor-execution-coordinator.js +233 -0
- package/dist/src/execution/cursor/cursor-execution-coordinator.js.map +1 -0
- package/dist/src/execution/cursor/index.d.ts +20 -0
- package/dist/src/execution/cursor/index.d.ts.map +1 -0
- package/dist/src/execution/cursor/index.js +18 -0
- package/dist/src/execution/cursor/index.js.map +1 -0
- package/dist/src/execution/reminders/index.d.ts +11 -0
- package/dist/src/execution/reminders/index.d.ts.map +1 -0
- package/dist/src/execution/reminders/index.js +9 -0
- package/dist/src/execution/reminders/index.js.map +1 -0
- package/dist/src/execution/reminders/reminder-execution-coordinator.d.ts +125 -0
- package/dist/src/execution/reminders/reminder-execution-coordinator.d.ts.map +1 -0
- package/dist/src/execution/reminders/reminder-execution-coordinator.js +129 -0
- package/dist/src/execution/reminders/reminder-execution-coordinator.js.map +1 -0
- package/dist/src/execution/reminders/reminder-execution-types.d.ts +161 -0
- package/dist/src/execution/reminders/reminder-execution-types.d.ts.map +1 -0
- package/dist/src/execution/reminders/reminder-execution-types.js +39 -0
- package/dist/src/execution/reminders/reminder-execution-types.js.map +1 -0
- package/dist/src/execution/reminders/reminder-execution-validator.d.ts +45 -0
- package/dist/src/execution/reminders/reminder-execution-validator.d.ts.map +1 -0
- package/dist/src/execution/reminders/reminder-execution-validator.js +92 -0
- package/dist/src/execution/reminders/reminder-execution-validator.js.map +1 -0
- package/dist/src/execution/reminders/reminder-executor.d.ts +62 -0
- package/dist/src/execution/reminders/reminder-executor.d.ts.map +1 -0
- package/dist/src/execution/reminders/reminder-executor.js +113 -0
- package/dist/src/execution/reminders/reminder-executor.js.map +1 -0
- package/dist/src/execution/reminders/reminder-time-parser.d.ts +41 -0
- package/dist/src/execution/reminders/reminder-time-parser.d.ts.map +1 -0
- package/dist/src/execution/reminders/reminder-time-parser.js +113 -0
- package/dist/src/execution/reminders/reminder-time-parser.js.map +1 -0
- package/dist/src/friction/auto-capture.d.ts +38 -0
- package/dist/src/friction/auto-capture.d.ts.map +1 -0
- package/dist/src/friction/auto-capture.js +133 -0
- package/dist/src/friction/auto-capture.js.map +1 -0
- package/dist/src/friction/client.d.ts +39 -0
- package/dist/src/friction/client.d.ts.map +1 -0
- package/dist/src/friction/client.js +165 -0
- package/dist/src/friction/client.js.map +1 -0
- package/dist/src/friction/config.d.ts +16 -0
- package/dist/src/friction/config.d.ts.map +1 -0
- package/dist/src/friction/config.js +56 -0
- package/dist/src/friction/config.js.map +1 -0
- package/dist/src/friction/github-auth.d.ts +41 -0
- package/dist/src/friction/github-auth.d.ts.map +1 -0
- package/dist/src/friction/github-auth.js +155 -0
- package/dist/src/friction/github-auth.js.map +1 -0
- package/dist/src/friction/github-issues.d.ts +51 -0
- package/dist/src/friction/github-issues.d.ts.map +1 -0
- package/dist/src/friction/github-issues.js +118 -0
- package/dist/src/friction/github-issues.js.map +1 -0
- package/dist/src/friction/payout-ledger.d.ts +45 -0
- package/dist/src/friction/payout-ledger.d.ts.map +1 -0
- package/dist/src/friction/payout-ledger.js +111 -0
- package/dist/src/friction/payout-ledger.js.map +1 -0
- package/dist/src/friction/queue.d.ts +42 -0
- package/dist/src/friction/queue.d.ts.map +1 -0
- package/dist/src/friction/queue.js +179 -0
- package/dist/src/friction/queue.js.map +1 -0
- package/dist/src/friction/reviewer.d.ts +42 -0
- package/dist/src/friction/reviewer.d.ts.map +1 -0
- package/dist/src/friction/reviewer.js +269 -0
- package/dist/src/friction/reviewer.js.map +1 -0
- package/dist/src/friction/types.d.ts +63 -0
- package/dist/src/friction/types.d.ts.map +1 -0
- package/dist/src/friction/types.js +18 -0
- package/dist/src/friction/types.js.map +1 -0
- package/dist/src/history/index.d.ts +39 -0
- package/dist/src/history/index.d.ts.map +1 -0
- package/dist/src/history/index.js +41 -0
- package/dist/src/history/index.js.map +1 -0
- package/dist/src/history/session-chain.d.ts +36 -0
- package/dist/src/history/session-chain.d.ts.map +1 -0
- package/dist/src/history/session-chain.js +91 -0
- package/dist/src/history/session-chain.js.map +1 -0
- package/dist/src/history/types.d.ts +130 -0
- package/dist/src/history/types.d.ts.map +1 -0
- package/dist/src/history/types.js +32 -0
- package/dist/src/history/types.js.map +1 -0
- package/dist/src/history/workflow-history.d.ts +48 -0
- package/dist/src/history/workflow-history.d.ts.map +1 -0
- package/dist/src/history/workflow-history.js +116 -0
- package/dist/src/history/workflow-history.js.map +1 -0
- package/dist/src/index.d.ts +88 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +58 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/intake/classify-intent-state.d.ts +20 -0
- package/dist/src/intake/classify-intent-state.d.ts.map +1 -0
- package/dist/src/intake/classify-intent-state.js +29 -0
- package/dist/src/intake/classify-intent-state.js.map +1 -0
- package/dist/src/intake/intake-service.d.ts +105 -0
- package/dist/src/intake/intake-service.d.ts.map +1 -0
- package/dist/src/intake/intake-service.js +407 -0
- package/dist/src/intake/intake-service.js.map +1 -0
- package/dist/src/intake/response-planner.d.ts +25 -0
- package/dist/src/intake/response-planner.d.ts.map +1 -0
- package/dist/src/intake/response-planner.js +52 -0
- package/dist/src/intake/response-planner.js.map +1 -0
- package/dist/src/intake/signal-extractor.d.ts +25 -0
- package/dist/src/intake/signal-extractor.d.ts.map +1 -0
- package/dist/src/intake/signal-extractor.js +42 -0
- package/dist/src/intake/signal-extractor.js.map +1 -0
- package/dist/src/intake/trace.d.ts +157 -0
- package/dist/src/intake/trace.d.ts.map +1 -0
- package/dist/src/intake/trace.js +38 -0
- package/dist/src/intake/trace.js.map +1 -0
- package/dist/src/intake/types.d.ts +70 -0
- package/dist/src/intake/types.d.ts.map +1 -0
- package/dist/src/intake/types.js +30 -0
- package/dist/src/intake/types.js.map +1 -0
- package/dist/src/interaction/defaults.d.ts +12 -0
- package/dist/src/interaction/defaults.d.ts.map +1 -0
- package/dist/src/interaction/defaults.js +26 -0
- package/dist/src/interaction/defaults.js.map +1 -0
- package/dist/src/interaction/guidance-order.d.ts +53 -0
- package/dist/src/interaction/guidance-order.d.ts.map +1 -0
- package/dist/src/interaction/guidance-order.js +131 -0
- package/dist/src/interaction/guidance-order.js.map +1 -0
- package/dist/src/interaction/observe.d.ts +57 -0
- package/dist/src/interaction/observe.d.ts.map +1 -0
- package/dist/src/interaction/observe.js +77 -0
- package/dist/src/interaction/observe.js.map +1 -0
- package/dist/src/interaction/selectors.d.ts +16 -0
- package/dist/src/interaction/selectors.d.ts.map +1 -0
- package/dist/src/interaction/selectors.js +23 -0
- package/dist/src/interaction/selectors.js.map +1 -0
- package/dist/src/interaction/types.d.ts +105 -0
- package/dist/src/interaction/types.d.ts.map +1 -0
- package/dist/src/interaction/types.js +48 -0
- package/dist/src/interaction/types.js.map +1 -0
- package/dist/src/interaction/updater.d.ts +22 -0
- package/dist/src/interaction/updater.d.ts.map +1 -0
- package/dist/src/interaction/updater.js +87 -0
- package/dist/src/interaction/updater.js.map +1 -0
- package/dist/src/present/boundary-explanation/boundary-explanation-detector.d.ts +48 -0
- package/dist/src/present/boundary-explanation/boundary-explanation-detector.d.ts.map +1 -0
- package/dist/src/present/boundary-explanation/boundary-explanation-detector.js +107 -0
- package/dist/src/present/boundary-explanation/boundary-explanation-detector.js.map +1 -0
- package/dist/src/present/boundary-explanation/boundary-explanation-types.d.ts +43 -0
- package/dist/src/present/boundary-explanation/boundary-explanation-types.d.ts.map +1 -0
- package/dist/src/present/boundary-explanation/boundary-explanation-types.js +20 -0
- package/dist/src/present/boundary-explanation/boundary-explanation-types.js.map +1 -0
- package/dist/src/present/boundary-explanation/index.d.ts +10 -0
- package/dist/src/present/boundary-explanation/index.d.ts.map +1 -0
- package/dist/src/present/boundary-explanation/index.js +2 -0
- package/dist/src/present/boundary-explanation/index.js.map +1 -0
- package/dist/src/present/control-visibility/control-visibility-assertions.d.ts +70 -0
- package/dist/src/present/control-visibility/control-visibility-assertions.d.ts.map +1 -0
- package/dist/src/present/control-visibility/control-visibility-assertions.js +138 -0
- package/dist/src/present/control-visibility/control-visibility-assertions.js.map +1 -0
- package/dist/src/present/control-visibility/control-visibility-evaluator.d.ts +67 -0
- package/dist/src/present/control-visibility/control-visibility-evaluator.d.ts.map +1 -0
- package/dist/src/present/control-visibility/control-visibility-evaluator.js +146 -0
- package/dist/src/present/control-visibility/control-visibility-evaluator.js.map +1 -0
- package/dist/src/present/control-visibility/control-visibility-types.d.ts +113 -0
- package/dist/src/present/control-visibility/control-visibility-types.d.ts.map +1 -0
- package/dist/src/present/control-visibility/control-visibility-types.js +24 -0
- package/dist/src/present/control-visibility/control-visibility-types.js.map +1 -0
- package/dist/src/present/control-visibility/index.d.ts +16 -0
- package/dist/src/present/control-visibility/index.d.ts.map +1 -0
- package/dist/src/present/control-visibility/index.js +15 -0
- package/dist/src/present/control-visibility/index.js.map +1 -0
- package/dist/src/present/format.d.ts +57 -0
- package/dist/src/present/format.d.ts.map +1 -0
- package/dist/src/present/format.js +150 -0
- package/dist/src/present/format.js.map +1 -0
- package/dist/src/present/present-coordinator.d.ts +153 -0
- package/dist/src/present/present-coordinator.d.ts.map +1 -0
- package/dist/src/present/present-coordinator.js +213 -0
- package/dist/src/present/present-coordinator.js.map +1 -0
- package/dist/src/present/reminders/index.d.ts +22 -0
- package/dist/src/present/reminders/index.d.ts.map +1 -0
- package/dist/src/present/reminders/index.js +22 -0
- package/dist/src/present/reminders/index.js.map +1 -0
- package/dist/src/present/reminders/reminder-presenter.d.ts +76 -0
- package/dist/src/present/reminders/reminder-presenter.d.ts.map +1 -0
- package/dist/src/present/reminders/reminder-presenter.js +359 -0
- package/dist/src/present/reminders/reminder-presenter.js.map +1 -0
- package/dist/src/present/reminders/reminder-renderer.d.ts +82 -0
- package/dist/src/present/reminders/reminder-renderer.d.ts.map +1 -0
- package/dist/src/present/reminders/reminder-renderer.js +136 -0
- package/dist/src/present/reminders/reminder-renderer.js.map +1 -0
- package/dist/src/present/reminders/reminder-types.d.ts +131 -0
- package/dist/src/present/reminders/reminder-types.d.ts.map +1 -0
- package/dist/src/present/reminders/reminder-types.js +29 -0
- package/dist/src/present/reminders/reminder-types.js.map +1 -0
- package/dist/src/present/types.d.ts +114 -0
- package/dist/src/present/types.d.ts.map +1 -0
- package/dist/src/present/types.js +18 -0
- package/dist/src/present/types.js.map +1 -0
- package/dist/src/product/claude-product-session.d.ts +146 -0
- package/dist/src/product/claude-product-session.d.ts.map +1 -0
- package/dist/src/product/claude-product-session.js +362 -0
- package/dist/src/product/claude-product-session.js.map +1 -0
- package/dist/src/product/cursor-product-session.d.ts +211 -0
- package/dist/src/product/cursor-product-session.d.ts.map +1 -0
- package/dist/src/product/cursor-product-session.js +390 -0
- package/dist/src/product/cursor-product-session.js.map +1 -0
- package/dist/src/product/index.d.ts +28 -0
- package/dist/src/product/index.d.ts.map +1 -0
- package/dist/src/product/index.js +22 -0
- package/dist/src/product/index.js.map +1 -0
- package/dist/src/product/session-resilience/index.d.ts +17 -0
- package/dist/src/product/session-resilience/index.d.ts.map +1 -0
- package/dist/src/product/session-resilience/index.js +15 -0
- package/dist/src/product/session-resilience/index.js.map +1 -0
- package/dist/src/product/session-resilience/session-serializer.d.ts +43 -0
- package/dist/src/product/session-resilience/session-serializer.d.ts.map +1 -0
- package/dist/src/product/session-resilience/session-serializer.js +84 -0
- package/dist/src/product/session-resilience/session-serializer.js.map +1 -0
- package/dist/src/product/session-resilience/session-snapshot-types.d.ts +35 -0
- package/dist/src/product/session-resilience/session-snapshot-types.d.ts.map +1 -0
- package/dist/src/product/session-resilience/session-snapshot-types.js +21 -0
- package/dist/src/product/session-resilience/session-snapshot-types.js.map +1 -0
- package/dist/src/product/session-resilience/session-staleness.d.ts +54 -0
- package/dist/src/product/session-resilience/session-staleness.d.ts.map +1 -0
- package/dist/src/product/session-resilience/session-staleness.js +62 -0
- package/dist/src/product/session-resilience/session-staleness.js.map +1 -0
- package/dist/src/product/session-resilience/session-summary.d.ts +40 -0
- package/dist/src/product/session-resilience/session-summary.d.ts.map +1 -0
- package/dist/src/product/session-resilience/session-summary.js +72 -0
- package/dist/src/product/session-resilience/session-summary.js.map +1 -0
- package/dist/src/prv/patterns.d.ts +32 -0
- package/dist/src/prv/patterns.d.ts.map +1 -0
- package/dist/src/prv/patterns.js +40 -0
- package/dist/src/prv/patterns.js.map +1 -0
- package/dist/src/prv/prv.d.ts +13 -0
- package/dist/src/prv/prv.d.ts.map +1 -0
- package/dist/src/prv/prv.js +22 -0
- package/dist/src/prv/prv.js.map +1 -0
- package/dist/src/prv/types.d.ts +26 -0
- package/dist/src/prv/types.d.ts.map +1 -0
- package/dist/src/prv/types.js +15 -0
- package/dist/src/prv/types.js.map +1 -0
- package/dist/src/safety/detectors/arbitrary-exec.detector.d.ts +3 -0
- package/dist/src/safety/detectors/arbitrary-exec.detector.d.ts.map +1 -0
- package/dist/src/safety/detectors/arbitrary-exec.detector.js +31 -0
- package/dist/src/safety/detectors/arbitrary-exec.detector.js.map +1 -0
- package/dist/src/safety/detectors/bulk-data-exfil.detector.d.ts +21 -0
- package/dist/src/safety/detectors/bulk-data-exfil.detector.d.ts.map +1 -0
- package/dist/src/safety/detectors/bulk-data-exfil.detector.js +90 -0
- package/dist/src/safety/detectors/bulk-data-exfil.detector.js.map +1 -0
- package/dist/src/safety/detectors/destructive.detector.d.ts +3 -0
- package/dist/src/safety/detectors/destructive.detector.d.ts.map +1 -0
- package/dist/src/safety/detectors/destructive.detector.js +28 -0
- package/dist/src/safety/detectors/destructive.detector.js.map +1 -0
- package/dist/src/safety/detectors/evasion.detector.d.ts +3 -0
- package/dist/src/safety/detectors/evasion.detector.d.ts.map +1 -0
- package/dist/src/safety/detectors/evasion.detector.js +28 -0
- package/dist/src/safety/detectors/evasion.detector.js.map +1 -0
- package/dist/src/safety/detectors/secret-access.detector.d.ts +31 -0
- package/dist/src/safety/detectors/secret-access.detector.d.ts.map +1 -0
- package/dist/src/safety/detectors/secret-access.detector.js +78 -0
- package/dist/src/safety/detectors/secret-access.detector.js.map +1 -0
- package/dist/src/safety/registry.d.ts +9 -0
- package/dist/src/safety/registry.d.ts.map +1 -0
- package/dist/src/safety/registry.js +22 -0
- package/dist/src/safety/registry.js.map +1 -0
- package/dist/src/safety/safety-gate.d.ts +16 -0
- package/dist/src/safety/safety-gate.d.ts.map +1 -0
- package/dist/src/safety/safety-gate.js +26 -0
- package/dist/src/safety/safety-gate.js.map +1 -0
- package/dist/src/safety/types.d.ts +35 -0
- package/dist/src/safety/types.d.ts.map +1 -0
- package/dist/src/safety/types.js +14 -0
- package/dist/src/safety/types.js.map +1 -0
- package/dist/src/shell/claude-shell.d.ts +63 -0
- package/dist/src/shell/claude-shell.d.ts.map +1 -0
- package/dist/src/shell/claude-shell.js +81 -0
- package/dist/src/shell/claude-shell.js.map +1 -0
- package/dist/src/shell/cli/friction-admin.d.ts +14 -0
- package/dist/src/shell/cli/friction-admin.d.ts.map +1 -0
- package/dist/src/shell/cli/friction-admin.js +276 -0
- package/dist/src/shell/cli/friction-admin.js.map +1 -0
- package/dist/src/shell/cli/friction-report.d.ts +16 -0
- package/dist/src/shell/cli/friction-report.d.ts.map +1 -0
- package/dist/src/shell/cli/friction-report.js +156 -0
- package/dist/src/shell/cli/friction-report.js.map +1 -0
- package/dist/src/shell/cli/main.d.ts +68 -0
- package/dist/src/shell/cli/main.d.ts.map +1 -0
- package/dist/src/shell/cli/main.js +488 -0
- package/dist/src/shell/cli/main.js.map +1 -0
- package/dist/src/shell/cli/use-steady.d.ts +26 -0
- package/dist/src/shell/cli/use-steady.d.ts.map +1 -0
- package/dist/src/shell/cli/use-steady.js +117 -0
- package/dist/src/shell/cli/use-steady.js.map +1 -0
- package/dist/src/shell/cursor-shell.d.ts +63 -0
- package/dist/src/shell/cursor-shell.d.ts.map +1 -0
- package/dist/src/shell/cursor-shell.js +88 -0
- package/dist/src/shell/cursor-shell.js.map +1 -0
- package/dist/src/shell/defaults.d.ts +51 -0
- package/dist/src/shell/defaults.d.ts.map +1 -0
- package/dist/src/shell/defaults.js +78 -0
- package/dist/src/shell/defaults.js.map +1 -0
- package/dist/src/shell/history-render.d.ts +56 -0
- package/dist/src/shell/history-render.d.ts.map +1 -0
- package/dist/src/shell/history-render.js +166 -0
- package/dist/src/shell/history-render.js.map +1 -0
- package/dist/src/shell/index.d.ts +43 -0
- package/dist/src/shell/index.d.ts.map +1 -0
- package/dist/src/shell/index.js +45 -0
- package/dist/src/shell/index.js.map +1 -0
- package/dist/src/shell/render.d.ts +42 -0
- package/dist/src/shell/render.d.ts.map +1 -0
- package/dist/src/shell/render.js +122 -0
- package/dist/src/shell/render.js.map +1 -0
- package/dist/src/shell/types.d.ts +46 -0
- package/dist/src/shell/types.d.ts.map +1 -0
- package/dist/src/shell/types.js +19 -0
- package/dist/src/shell/types.js.map +1 -0
- package/dist/src/shell/workflow-defaults.d.ts +23 -0
- package/dist/src/shell/workflow-defaults.d.ts.map +1 -0
- package/dist/src/shell/workflow-defaults.js +27 -0
- package/dist/src/shell/workflow-defaults.js.map +1 -0
- package/dist/src/shell/workflow-render.d.ts +54 -0
- package/dist/src/shell/workflow-render.d.ts.map +1 -0
- package/dist/src/shell/workflow-render.js +319 -0
- package/dist/src/shell/workflow-render.js.map +1 -0
- package/dist/src/shell/workflow-shell.d.ts +110 -0
- package/dist/src/shell/workflow-shell.d.ts.map +1 -0
- package/dist/src/shell/workflow-shell.js +180 -0
- package/dist/src/shell/workflow-shell.js.map +1 -0
- package/dist/src/skills/audit.d.ts +118 -0
- package/dist/src/skills/audit.d.ts.map +1 -0
- package/dist/src/skills/audit.js +147 -0
- package/dist/src/skills/audit.js.map +1 -0
- package/dist/src/skills/invocation.d.ts +131 -0
- package/dist/src/skills/invocation.d.ts.map +1 -0
- package/dist/src/skills/invocation.js +165 -0
- package/dist/src/skills/invocation.js.map +1 -0
- package/dist/src/skills/loader.d.ts +70 -0
- package/dist/src/skills/loader.d.ts.map +1 -0
- package/dist/src/skills/loader.js +220 -0
- package/dist/src/skills/loader.js.map +1 -0
- package/dist/src/skills/local-recovery-adapter.d.ts +49 -0
- package/dist/src/skills/local-recovery-adapter.d.ts.map +1 -0
- package/dist/src/skills/local-recovery-adapter.js +184 -0
- package/dist/src/skills/local-recovery-adapter.js.map +1 -0
- package/dist/src/skills/parser.d.ts +53 -0
- package/dist/src/skills/parser.d.ts.map +1 -0
- package/dist/src/skills/parser.js +336 -0
- package/dist/src/skills/parser.js.map +1 -0
- package/dist/src/skills/registry.d.ts +123 -0
- package/dist/src/skills/registry.d.ts.map +1 -0
- package/dist/src/skills/registry.js +144 -0
- package/dist/src/skills/registry.js.map +1 -0
- package/dist/src/skills/types.d.ts +242 -0
- package/dist/src/skills/types.d.ts.map +1 -0
- package/dist/src/skills/types.js +50 -0
- package/dist/src/skills/types.js.map +1 -0
- package/dist/src/skills/validator.d.ts +31 -0
- package/dist/src/skills/validator.d.ts.map +1 -0
- package/dist/src/skills/validator.js +366 -0
- package/dist/src/skills/validator.js.map +1 -0
- package/dist/src/ucp/envelope.d.ts +165 -0
- package/dist/src/ucp/envelope.d.ts.map +1 -0
- package/dist/src/ucp/envelope.js +241 -0
- package/dist/src/ucp/envelope.js.map +1 -0
- package/dist/src/ucp/hashes.d.ts +36 -0
- package/dist/src/ucp/hashes.d.ts.map +1 -0
- package/dist/src/ucp/hashes.js +59 -0
- package/dist/src/ucp/hashes.js.map +1 -0
- package/dist/src/ucp/mappers/map-artifact.d.ts +58 -0
- package/dist/src/ucp/mappers/map-artifact.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-artifact.js +51 -0
- package/dist/src/ucp/mappers/map-artifact.js.map +1 -0
- package/dist/src/ucp/mappers/map-change-interpretation.d.ts +12 -0
- package/dist/src/ucp/mappers/map-change-interpretation.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-change-interpretation.js +18 -0
- package/dist/src/ucp/mappers/map-change-interpretation.js.map +1 -0
- package/dist/src/ucp/mappers/map-completion.d.ts +10 -0
- package/dist/src/ucp/mappers/map-completion.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-completion.js +24 -0
- package/dist/src/ucp/mappers/map-completion.js.map +1 -0
- package/dist/src/ucp/mappers/map-context.d.ts +9 -0
- package/dist/src/ucp/mappers/map-context.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-context.js +13 -0
- package/dist/src/ucp/mappers/map-context.js.map +1 -0
- package/dist/src/ucp/mappers/map-debug-trace.d.ts +10 -0
- package/dist/src/ucp/mappers/map-debug-trace.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-debug-trace.js +18 -0
- package/dist/src/ucp/mappers/map-debug-trace.js.map +1 -0
- package/dist/src/ucp/mappers/map-disambiguation.d.ts +10 -0
- package/dist/src/ucp/mappers/map-disambiguation.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-disambiguation.js +21 -0
- package/dist/src/ucp/mappers/map-disambiguation.js.map +1 -0
- package/dist/src/ucp/mappers/map-execution-trace.d.ts +64 -0
- package/dist/src/ucp/mappers/map-execution-trace.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-execution-trace.js +57 -0
- package/dist/src/ucp/mappers/map-execution-trace.js.map +1 -0
- package/dist/src/ucp/mappers/map-intent-interpretation.d.ts +11 -0
- package/dist/src/ucp/mappers/map-intent-interpretation.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-intent-interpretation.js +17 -0
- package/dist/src/ucp/mappers/map-intent-interpretation.js.map +1 -0
- package/dist/src/ucp/mappers/map-intent.d.ts +9 -0
- package/dist/src/ucp/mappers/map-intent.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-intent.js +11 -0
- package/dist/src/ucp/mappers/map-intent.js.map +1 -0
- package/dist/src/ucp/mappers/map-prv.d.ts +10 -0
- package/dist/src/ucp/mappers/map-prv.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-prv.js +14 -0
- package/dist/src/ucp/mappers/map-prv.js.map +1 -0
- package/dist/src/ucp/mappers/map-reminder-execution.d.ts +57 -0
- package/dist/src/ucp/mappers/map-reminder-execution.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-reminder-execution.js +69 -0
- package/dist/src/ucp/mappers/map-reminder-execution.js.map +1 -0
- package/dist/src/ucp/mappers/map-replay-report.d.ts +81 -0
- package/dist/src/ucp/mappers/map-replay-report.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-replay-report.js +76 -0
- package/dist/src/ucp/mappers/map-replay-report.js.map +1 -0
- package/dist/src/ucp/mappers/map-response.d.ts +13 -0
- package/dist/src/ucp/mappers/map-response.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-response.js +25 -0
- package/dist/src/ucp/mappers/map-response.js.map +1 -0
- package/dist/src/ucp/mappers/map-safety.d.ts +14 -0
- package/dist/src/ucp/mappers/map-safety.d.ts.map +1 -0
- package/dist/src/ucp/mappers/map-safety.js +22 -0
- package/dist/src/ucp/mappers/map-safety.js.map +1 -0
- package/dist/src/ucp/persistence/index.d.ts +24 -0
- package/dist/src/ucp/persistence/index.d.ts.map +1 -0
- package/dist/src/ucp/persistence/index.js +22 -0
- package/dist/src/ucp/persistence/index.js.map +1 -0
- package/dist/src/ucp/persistence/query.d.ts +164 -0
- package/dist/src/ucp/persistence/query.d.ts.map +1 -0
- package/dist/src/ucp/persistence/query.js +240 -0
- package/dist/src/ucp/persistence/query.js.map +1 -0
- package/dist/src/ucp/persistence/reader.d.ts +43 -0
- package/dist/src/ucp/persistence/reader.d.ts.map +1 -0
- package/dist/src/ucp/persistence/reader.js +104 -0
- package/dist/src/ucp/persistence/reader.js.map +1 -0
- package/dist/src/ucp/persistence/store.d.ts +77 -0
- package/dist/src/ucp/persistence/store.d.ts.map +1 -0
- package/dist/src/ucp/persistence/store.js +177 -0
- package/dist/src/ucp/persistence/store.js.map +1 -0
- package/dist/src/ucp/persistence/write.d.ts +48 -0
- package/dist/src/ucp/persistence/write.d.ts.map +1 -0
- package/dist/src/ucp/persistence/write.js +59 -0
- package/dist/src/ucp/persistence/write.js.map +1 -0
- package/dist/src/ucp/projection.d.ts +146 -0
- package/dist/src/ucp/projection.d.ts.map +1 -0
- package/dist/src/ucp/projection.js +139 -0
- package/dist/src/ucp/projection.js.map +1 -0
- package/dist/src/ucp/types.d.ts +585 -0
- package/dist/src/ucp/types.d.ts.map +1 -0
- package/dist/src/ucp/types.js +57 -0
- package/dist/src/ucp/types.js.map +1 -0
- package/dist/src/understand/completion/completion.d.ts +26 -0
- package/dist/src/understand/completion/completion.d.ts.map +1 -0
- package/dist/src/understand/completion/completion.js +45 -0
- package/dist/src/understand/completion/completion.js.map +1 -0
- package/dist/src/understand/completion/rules.d.ts +61 -0
- package/dist/src/understand/completion/rules.d.ts.map +1 -0
- package/dist/src/understand/completion/rules.js +268 -0
- package/dist/src/understand/completion/rules.js.map +1 -0
- package/dist/src/understand/completion/types.d.ts +68 -0
- package/dist/src/understand/completion/types.d.ts.map +1 -0
- package/dist/src/understand/completion/types.js +34 -0
- package/dist/src/understand/completion/types.js.map +1 -0
- package/dist/src/understand/context/context-alignment.d.ts +18 -0
- package/dist/src/understand/context/context-alignment.d.ts.map +1 -0
- package/dist/src/understand/context/context-alignment.js +61 -0
- package/dist/src/understand/context/context-alignment.js.map +1 -0
- package/dist/src/understand/context/types.d.ts +20 -0
- package/dist/src/understand/context/types.d.ts.map +1 -0
- package/dist/src/understand/context/types.js +13 -0
- package/dist/src/understand/context/types.js.map +1 -0
- package/dist/src/understand/disambiguation/detectors/missing-context.detector.d.ts +12 -0
- package/dist/src/understand/disambiguation/detectors/missing-context.detector.d.ts.map +1 -0
- package/dist/src/understand/disambiguation/detectors/missing-context.detector.js +60 -0
- package/dist/src/understand/disambiguation/detectors/missing-context.detector.js.map +1 -0
- package/dist/src/understand/disambiguation/detectors/overloaded-term.detector.d.ts +13 -0
- package/dist/src/understand/disambiguation/detectors/overloaded-term.detector.d.ts.map +1 -0
- package/dist/src/understand/disambiguation/detectors/overloaded-term.detector.js +57 -0
- package/dist/src/understand/disambiguation/detectors/overloaded-term.detector.js.map +1 -0
- package/dist/src/understand/disambiguation/detectors/typo-adjacent.detector.d.ts +16 -0
- package/dist/src/understand/disambiguation/detectors/typo-adjacent.detector.d.ts.map +1 -0
- package/dist/src/understand/disambiguation/detectors/typo-adjacent.detector.js +56 -0
- package/dist/src/understand/disambiguation/detectors/typo-adjacent.detector.js.map +1 -0
- package/dist/src/understand/disambiguation/registry.d.ts +14 -0
- package/dist/src/understand/disambiguation/registry.d.ts.map +1 -0
- package/dist/src/understand/disambiguation/registry.js +27 -0
- package/dist/src/understand/disambiguation/registry.js.map +1 -0
- package/dist/src/understand/disambiguation/types.d.ts +34 -0
- package/dist/src/understand/disambiguation/types.d.ts.map +1 -0
- package/dist/src/understand/disambiguation/types.js +15 -0
- package/dist/src/understand/disambiguation/types.js.map +1 -0
- package/dist/src/understand/intent-interpretation/intent-interpretation.d.ts +86 -0
- package/dist/src/understand/intent-interpretation/intent-interpretation.d.ts.map +1 -0
- package/dist/src/understand/intent-interpretation/intent-interpretation.js +141 -0
- package/dist/src/understand/intent-interpretation/intent-interpretation.js.map +1 -0
- package/dist/src/understand/intent-interpretation/interpreters/color-intent.interpreter.d.ts +33 -0
- package/dist/src/understand/intent-interpretation/interpreters/color-intent.interpreter.d.ts.map +1 -0
- package/dist/src/understand/intent-interpretation/interpreters/color-intent.interpreter.js +66 -0
- package/dist/src/understand/intent-interpretation/interpreters/color-intent.interpreter.js.map +1 -0
- package/dist/src/understand/intent-interpretation/interpreters/config-intent.interpreter.d.ts +20 -0
- package/dist/src/understand/intent-interpretation/interpreters/config-intent.interpreter.d.ts.map +1 -0
- package/dist/src/understand/intent-interpretation/interpreters/config-intent.interpreter.js +80 -0
- package/dist/src/understand/intent-interpretation/interpreters/config-intent.interpreter.js.map +1 -0
- package/dist/src/understand/intent-interpretation/interpreters/text-intent.interpreter.d.ts +25 -0
- package/dist/src/understand/intent-interpretation/interpreters/text-intent.interpreter.d.ts.map +1 -0
- package/dist/src/understand/intent-interpretation/interpreters/text-intent.interpreter.js +47 -0
- package/dist/src/understand/intent-interpretation/interpreters/text-intent.interpreter.js.map +1 -0
- package/dist/src/understand/intent-interpretation/interpreters/workflow-intent.interpreter.d.ts +35 -0
- package/dist/src/understand/intent-interpretation/interpreters/workflow-intent.interpreter.d.ts.map +1 -0
- package/dist/src/understand/intent-interpretation/interpreters/workflow-intent.interpreter.js +89 -0
- package/dist/src/understand/intent-interpretation/interpreters/workflow-intent.interpreter.js.map +1 -0
- package/dist/src/understand/intent-interpretation/registry.d.ts +18 -0
- package/dist/src/understand/intent-interpretation/registry.d.ts.map +1 -0
- package/dist/src/understand/intent-interpretation/registry.js +26 -0
- package/dist/src/understand/intent-interpretation/registry.js.map +1 -0
- package/dist/src/understand/intent-interpretation/types.d.ts +83 -0
- package/dist/src/understand/intent-interpretation/types.d.ts.map +1 -0
- package/dist/src/understand/intent-interpretation/types.js +40 -0
- package/dist/src/understand/intent-interpretation/types.js.map +1 -0
- package/dist/src/understand/interpretation/intent.d.ts +72 -0
- package/dist/src/understand/interpretation/intent.d.ts.map +1 -0
- package/dist/src/understand/interpretation/intent.js +414 -0
- package/dist/src/understand/interpretation/intent.js.map +1 -0
- package/dist/src/understand/interpretation/interpretation.d.ts +26 -0
- package/dist/src/understand/interpretation/interpretation.d.ts.map +1 -0
- package/dist/src/understand/interpretation/interpretation.js +43 -0
- package/dist/src/understand/interpretation/interpretation.js.map +1 -0
- package/dist/src/understand/interpretation/parser.d.ts +20 -0
- package/dist/src/understand/interpretation/parser.d.ts.map +1 -0
- package/dist/src/understand/interpretation/parser.js +88 -0
- package/dist/src/understand/interpretation/parser.js.map +1 -0
- package/dist/src/understand/interpretation/rules.d.ts +19 -0
- package/dist/src/understand/interpretation/rules.d.ts.map +1 -0
- package/dist/src/understand/interpretation/rules.js +222 -0
- package/dist/src/understand/interpretation/rules.js.map +1 -0
- package/dist/src/understand/interpretation/types.d.ts +90 -0
- package/dist/src/understand/interpretation/types.d.ts.map +1 -0
- package/dist/src/understand/interpretation/types.js +29 -0
- package/dist/src/understand/interpretation/types.js.map +1 -0
- package/dist/src/understand/shared/types.d.ts +13 -0
- package/dist/src/understand/shared/types.d.ts.map +1 -0
- package/dist/src/understand/shared/types.js +9 -0
- package/dist/src/understand/shared/types.js.map +1 -0
- package/dist/src/understand/silent-guidance/index.d.ts +4 -0
- package/dist/src/understand/silent-guidance/index.d.ts.map +1 -0
- package/dist/src/understand/silent-guidance/index.js +3 -0
- package/dist/src/understand/silent-guidance/index.js.map +1 -0
- package/dist/src/understand/silent-guidance/selector.d.ts +44 -0
- package/dist/src/understand/silent-guidance/selector.d.ts.map +1 -0
- package/dist/src/understand/silent-guidance/selector.js +158 -0
- package/dist/src/understand/silent-guidance/selector.js.map +1 -0
- package/dist/src/understand/silent-guidance/templates.d.ts +31 -0
- package/dist/src/understand/silent-guidance/templates.d.ts.map +1 -0
- package/dist/src/understand/silent-guidance/templates.js +109 -0
- package/dist/src/understand/silent-guidance/templates.js.map +1 -0
- package/dist/src/understand/silent-guidance/types.d.ts +36 -0
- package/dist/src/understand/silent-guidance/types.d.ts.map +1 -0
- package/dist/src/understand/silent-guidance/types.js +2 -0
- package/dist/src/understand/silent-guidance/types.js.map +1 -0
- package/dist/src/workflow/coordinator.d.ts +197 -0
- package/dist/src/workflow/coordinator.d.ts.map +1 -0
- package/dist/src/workflow/coordinator.js +682 -0
- package/dist/src/workflow/coordinator.js.map +1 -0
- package/dist/src/workflow/index.d.ts +30 -0
- package/dist/src/workflow/index.d.ts.map +1 -0
- package/dist/src/workflow/index.js +30 -0
- package/dist/src/workflow/index.js.map +1 -0
- package/dist/src/workflow/types.d.ts +213 -0
- package/dist/src/workflow/types.d.ts.map +1 -0
- package/dist/src/workflow/types.js +27 -0
- package/dist/src/workflow/types.js.map +1 -0
- package/package.json +54 -0
- package/ui/README.md +73 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boundary Explanation detector — Phase 5C.
|
|
3
|
+
*
|
|
4
|
+
* Pure, deterministic functions that map already-available state to a
|
|
5
|
+
* BoundaryExplanation. No re-interpretation, no state mutation.
|
|
6
|
+
*
|
|
7
|
+
* ── Decision order (first-match-wins) ────────────────────────────────────────
|
|
8
|
+
*
|
|
9
|
+
* 1. question_form_needs_action mode = clarify + question-shaped input
|
|
10
|
+
* 2. multi_intent_first_only compound-verb input, mode = guide or execute
|
|
11
|
+
* 3. needs_specific_target mode = guide, guided_recovery, missing file target
|
|
12
|
+
* 4. policy_may_block_target set by coordinator when 5D contradiction detected
|
|
13
|
+
* (this detector does not produce it — it requires parsedChange + policy)
|
|
14
|
+
* 5. scope_must_be_narrowed mode = guide, incomplete, missing fields present
|
|
15
|
+
* 6. not_ready_missing_fields mode = guide, missing fields present (general fallback)
|
|
16
|
+
*
|
|
17
|
+
* For the reminder path, detectReminderBoundaryExplanation is used instead.
|
|
18
|
+
*
|
|
19
|
+
* ── Authority constraint ──────────────────────────────────────────────────────
|
|
20
|
+
*
|
|
21
|
+
* Reads: mode, intentState, guidance.missing, rawInput.
|
|
22
|
+
* Must not re-run any interpreter or completion logic.
|
|
23
|
+
* Must not inspect the filesystem or any external environment.
|
|
24
|
+
* Must not modify any shared state.
|
|
25
|
+
*/
|
|
26
|
+
import type { IntakeResult } from "../../intake/types.js";
|
|
27
|
+
import type { DebugTrace } from "../../intake/trace.js";
|
|
28
|
+
import type { BoundaryExplanation } from "./boundary-explanation-types.js";
|
|
29
|
+
type ReminderLike = {
|
|
30
|
+
readonly state: "ready_to_confirm" | "needs_time" | "needs_subject" | "ambiguous";
|
|
31
|
+
readonly missing?: readonly string[];
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Detect the single most relevant boundary explanation for an intake result.
|
|
35
|
+
*
|
|
36
|
+
* Returns undefined when no explanation is warranted.
|
|
37
|
+
* Never returns more than one explanation.
|
|
38
|
+
*/
|
|
39
|
+
export declare function detectBoundaryExplanation(rawInput: string, intakeResult: IntakeResult, _trace?: DebugTrace): BoundaryExplanation | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Detect a boundary explanation for a reminder presentation.
|
|
42
|
+
*
|
|
43
|
+
* Only "not_ready_missing_fields" applies to the reminder path.
|
|
44
|
+
* Other codes are intake-only.
|
|
45
|
+
*/
|
|
46
|
+
export declare function detectReminderBoundaryExplanation(presentation: ReminderLike): BoundaryExplanation | undefined;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=boundary-explanation-detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boundary-explanation-detector.d.ts","sourceRoot":"","sources":["../../../../src/present/boundary-explanation/boundary-explanation-detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAQ,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAA2B,MAAM,iCAAiC,CAAC;AAIpG,KAAK,YAAY,GAAG;IAClB,QAAQ,CAAC,KAAK,EAAE,kBAAkB,GAAG,YAAY,GAAG,eAAe,GAAG,WAAW,CAAC;IAClF,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACtC,CAAC;AAmDF;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAM,MAAM,EACpB,YAAY,EAAE,YAAY,EAC1B,MAAM,CAAC,EAAO,UAAU,GACvB,mBAAmB,GAAG,SAAS,CAgCjC;AAID;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC/C,YAAY,EAAE,YAAY,GACzB,mBAAmB,GAAG,SAAS,CAKjC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boundary Explanation detector — Phase 5C.
|
|
3
|
+
*
|
|
4
|
+
* Pure, deterministic functions that map already-available state to a
|
|
5
|
+
* BoundaryExplanation. No re-interpretation, no state mutation.
|
|
6
|
+
*
|
|
7
|
+
* ── Decision order (first-match-wins) ────────────────────────────────────────
|
|
8
|
+
*
|
|
9
|
+
* 1. question_form_needs_action mode = clarify + question-shaped input
|
|
10
|
+
* 2. multi_intent_first_only compound-verb input, mode = guide or execute
|
|
11
|
+
* 3. needs_specific_target mode = guide, guided_recovery, missing file target
|
|
12
|
+
* 4. policy_may_block_target set by coordinator when 5D contradiction detected
|
|
13
|
+
* (this detector does not produce it — it requires parsedChange + policy)
|
|
14
|
+
* 5. scope_must_be_narrowed mode = guide, incomplete, missing fields present
|
|
15
|
+
* 6. not_ready_missing_fields mode = guide, missing fields present (general fallback)
|
|
16
|
+
*
|
|
17
|
+
* For the reminder path, detectReminderBoundaryExplanation is used instead.
|
|
18
|
+
*
|
|
19
|
+
* ── Authority constraint ──────────────────────────────────────────────────────
|
|
20
|
+
*
|
|
21
|
+
* Reads: mode, intentState, guidance.missing, rawInput.
|
|
22
|
+
* Must not re-run any interpreter or completion logic.
|
|
23
|
+
* Must not inspect the filesystem or any external environment.
|
|
24
|
+
* Must not modify any shared state.
|
|
25
|
+
*/
|
|
26
|
+
// ─── Deterministic message catalog ───────────────────────────────────────────
|
|
27
|
+
const MESSAGES = {
|
|
28
|
+
question_form_needs_action: "This is phrased as a question rather than a command. Rephrase as a direct action — for example, 'Change X to Y in file Z' — to proceed.",
|
|
29
|
+
multi_intent_first_only: "This input contains more than one action. Only the first was processed. Submit the remaining actions separately.",
|
|
30
|
+
needs_specific_target: "The intent is clear, but the target location is missing. Provide the specific file or value to change.",
|
|
31
|
+
policy_may_block_target: "This change is structurally executable, but the target file may be restricted by policy. Review the target before approving.",
|
|
32
|
+
scope_must_be_narrowed: "The scope of this change is too broad to act on safely. Narrow to a specific file, section, or value.",
|
|
33
|
+
not_ready_missing_fields: "Some required fields are missing. Provide the missing information to complete the request.",
|
|
34
|
+
};
|
|
35
|
+
// ─── Question-form detection ──────────────────────────────────────────────────
|
|
36
|
+
const QUESTION_LEAD = /^(how|what|why|can|is|are|does|do|will|would|should|could|when|where|which)\b/i;
|
|
37
|
+
function isQuestionForm(input) {
|
|
38
|
+
const trimmed = input.trim();
|
|
39
|
+
return trimmed.endsWith("?") || QUESTION_LEAD.test(trimmed);
|
|
40
|
+
}
|
|
41
|
+
// ─── Compound-action detection ────────────────────────────────────────────────
|
|
42
|
+
const COMPOUND_CONNECTORS = /\b(and|then)\b/i;
|
|
43
|
+
// Verbs that indicate deliberate actions (not description verbs like "is", "has").
|
|
44
|
+
const ACTION_VERB = /\b(change|update|replace|fix|set|add|remove|delete|deploy|restart|check|run|create|modify|install|enable|disable|toggle|revert|rollback|push|pull|send|export|import|launch|rename|move|copy|reset|apply|configure|upgrade|downgrade|start|stop|kill|flush|migrate|rebuild|clear)\b/gi;
|
|
45
|
+
function hasCompoundActions(input) {
|
|
46
|
+
if (!COMPOUND_CONNECTORS.test(input))
|
|
47
|
+
return false;
|
|
48
|
+
const hits = Array.from(input.matchAll(ACTION_VERB));
|
|
49
|
+
return hits.length >= 2;
|
|
50
|
+
}
|
|
51
|
+
// ─── Missing file-target detection ───────────────────────────────────────────
|
|
52
|
+
const FILE_FIELD_TERMS = /\b(file|path|location|component|module|directory|folder|target|where)\b/i;
|
|
53
|
+
function hasMissingFileTarget(intakeResult) {
|
|
54
|
+
const missing = intakeResult.guidance?.missing ?? [];
|
|
55
|
+
return missing.some(f => FILE_FIELD_TERMS.test(f));
|
|
56
|
+
}
|
|
57
|
+
// ─── Main detector (intake path) ─────────────────────────────────────────────
|
|
58
|
+
/**
|
|
59
|
+
* Detect the single most relevant boundary explanation for an intake result.
|
|
60
|
+
*
|
|
61
|
+
* Returns undefined when no explanation is warranted.
|
|
62
|
+
* Never returns more than one explanation.
|
|
63
|
+
*/
|
|
64
|
+
export function detectBoundaryExplanation(rawInput, intakeResult, _trace) {
|
|
65
|
+
const { mode, intentState, guidance } = intakeResult;
|
|
66
|
+
// 1. question_form_needs_action
|
|
67
|
+
if (mode === "clarify" && isQuestionForm(rawInput)) {
|
|
68
|
+
return explain("question_form_needs_action");
|
|
69
|
+
}
|
|
70
|
+
// 2. multi_intent_first_only
|
|
71
|
+
if ((mode === "guide" || mode === "execute") && hasCompoundActions(rawInput)) {
|
|
72
|
+
return explain("multi_intent_first_only");
|
|
73
|
+
}
|
|
74
|
+
// 3. needs_specific_target
|
|
75
|
+
if (mode === "guide" && intentState === "guided_recovery" && hasMissingFileTarget(intakeResult)) {
|
|
76
|
+
return explain("needs_specific_target");
|
|
77
|
+
}
|
|
78
|
+
// 4. policy_may_block_target — NOT produced here; requires parsedChange + policy.
|
|
79
|
+
// The coordinator injects it after 5D cross-layer detection.
|
|
80
|
+
// 5. scope_must_be_narrowed
|
|
81
|
+
if (mode === "guide" && intentState === "incomplete" && (guidance?.missing.length ?? 0) > 0) {
|
|
82
|
+
return explain("scope_must_be_narrowed");
|
|
83
|
+
}
|
|
84
|
+
// 6. not_ready_missing_fields (guide fallback when missing fields exist)
|
|
85
|
+
if (mode === "guide" && (guidance?.missing.length ?? 0) > 0) {
|
|
86
|
+
return explain("not_ready_missing_fields");
|
|
87
|
+
}
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
// ─── Reminder path detector ───────────────────────────────────────────────────
|
|
91
|
+
/**
|
|
92
|
+
* Detect a boundary explanation for a reminder presentation.
|
|
93
|
+
*
|
|
94
|
+
* Only "not_ready_missing_fields" applies to the reminder path.
|
|
95
|
+
* Other codes are intake-only.
|
|
96
|
+
*/
|
|
97
|
+
export function detectReminderBoundaryExplanation(presentation) {
|
|
98
|
+
if (presentation.state === "needs_time" || presentation.state === "needs_subject") {
|
|
99
|
+
return explain("not_ready_missing_fields");
|
|
100
|
+
}
|
|
101
|
+
return undefined;
|
|
102
|
+
}
|
|
103
|
+
// ─── Factory helper ───────────────────────────────────────────────────────────
|
|
104
|
+
function explain(code) {
|
|
105
|
+
return { code, message: MESSAGES[code] };
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=boundary-explanation-detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boundary-explanation-detector.js","sourceRoot":"","sources":["../../../../src/present/boundary-explanation/boundary-explanation-detector.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boundary Explanation types — Phase 5C.
|
|
3
|
+
*
|
|
4
|
+
* Provides human-legible explanations for correct-but-confusing routing decisions.
|
|
5
|
+
*
|
|
6
|
+
* ── Authority constraint ──────────────────────────────────────────────────────
|
|
7
|
+
*
|
|
8
|
+
* Boundary explanations are metadata only.
|
|
9
|
+
* They describe decisions that have already been made.
|
|
10
|
+
* They do not re-evaluate, override, or change any routing decision.
|
|
11
|
+
* They do not affect CVG signal levels.
|
|
12
|
+
* They do not affect confirm enablement.
|
|
13
|
+
*
|
|
14
|
+
* ── Stacking rule ────────────────────────────────────────────────────────────
|
|
15
|
+
*
|
|
16
|
+
* Exactly one explanation may appear per presentation result.
|
|
17
|
+
* First-match-wins. No stacking. No combining.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* BoundaryExplanationCode — the semantic identity of the boundary encountered.
|
|
21
|
+
*
|
|
22
|
+
* question_form_needs_action Input was phrased as a question, not a command.
|
|
23
|
+
* multi_intent_first_only Compound input: only the first action was processed.
|
|
24
|
+
* needs_specific_target Intent is clear but the target location is missing.
|
|
25
|
+
* policy_may_block_target Target is structurally reachable but may be policy-blocked.
|
|
26
|
+
* scope_must_be_narrowed Scope is too broad to act on safely.
|
|
27
|
+
* not_ready_missing_fields Required fields are absent (reminder path).
|
|
28
|
+
*/
|
|
29
|
+
export type BoundaryExplanationCode = "question_form_needs_action" | "multi_intent_first_only" | "needs_specific_target" | "policy_may_block_target" | "scope_must_be_narrowed" | "not_ready_missing_fields";
|
|
30
|
+
/**
|
|
31
|
+
* BoundaryExplanation — one explanation attached to a presentation result.
|
|
32
|
+
*
|
|
33
|
+
* code — stable identifier used by consumers for rendering decisions
|
|
34
|
+
* message — deterministic, human-readable explanation text
|
|
35
|
+
*
|
|
36
|
+
* This field is either absent (no boundary detected) or present (one boundary).
|
|
37
|
+
* It is never null. It never stacks.
|
|
38
|
+
*/
|
|
39
|
+
export type BoundaryExplanation = {
|
|
40
|
+
readonly code: BoundaryExplanationCode;
|
|
41
|
+
readonly message: string;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=boundary-explanation-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boundary-explanation-types.d.ts","sourceRoot":"","sources":["../../../../src/present/boundary-explanation/boundary-explanation-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH;;;;;;;;;GASG;AACH,MAAM,MAAM,uBAAuB,GAC/B,4BAA4B,GAC5B,yBAAyB,GACzB,uBAAuB,GACvB,yBAAyB,GACzB,wBAAwB,GACxB,0BAA0B,CAAC;AAI/B;;;;;;;;GAQG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,IAAI,EAAK,uBAAuB,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boundary Explanation types — Phase 5C.
|
|
3
|
+
*
|
|
4
|
+
* Provides human-legible explanations for correct-but-confusing routing decisions.
|
|
5
|
+
*
|
|
6
|
+
* ── Authority constraint ──────────────────────────────────────────────────────
|
|
7
|
+
*
|
|
8
|
+
* Boundary explanations are metadata only.
|
|
9
|
+
* They describe decisions that have already been made.
|
|
10
|
+
* They do not re-evaluate, override, or change any routing decision.
|
|
11
|
+
* They do not affect CVG signal levels.
|
|
12
|
+
* They do not affect confirm enablement.
|
|
13
|
+
*
|
|
14
|
+
* ── Stacking rule ────────────────────────────────────────────────────────────
|
|
15
|
+
*
|
|
16
|
+
* Exactly one explanation may appear per presentation result.
|
|
17
|
+
* First-match-wins. No stacking. No combining.
|
|
18
|
+
*/
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=boundary-explanation-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"boundary-explanation-types.js","sourceRoot":"","sources":["../../../../src/present/boundary-explanation/boundary-explanation-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Boundary Explanation — Phase 5C public API.
|
|
3
|
+
*
|
|
4
|
+
* Exports types and detection functions.
|
|
5
|
+
* This module is presentation-layer only.
|
|
6
|
+
* It has zero authority over routing, mode, or confirm decisions.
|
|
7
|
+
*/
|
|
8
|
+
export type { BoundaryExplanationCode, BoundaryExplanation } from "./boundary-explanation-types.js";
|
|
9
|
+
export { detectBoundaryExplanation, detectReminderBoundaryExplanation } from "./boundary-explanation-detector.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/present/boundary-explanation/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,YAAY,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACpG,OAAO,EAAE,yBAAyB,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/present/boundary-explanation/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,yBAAyB,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Control Visibility Assertions — Phase 5B.
|
|
3
|
+
*
|
|
4
|
+
* ── Purpose ───────────────────────────────────────────────────────────────────
|
|
5
|
+
*
|
|
6
|
+
* A HARD GUARD layer. Not optional. Not stylistic.
|
|
7
|
+
*
|
|
8
|
+
* Throws immediately on any ControlVisibilityResult that violates the
|
|
9
|
+
* authority invariants. Catches invalid states before they reach rendering.
|
|
10
|
+
*
|
|
11
|
+
* ── Locked rules (permanent — see docs/cvg-baseline.md) ─────────────────────
|
|
12
|
+
*
|
|
13
|
+
* C2 — CVG may assert, but never route.
|
|
14
|
+
* This function throws or returns void. It never changes the caller's output.
|
|
15
|
+
*
|
|
16
|
+
* C3 — CVG may detect violations, but never repair them silently.
|
|
17
|
+
* A bad result throws. It is never promoted, demoted, or patched here.
|
|
18
|
+
* Silent repair is worse than the violation it hides.
|
|
19
|
+
*
|
|
20
|
+
* ── What this guards ──────────────────────────────────────────────────────────
|
|
21
|
+
*
|
|
22
|
+
* 1. Blocking signal that does not disable confirm
|
|
23
|
+
* → system would allow execution on a blocked state
|
|
24
|
+
*
|
|
25
|
+
* 2. Blocking signal indistinguishable from normal
|
|
26
|
+
* → different authority levels collapse into same presentation
|
|
27
|
+
*
|
|
28
|
+
* 3. Ambiguous signal treated as confirmable
|
|
29
|
+
* → ambiguous state would allow execution without clarification
|
|
30
|
+
*
|
|
31
|
+
* 4. Refused signal missing surface requirement
|
|
32
|
+
* → a refused state could be silently hidden from H
|
|
33
|
+
*
|
|
34
|
+
* 5. ready_to_confirm treated as blocking
|
|
35
|
+
* → normal state incorrectly blocks execution
|
|
36
|
+
*
|
|
37
|
+
* ── What this does NOT do ─────────────────────────────────────────────────────
|
|
38
|
+
*
|
|
39
|
+
* Does NOT fix invalid states — it throws; the caller must not produce them
|
|
40
|
+
* Does NOT log or warn — it throws immediately
|
|
41
|
+
* Does NOT affect valid results — returns void when all invariants hold
|
|
42
|
+
*
|
|
43
|
+
* ── Usage ─────────────────────────────────────────────────────────────────────
|
|
44
|
+
*
|
|
45
|
+
* Call assertControlVisibilityConsistency(result) immediately after
|
|
46
|
+
* evaluateControlVisibility() in any presentation entry point.
|
|
47
|
+
* A throw here means the evaluator or upstream state produced an invalid result.
|
|
48
|
+
*/
|
|
49
|
+
import type { ControlVisibilityResult } from "./control-visibility-types.js";
|
|
50
|
+
/**
|
|
51
|
+
* Assert that a ControlVisibilityResult satisfies all authority invariants.
|
|
52
|
+
*
|
|
53
|
+
* Throws a ControlVisibilityViolationError if any invariant is broken.
|
|
54
|
+
* Returns void when all invariants hold.
|
|
55
|
+
*
|
|
56
|
+
* Call this immediately after evaluateControlVisibility() in every
|
|
57
|
+
* presentation entry point. This is the runtime enforcement of the CVG contract.
|
|
58
|
+
*/
|
|
59
|
+
export declare function assertControlVisibilityConsistency(result: ControlVisibilityResult): void;
|
|
60
|
+
/**
|
|
61
|
+
* ControlVisibilityViolationError — thrown when a CVG invariant is broken.
|
|
62
|
+
*
|
|
63
|
+
* Carries the violating result and the invariant code for traceability.
|
|
64
|
+
*/
|
|
65
|
+
export declare class ControlVisibilityViolationError extends Error {
|
|
66
|
+
readonly result: ControlVisibilityResult;
|
|
67
|
+
readonly invariant: string;
|
|
68
|
+
constructor(result: ControlVisibilityResult, invariant: string, message: string);
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=control-visibility-assertions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-visibility-assertions.d.ts","sourceRoot":"","sources":["../../../../src/present/control-visibility/control-visibility-assertions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAI7E;;;;;;;;GAQG;AACH,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,uBAAuB,GAC9B,IAAI,CAoHN;AAID;;;;GAIG;AACH,qBAAa,+BAAgC,SAAQ,KAAK;IACxD,SAAgB,MAAM,EAAK,uBAAuB,CAAC;IACnD,SAAgB,SAAS,EAAE,MAAM,CAAC;gBAEtB,MAAM,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAMhF"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Control Visibility Assertions — Phase 5B.
|
|
3
|
+
*
|
|
4
|
+
* ── Purpose ───────────────────────────────────────────────────────────────────
|
|
5
|
+
*
|
|
6
|
+
* A HARD GUARD layer. Not optional. Not stylistic.
|
|
7
|
+
*
|
|
8
|
+
* Throws immediately on any ControlVisibilityResult that violates the
|
|
9
|
+
* authority invariants. Catches invalid states before they reach rendering.
|
|
10
|
+
*
|
|
11
|
+
* ── Locked rules (permanent — see docs/cvg-baseline.md) ─────────────────────
|
|
12
|
+
*
|
|
13
|
+
* C2 — CVG may assert, but never route.
|
|
14
|
+
* This function throws or returns void. It never changes the caller's output.
|
|
15
|
+
*
|
|
16
|
+
* C3 — CVG may detect violations, but never repair them silently.
|
|
17
|
+
* A bad result throws. It is never promoted, demoted, or patched here.
|
|
18
|
+
* Silent repair is worse than the violation it hides.
|
|
19
|
+
*
|
|
20
|
+
* ── What this guards ──────────────────────────────────────────────────────────
|
|
21
|
+
*
|
|
22
|
+
* 1. Blocking signal that does not disable confirm
|
|
23
|
+
* → system would allow execution on a blocked state
|
|
24
|
+
*
|
|
25
|
+
* 2. Blocking signal indistinguishable from normal
|
|
26
|
+
* → different authority levels collapse into same presentation
|
|
27
|
+
*
|
|
28
|
+
* 3. Ambiguous signal treated as confirmable
|
|
29
|
+
* → ambiguous state would allow execution without clarification
|
|
30
|
+
*
|
|
31
|
+
* 4. Refused signal missing surface requirement
|
|
32
|
+
* → a refused state could be silently hidden from H
|
|
33
|
+
*
|
|
34
|
+
* 5. ready_to_confirm treated as blocking
|
|
35
|
+
* → normal state incorrectly blocks execution
|
|
36
|
+
*
|
|
37
|
+
* ── What this does NOT do ─────────────────────────────────────────────────────
|
|
38
|
+
*
|
|
39
|
+
* Does NOT fix invalid states — it throws; the caller must not produce them
|
|
40
|
+
* Does NOT log or warn — it throws immediately
|
|
41
|
+
* Does NOT affect valid results — returns void when all invariants hold
|
|
42
|
+
*
|
|
43
|
+
* ── Usage ─────────────────────────────────────────────────────────────────────
|
|
44
|
+
*
|
|
45
|
+
* Call assertControlVisibilityConsistency(result) immediately after
|
|
46
|
+
* evaluateControlVisibility() in any presentation entry point.
|
|
47
|
+
* A throw here means the evaluator or upstream state produced an invalid result.
|
|
48
|
+
*/
|
|
49
|
+
// ─── Public API ───────────────────────────────────────────────────────────────
|
|
50
|
+
/**
|
|
51
|
+
* Assert that a ControlVisibilityResult satisfies all authority invariants.
|
|
52
|
+
*
|
|
53
|
+
* Throws a ControlVisibilityViolationError if any invariant is broken.
|
|
54
|
+
* Returns void when all invariants hold.
|
|
55
|
+
*
|
|
56
|
+
* Call this immediately after evaluateControlVisibility() in every
|
|
57
|
+
* presentation entry point. This is the runtime enforcement of the CVG contract.
|
|
58
|
+
*/
|
|
59
|
+
export function assertControlVisibilityConsistency(result) {
|
|
60
|
+
// I1 — Blocking signal must disable confirm.
|
|
61
|
+
if (result.level === "blocking" && !result.must_block_confirm) {
|
|
62
|
+
throw new ControlVisibilityViolationError(result, "I1", `Blocking signal "${result.signal}" does not disable confirm. ` +
|
|
63
|
+
`must_block_confirm must be true for all blocking signals.`);
|
|
64
|
+
}
|
|
65
|
+
// I2 — Blocking signal must not be indistinguishable from normal.
|
|
66
|
+
// A blocking result with must_block_confirm=false and must_surface=false
|
|
67
|
+
// would be identical in flags to a normal result.
|
|
68
|
+
if (result.level === "blocking" &&
|
|
69
|
+
!result.must_surface &&
|
|
70
|
+
!result.must_block_confirm) {
|
|
71
|
+
throw new ControlVisibilityViolationError(result, "I2", `Blocking signal "${result.signal}" is indistinguishable from normal. ` +
|
|
72
|
+
`A blocking result must set must_block_confirm or must_surface (or both).`);
|
|
73
|
+
}
|
|
74
|
+
// I3 — Ambiguous must not be confirmable.
|
|
75
|
+
// must_block_confirm=false would allow confirm on an ambiguous state.
|
|
76
|
+
// must_surface must be true (H must see it).
|
|
77
|
+
if (result.signal === "ambiguous" && result.must_block_confirm) {
|
|
78
|
+
throw new ControlVisibilityViolationError(result, "I3a", `Ambiguous signal has must_block_confirm=true, which is reserved for blocking. ` +
|
|
79
|
+
`Ambiguous is "attention" level — it must surface but not hard-block.`);
|
|
80
|
+
}
|
|
81
|
+
if (result.signal === "ambiguous" && !result.must_surface) {
|
|
82
|
+
throw new ControlVisibilityViolationError(result, "I3b", `Ambiguous signal is not surfaced (must_surface=false). ` +
|
|
83
|
+
`Ambiguous state must always be visible to H.`);
|
|
84
|
+
}
|
|
85
|
+
// I4 — Refused states must have surface requirement.
|
|
86
|
+
if ((result.signal === "refused_scope" || result.signal === "refused_execution") &&
|
|
87
|
+
!result.must_surface) {
|
|
88
|
+
throw new ControlVisibilityViolationError(result, "I4", `Refused signal "${result.signal}" is missing surface requirement. ` +
|
|
89
|
+
`All refused states must be surfaced to H.`);
|
|
90
|
+
}
|
|
91
|
+
// I5 — ready_to_confirm must not be treated as blocking.
|
|
92
|
+
if (result.signal === "ready_to_confirm" && result.must_block_confirm) {
|
|
93
|
+
throw new ControlVisibilityViolationError(result, "I5", `"ready_to_confirm" signal has must_block_confirm=true. ` +
|
|
94
|
+
`A ready state must never block confirm.`);
|
|
95
|
+
}
|
|
96
|
+
// I6 — must_differentiate must always be true (no level may be invisible).
|
|
97
|
+
if (!result.must_differentiate) {
|
|
98
|
+
throw new ControlVisibilityViolationError(result, "I6", `Signal "${result.signal}" has must_differentiate=false. ` +
|
|
99
|
+
`All control visibility results must be structurally distinct.`);
|
|
100
|
+
}
|
|
101
|
+
// I7 — provisionally_executable must always surface (Phase 5D).
|
|
102
|
+
if (result.signal === "provisionally_executable" && !result.must_surface) {
|
|
103
|
+
throw new ControlVisibilityViolationError(result, "I7", `"provisionally_executable" signal has must_surface=false. ` +
|
|
104
|
+
`A provisional execution warning must always be visible to H.`);
|
|
105
|
+
}
|
|
106
|
+
// I8 — provisionally_executable must never be blocking (Phase 5D).
|
|
107
|
+
// It is attention-level: it informs, does not hard-block.
|
|
108
|
+
if (result.signal === "provisionally_executable" && result.must_block_confirm) {
|
|
109
|
+
throw new ControlVisibilityViolationError(result, "I8", `"provisionally_executable" signal has must_block_confirm=true. ` +
|
|
110
|
+
`A provisional warning is attention-level and must not hard-block confirm.`);
|
|
111
|
+
}
|
|
112
|
+
// I9 — provisionally_executable must be distinguishable from ready_to_confirm (Phase 5D).
|
|
113
|
+
// Both are non-blocking, but provisionally_executable must surface (attention)
|
|
114
|
+
// while ready_to_confirm does not need to (normal). The must_surface flag
|
|
115
|
+
// enforces the structural difference.
|
|
116
|
+
if (result.signal === "provisionally_executable" &&
|
|
117
|
+
result.level !== "attention") {
|
|
118
|
+
throw new ControlVisibilityViolationError(result, "I9", `"provisionally_executable" signal has level="${result.level}" but must be "attention". ` +
|
|
119
|
+
`It must remain structurally distinguishable from "ready_to_confirm" (normal).`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// ─── Error type ───────────────────────────────────────────────────────────────
|
|
123
|
+
/**
|
|
124
|
+
* ControlVisibilityViolationError — thrown when a CVG invariant is broken.
|
|
125
|
+
*
|
|
126
|
+
* Carries the violating result and the invariant code for traceability.
|
|
127
|
+
*/
|
|
128
|
+
export class ControlVisibilityViolationError extends Error {
|
|
129
|
+
result;
|
|
130
|
+
invariant;
|
|
131
|
+
constructor(result, invariant, message) {
|
|
132
|
+
super(`[CVG ${invariant}] ${message}`);
|
|
133
|
+
this.name = "ControlVisibilityViolationError";
|
|
134
|
+
this.result = result;
|
|
135
|
+
this.invariant = invariant;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=control-visibility-assertions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-visibility-assertions.js","sourceRoot":"","sources":["../../../../src/present/control-visibility/control-visibility-assertions.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Control Visibility Evaluator — Phase 5B.
|
|
3
|
+
*
|
|
4
|
+
* ── Responsibility ────────────────────────────────────────────────────────────
|
|
5
|
+
*
|
|
6
|
+
* Pure mapping from presentation state → ControlVisibilityResult.
|
|
7
|
+
*
|
|
8
|
+
* No inference. No guessing. No logic authority.
|
|
9
|
+
* Every mapping is an explicit, deterministic read of existing state.
|
|
10
|
+
*
|
|
11
|
+
* ── What this does NOT do ─────────────────────────────────────────────────────
|
|
12
|
+
*
|
|
13
|
+
* Does NOT call intake, execution, or UCP
|
|
14
|
+
* Does NOT derive new decisions from the presentation
|
|
15
|
+
* Does NOT change any output shape
|
|
16
|
+
* Does NOT produce side effects
|
|
17
|
+
*
|
|
18
|
+
* ── Locked rules (permanent — see docs/cvg-baseline.md) ─────────────────────
|
|
19
|
+
*
|
|
20
|
+
* C1 — CVG is derived only from existing presentation state.
|
|
21
|
+
* No re-evaluation. No classification. No inference. Pure mapping.
|
|
22
|
+
*
|
|
23
|
+
* C2 — CVG may assert, but never route.
|
|
24
|
+
* This function returns a result. It never changes what the caller returns.
|
|
25
|
+
*
|
|
26
|
+
* C4 — Any new presentation family must extend ControlVisibilityInput here,
|
|
27
|
+
* add a mapping case below, and pass all uniqueness/invariant tests.
|
|
28
|
+
* Exhaustive switch required — no default fallthrough.
|
|
29
|
+
*
|
|
30
|
+
* ── Signal mapping summary ────────────────────────────────────────────────────
|
|
31
|
+
*
|
|
32
|
+
* reminder_presentation:
|
|
33
|
+
* ready_to_confirm → signal: "ready_to_confirm", level: "normal"
|
|
34
|
+
* needs_time → signal: "not_ready", level: "blocking"
|
|
35
|
+
* needs_subject → signal: "not_ready", level: "blocking"
|
|
36
|
+
* ambiguous → signal: "ambiguous", level: "attention"
|
|
37
|
+
*
|
|
38
|
+
* intake_presentation (by mode):
|
|
39
|
+
* execute → signal: "ready_to_confirm", level: "normal"
|
|
40
|
+
* guide → signal: "not_ready", level: "blocking"
|
|
41
|
+
* clarify → signal: "ambiguous", level: "attention"
|
|
42
|
+
* refuse → signal: "refused_execution", level: "blocking"
|
|
43
|
+
* ignore → signal: "not_ready", level: "blocking"
|
|
44
|
+
*
|
|
45
|
+
* cursor_preparation:
|
|
46
|
+
* ready_for_confirmation → signal: "ready_to_confirm", level: "normal"
|
|
47
|
+
* conflict_detected → signal: "conflict_detected", level: "blocking"
|
|
48
|
+
* not_execute → signal: "not_ready", level: "blocking"
|
|
49
|
+
*
|
|
50
|
+
* cursor_execution:
|
|
51
|
+
* accepted → signal: "ready_to_confirm", level: "normal"
|
|
52
|
+
* refused_due_to_scope → signal: "refused_scope", level: "blocking"
|
|
53
|
+
* refused_due_to_execution_error → signal: "refused_execution", level: "blocking"
|
|
54
|
+
* blocked_ineligible → signal: "refused_execution", level: "blocking"
|
|
55
|
+
* blocked_persistence_failure → signal: "refused_execution", level: "blocking"
|
|
56
|
+
*/
|
|
57
|
+
import type { ControlVisibilityInput, ControlVisibilityResult } from "./control-visibility-types.js";
|
|
58
|
+
/**
|
|
59
|
+
* Evaluate the control visibility for a given presentation input.
|
|
60
|
+
*
|
|
61
|
+
* Pure function. No side effects. No inference. Deterministic.
|
|
62
|
+
*
|
|
63
|
+
* @param input A ControlVisibilityInput discriminated union arm.
|
|
64
|
+
* @returns A ControlVisibilityResult characterizing the authority level.
|
|
65
|
+
*/
|
|
66
|
+
export declare function evaluateControlVisibility(input: ControlVisibilityInput): ControlVisibilityResult;
|
|
67
|
+
//# sourceMappingURL=control-visibility-evaluator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-visibility-evaluator.d.ts","sourceRoot":"","sources":["../../../../src/present/control-visibility/control-visibility-evaluator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AAEH,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EAGxB,MAAM,+BAA+B,CAAC;AAIvC;;;;;;;GAOG;AAWH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,sBAAsB,GAC5B,uBAAuB,CAmBzB"}
|