@sun-asterisk/sungen 3.3.0-alpha.1 → 3.3.0-alpha.10
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/dist/capabilities/discover.d.ts +4 -0
- package/dist/capabilities/discover.d.ts.map +1 -1
- package/dist/capabilities/discover.js +16 -2
- package/dist/capabilities/discover.js.map +1 -1
- package/dist/cli/case-triage-hint.d.ts +14 -0
- package/dist/cli/case-triage-hint.d.ts.map +1 -0
- package/dist/cli/case-triage-hint.js +23 -0
- package/dist/cli/case-triage-hint.js.map +1 -0
- package/dist/cli/commands/audit.js +1 -1
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/contract-derive-command.d.ts +4 -2
- package/dist/cli/commands/contract-derive-command.d.ts.map +1 -1
- package/dist/cli/commands/contract-derive-command.js +19 -5
- package/dist/cli/commands/contract-derive-command.js.map +1 -1
- package/dist/cli/commands/contract.d.ts +3 -0
- package/dist/cli/commands/contract.d.ts.map +1 -1
- package/dist/cli/commands/contract.js +40 -7
- package/dist/cli/commands/contract.js.map +1 -1
- package/dist/cli/commands/delivery.d.ts.map +1 -1
- package/dist/cli/commands/delivery.js +59 -18
- package/dist/cli/commands/delivery.js.map +1 -1
- package/dist/cli/commands/gate.d.ts.map +1 -1
- package/dist/cli/commands/gate.js +2 -1
- package/dist/cli/commands/gate.js.map +1 -1
- package/dist/cli/commands/generate.d.ts.map +1 -1
- package/dist/cli/commands/generate.js +14 -2
- package/dist/cli/commands/generate.js.map +1 -1
- package/dist/cli/commands/journey.d.ts.map +1 -1
- package/dist/cli/commands/journey.js +6 -4
- package/dist/cli/commands/journey.js.map +1 -1
- package/dist/cli/commands/next.d.ts +7 -2
- package/dist/cli/commands/next.d.ts.map +1 -1
- package/dist/cli/commands/next.js +41 -10
- package/dist/cli/commands/next.js.map +1 -1
- package/dist/cli/commands/triage.d.ts +2 -1
- package/dist/cli/commands/triage.d.ts.map +1 -1
- package/dist/cli/commands/triage.js +45 -3
- package/dist/cli/commands/triage.js.map +1 -1
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +6 -2
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/index.js +5 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/json-error-on-exit.d.ts +34 -0
- package/dist/cli/json-error-on-exit.d.ts.map +1 -0
- package/dist/cli/json-error-on-exit.js +63 -0
- package/dist/cli/json-error-on-exit.js.map +1 -0
- package/dist/cli/project-sungen-invocation.d.ts +13 -0
- package/dist/cli/project-sungen-invocation.d.ts.map +1 -0
- package/dist/cli/project-sungen-invocation.js +95 -0
- package/dist/cli/project-sungen-invocation.js.map +1 -0
- package/dist/cli/run-command-hints.d.ts +9 -0
- package/dist/cli/run-command-hints.d.ts.map +1 -0
- package/dist/cli/run-command-hints.js +84 -0
- package/dist/cli/run-command-hints.js.map +1 -0
- package/dist/cli/waiting-for-you-block.d.ts +18 -0
- package/dist/cli/waiting-for-you-block.d.ts.map +1 -0
- package/dist/cli/waiting-for-you-block.js +22 -0
- package/dist/cli/waiting-for-you-block.js.map +1 -0
- package/dist/contract/accept-opaque-steps.d.ts +3 -0
- package/dist/contract/accept-opaque-steps.d.ts.map +1 -0
- package/dist/contract/accept-opaque-steps.js +114 -0
- package/dist/contract/accept-opaque-steps.js.map +1 -0
- package/dist/contract/approve-contract.d.ts +8 -1
- package/dist/contract/approve-contract.d.ts.map +1 -1
- package/dist/contract/approve-contract.js +6 -0
- package/dist/contract/approve-contract.js.map +1 -1
- package/dist/contract/build-contract-verdict.js +2 -2
- package/dist/contract/build-contract-verdict.js.map +1 -1
- package/dist/contract/build-trace-conformance.d.ts +5 -1
- package/dist/contract/build-trace-conformance.d.ts.map +1 -1
- package/dist/contract/build-trace-conformance.js +12 -14
- package/dist/contract/build-trace-conformance.js.map +1 -1
- package/dist/contract/classify-contract-change.d.ts +3 -2
- package/dist/contract/classify-contract-change.d.ts.map +1 -1
- package/dist/contract/classify-contract-change.js.map +1 -1
- package/dist/contract/classify-trace-conformance.d.ts +18 -3
- package/dist/contract/classify-trace-conformance.d.ts.map +1 -1
- package/dist/contract/classify-trace-conformance.js +64 -17
- package/dist/contract/classify-trace-conformance.js.map +1 -1
- package/dist/contract/contract-schema.d.ts +21 -0
- package/dist/contract/contract-schema.d.ts.map +1 -1
- package/dist/contract/contract-schema.js +25 -3
- package/dist/contract/contract-schema.js.map +1 -1
- package/dist/contract/contracts-lock-file.d.ts.map +1 -1
- package/dist/contract/contracts-lock-file.js +1 -0
- package/dist/contract/contracts-lock-file.js.map +1 -1
- package/dist/contract/derive-free-feature.d.ts +19 -0
- package/dist/contract/derive-free-feature.d.ts.map +1 -1
- package/dist/contract/derive-free-feature.js +40 -2
- package/dist/contract/derive-free-feature.js.map +1 -1
- package/dist/contract/project-contract-blockers.d.ts.map +1 -1
- package/dist/contract/project-contract-blockers.js +4 -2
- package/dist/contract/project-contract-blockers.js.map +1 -1
- package/dist/contract/record-contract-approval.d.ts +16 -1
- package/dist/contract/record-contract-approval.d.ts.map +1 -1
- package/dist/contract/record-contract-approval.js +29 -1
- package/dist/contract/record-contract-approval.js.map +1 -1
- package/dist/contract/render-free-gherkin.d.ts +2 -0
- package/dist/contract/render-free-gherkin.d.ts.map +1 -1
- package/dist/contract/render-free-gherkin.js +6 -0
- package/dist/contract/render-free-gherkin.js.map +1 -1
- package/dist/contract/resolve-unit-trace-identities.d.ts +12 -0
- package/dist/contract/resolve-unit-trace-identities.d.ts.map +1 -1
- package/dist/contract/resolve-unit-trace-identities.js +33 -49
- package/dist/contract/resolve-unit-trace-identities.js.map +1 -1
- package/dist/contract/trace/collect-trace-evidence.d.ts +16 -5
- package/dist/contract/trace/collect-trace-evidence.d.ts.map +1 -1
- package/dist/contract/trace/collect-trace-evidence.js +101 -43
- package/dist/contract/trace/collect-trace-evidence.js.map +1 -1
- package/dist/contract/trace/read-file-once.d.ts +20 -0
- package/dist/contract/trace/read-file-once.d.ts.map +1 -0
- package/dist/contract/trace/read-file-once.js +135 -0
- package/dist/contract/trace/read-file-once.js.map +1 -0
- package/dist/contract/trace/scenario-id-claims.d.ts +11 -0
- package/dist/contract/trace/scenario-id-claims.d.ts.map +1 -0
- package/dist/contract/trace/scenario-id-claims.js +89 -0
- package/dist/contract/trace/scenario-id-claims.js.map +1 -0
- package/dist/contract/trace/select-final-attempt.d.ts +4 -2
- package/dist/contract/trace/select-final-attempt.d.ts.map +1 -1
- package/dist/contract/trace/select-final-attempt.js +7 -4
- package/dist/contract/trace/select-final-attempt.js.map +1 -1
- package/dist/contract/trace/test-step-join.d.ts +3 -3
- package/dist/contract/trace/test-step-join.d.ts.map +1 -1
- package/dist/contract/trace/test-step-join.js +2 -2
- package/dist/contract/trace/test-step-join.js.map +1 -1
- package/dist/contract/trace/trace-binding.d.ts +3 -2
- package/dist/contract/trace/trace-binding.d.ts.map +1 -1
- package/dist/contract/trace/trace-binding.js +6 -3
- package/dist/contract/trace/trace-binding.js.map +1 -1
- package/dist/contract/trace/trace-file-reader.d.ts +14 -2
- package/dist/contract/trace/trace-file-reader.d.ts.map +1 -1
- package/dist/contract/trace/trace-file-reader.js +27 -45
- package/dist/contract/trace/trace-file-reader.js.map +1 -1
- package/dist/contract/trace/trace-freshness.d.ts +27 -0
- package/dist/contract/trace/trace-freshness.d.ts.map +1 -0
- package/dist/contract/trace/trace-freshness.js +146 -0
- package/dist/contract/trace/trace-freshness.js.map +1 -0
- package/dist/contract/trace/trace-identity-resolution.d.ts +2 -0
- package/dist/contract/trace/trace-identity-resolution.d.ts.map +1 -1
- package/dist/contract/trace/trace-identity-resolution.js +6 -3
- package/dist/contract/trace/trace-identity-resolution.js.map +1 -1
- package/dist/contract/trace/trace-run-record.d.ts +8 -3
- package/dist/contract/trace/trace-run-record.d.ts.map +1 -1
- package/dist/contract/trace/trace-run-record.js +42 -22
- package/dist/contract/trace/trace-run-record.js.map +1 -1
- package/dist/contract/trace/trace-steps.js +1 -1
- package/dist/contract/trace/trace-steps.js.map +1 -1
- package/dist/contract/trace/trace-zip-limits.d.ts +5 -1
- package/dist/contract/trace/trace-zip-limits.d.ts.map +1 -1
- package/dist/contract/trace/trace-zip-limits.js +6 -2
- package/dist/contract/trace/trace-zip-limits.js.map +1 -1
- package/dist/contract/verify-approval-decisions.d.ts.map +1 -1
- package/dist/contract/verify-approval-decisions.js +9 -4
- package/dist/contract/verify-approval-decisions.js.map +1 -1
- package/dist/decisions/confirmed-decision-commands.d.ts +11 -0
- package/dist/decisions/confirmed-decision-commands.d.ts.map +1 -1
- package/dist/decisions/confirmed-decision-commands.js +21 -3
- package/dist/decisions/confirmed-decision-commands.js.map +1 -1
- package/dist/decisions/decision-schema.d.ts +2 -1
- package/dist/decisions/decision-schema.d.ts.map +1 -1
- package/dist/decisions/decision-schema.js +2 -1
- package/dist/decisions/decision-schema.js.map +1 -1
- package/dist/decisions/git-head-trust.d.ts +12 -0
- package/dist/decisions/git-head-trust.d.ts.map +1 -1
- package/dist/decisions/git-head-trust.js +52 -0
- package/dist/decisions/git-head-trust.js.map +1 -1
- package/dist/decisions/human-confirmation.d.ts +2 -0
- package/dist/decisions/human-confirmation.d.ts.map +1 -1
- package/dist/decisions/human-confirmation.js +6 -0
- package/dist/decisions/human-confirmation.js.map +1 -1
- package/dist/decisions/legacy-waiver-migration.d.ts +8 -1
- package/dist/decisions/legacy-waiver-migration.d.ts.map +1 -1
- package/dist/decisions/legacy-waiver-migration.js +13 -4
- package/dist/decisions/legacy-waiver-migration.js.map +1 -1
- package/dist/exporters/csv-exporter.d.ts +11 -2
- package/dist/exporters/csv-exporter.d.ts.map +1 -1
- package/dist/exporters/csv-exporter.js +8 -4
- package/dist/exporters/csv-exporter.js.map +1 -1
- package/dist/exporters/matrix/export.d.ts +6 -1
- package/dist/exporters/matrix/export.d.ts.map +1 -1
- package/dist/exporters/matrix/export.js +11 -4
- package/dist/exporters/matrix/export.js.map +1 -1
- package/dist/exporters/matrix/xlsx-cells.js +1 -1
- package/dist/exporters/matrix/xlsx-cells.js.map +1 -1
- package/dist/exporters/xlsx-exporter.d.ts +3 -2
- package/dist/exporters/xlsx-exporter.d.ts.map +1 -1
- package/dist/exporters/xlsx-exporter.js +4 -4
- package/dist/exporters/xlsx-exporter.js.map +1 -1
- package/dist/graph/board-human-actions.d.ts +5 -0
- package/dist/graph/board-human-actions.d.ts.map +1 -0
- package/dist/graph/board-human-actions.js +83 -0
- package/dist/graph/board-human-actions.js.map +1 -0
- package/dist/graph/evaluate-graph.d.ts +21 -1
- package/dist/graph/evaluate-graph.d.ts.map +1 -1
- package/dist/graph/evaluate-graph.js +37 -9
- package/dist/graph/evaluate-graph.js.map +1 -1
- package/dist/graph/human-action.d.ts +21 -0
- package/dist/graph/human-action.d.ts.map +1 -0
- package/dist/graph/human-action.js +3 -0
- package/dist/graph/human-action.js.map +1 -0
- package/dist/graph/manual-triage-decisions.d.ts +19 -0
- package/dist/graph/manual-triage-decisions.d.ts.map +1 -0
- package/dist/graph/manual-triage-decisions.js +53 -0
- package/dist/graph/manual-triage-decisions.js.map +1 -0
- package/dist/graph/node-decl.d.ts +16 -0
- package/dist/graph/node-decl.d.ts.map +1 -1
- package/dist/graph/node-decl.js +4 -1
- package/dist/graph/node-decl.js.map +1 -1
- package/dist/graph/nodes/test-case-contract-nodes.d.ts +3 -1
- package/dist/graph/nodes/test-case-contract-nodes.d.ts.map +1 -1
- package/dist/graph/nodes/test-case-contract-nodes.js +22 -6
- package/dist/graph/nodes/test-case-contract-nodes.js.map +1 -1
- package/dist/graph/nodes/test-case-nodes.d.ts +3 -0
- package/dist/graph/nodes/test-case-nodes.d.ts.map +1 -1
- package/dist/graph/nodes/test-case-nodes.js +33 -4
- package/dist/graph/nodes/test-case-nodes.js.map +1 -1
- package/dist/graph/nodes/unit-audit-nodes.d.ts.map +1 -1
- package/dist/graph/nodes/unit-audit-nodes.js +1 -0
- package/dist/graph/nodes/unit-audit-nodes.js.map +1 -1
- package/dist/graph/nodes/unit-contract-node.d.ts +2 -1
- package/dist/graph/nodes/unit-contract-node.d.ts.map +1 -1
- package/dist/graph/nodes/unit-contract-node.js +16 -1
- package/dist/graph/nodes/unit-contract-node.js.map +1 -1
- package/dist/graph/nodes/unit-design-nodes.d.ts.map +1 -1
- package/dist/graph/nodes/unit-design-nodes.js +2 -1
- package/dist/graph/nodes/unit-design-nodes.js.map +1 -1
- package/dist/graph/test-case-results.d.ts +1 -0
- package/dist/graph/test-case-results.d.ts.map +1 -1
- package/dist/graph/test-case-results.js +27 -3
- package/dist/graph/test-case-results.js.map +1 -1
- package/dist/graph/test-case-satisfied.d.ts +5 -4
- package/dist/graph/test-case-satisfied.d.ts.map +1 -1
- package/dist/graph/test-case-satisfied.js +4 -0
- package/dist/graph/test-case-satisfied.js.map +1 -1
- package/dist/graph/test-case-state-shape.d.ts +7 -1
- package/dist/graph/test-case-state-shape.d.ts.map +1 -1
- package/dist/graph/unit-artifact-probes.d.ts.map +1 -1
- package/dist/graph/unit-artifact-probes.js +3 -1
- package/dist/graph/unit-artifact-probes.js.map +1 -1
- package/dist/graph/unit-results-freshness.d.ts +29 -0
- package/dist/graph/unit-results-freshness.d.ts.map +1 -0
- package/dist/graph/unit-results-freshness.js +213 -0
- package/dist/graph/unit-results-freshness.js.map +1 -0
- package/dist/harness/audit.d.ts +3 -2
- package/dist/harness/audit.d.ts.map +1 -1
- package/dist/harness/audit.js +4 -17
- package/dist/harness/audit.js.map +1 -1
- package/dist/harness/catalog/gate-rules.yaml +3 -3
- package/dist/harness/defect-draft.d.ts.map +1 -1
- package/dist/harness/defect-draft.js +12 -2
- package/dist/harness/defect-draft.js.map +1 -1
- package/dist/harness/defects.d.ts +14 -0
- package/dist/harness/defects.d.ts.map +1 -1
- package/dist/harness/defects.js +14 -10
- package/dist/harness/defects.js.map +1 -1
- package/dist/harness/flow-check.d.ts +9 -0
- package/dist/harness/flow-check.d.ts.map +1 -1
- package/dist/harness/flow-check.js +11 -0
- package/dist/harness/flow-check.js.map +1 -1
- package/dist/harness/gates/audit-gate-verdict.d.ts.map +1 -1
- package/dist/harness/gates/audit-gate-verdict.js +2 -1
- package/dist/harness/gates/audit-gate-verdict.js.map +1 -1
- package/dist/harness/gates/audit-input-hash.d.ts +2 -0
- package/dist/harness/gates/audit-input-hash.d.ts.map +1 -1
- package/dist/harness/gates/audit-input-hash.js +30 -2
- package/dist/harness/gates/audit-input-hash.js.map +1 -1
- package/dist/harness/gates/audit-report-verification.d.ts +17 -6
- package/dist/harness/gates/audit-report-verification.d.ts.map +1 -1
- package/dist/harness/gates/audit-report-verification.js +55 -21
- package/dist/harness/gates/audit-report-verification.js.map +1 -1
- package/dist/harness/gates/delivery-checklist.d.ts +3 -0
- package/dist/harness/gates/delivery-checklist.d.ts.map +1 -1
- package/dist/harness/gates/delivery-checklist.js +39 -6
- package/dist/harness/gates/delivery-checklist.js.map +1 -1
- package/dist/harness/gates/delivery-decision-gate.d.ts +4 -0
- package/dist/harness/gates/delivery-decision-gate.d.ts.map +1 -1
- package/dist/harness/gates/delivery-decision-gate.js +26 -1
- package/dist/harness/gates/delivery-decision-gate.js.map +1 -1
- package/dist/harness/gates/delivery-decision-step.d.ts +4 -1
- package/dist/harness/gates/delivery-decision-step.d.ts.map +1 -1
- package/dist/harness/gates/delivery-decision-step.js +17 -2
- package/dist/harness/gates/delivery-decision-step.js.map +1 -1
- package/dist/harness/gates/in-run-decision-check.d.ts.map +1 -1
- package/dist/harness/gates/in-run-decision-check.js +40 -12
- package/dist/harness/gates/in-run-decision-check.js.map +1 -1
- package/dist/harness/gates/migrated-waiver-import-bounds.d.ts +13 -0
- package/dist/harness/gates/migrated-waiver-import-bounds.d.ts.map +1 -0
- package/dist/harness/gates/migrated-waiver-import-bounds.js +141 -0
- package/dist/harness/gates/migrated-waiver-import-bounds.js.map +1 -0
- package/dist/harness/gates/migrated-waiver-review.d.ts +14 -4
- package/dist/harness/gates/migrated-waiver-review.d.ts.map +1 -1
- package/dist/harness/gates/migrated-waiver-review.js +78 -80
- package/dist/harness/gates/migrated-waiver-review.js.map +1 -1
- package/dist/harness/journey.d.ts +40 -0
- package/dist/harness/journey.d.ts.map +1 -1
- package/dist/harness/journey.js +155 -22
- package/dist/harness/journey.js.map +1 -1
- package/dist/harness/next-step.d.ts +19 -0
- package/dist/harness/next-step.d.ts.map +1 -1
- package/dist/harness/next-step.js +21 -0
- package/dist/harness/next-step.js.map +1 -1
- package/dist/harness/provenance.d.ts +29 -0
- package/dist/harness/provenance.d.ts.map +1 -1
- package/dist/harness/provenance.js +109 -9
- package/dist/harness/provenance.js.map +1 -1
- package/dist/harness/triage-manual-classification.d.ts +32 -0
- package/dist/harness/triage-manual-classification.d.ts.map +1 -0
- package/dist/harness/triage-manual-classification.js +56 -0
- package/dist/harness/triage-manual-classification.js.map +1 -0
- package/dist/harness/unit-paths.d.ts +8 -0
- package/dist/harness/unit-paths.d.ts.map +1 -1
- package/dist/harness/unit-paths.js +23 -1
- package/dist/harness/unit-paths.js.map +1 -1
- package/dist/hooks/bash-read-only-segment.d.ts +9 -0
- package/dist/hooks/bash-read-only-segment.d.ts.map +1 -0
- package/dist/hooks/bash-read-only-segment.js +168 -0
- package/dist/hooks/bash-read-only-segment.js.map +1 -0
- package/dist/hooks/bash-write-targets.d.ts +12 -2
- package/dist/hooks/bash-write-targets.d.ts.map +1 -1
- package/dist/hooks/bash-write-targets.js +122 -29
- package/dist/hooks/bash-write-targets.js.map +1 -1
- package/dist/hooks/guard-protected-paths.d.ts +4 -0
- package/dist/hooks/guard-protected-paths.d.ts.map +1 -1
- package/dist/hooks/guard-protected-paths.js +13 -3
- package/dist/hooks/guard-protected-paths.js.map +1 -1
- package/dist/hooks/guard-rules.d.ts +0 -17
- package/dist/hooks/guard-rules.d.ts.map +1 -1
- package/dist/hooks/guard-rules.js +79 -10
- package/dist/hooks/guard-rules.js.map +1 -1
- package/dist/hooks/guard-tty-spoof-rule.d.ts +3 -1
- package/dist/hooks/guard-tty-spoof-rule.d.ts.map +1 -1
- package/dist/hooks/guard-tty-spoof-rule.js +3 -2
- package/dist/hooks/guard-tty-spoof-rule.js.map +1 -1
- package/dist/hooks/hand-back-core.d.ts +9 -4
- package/dist/hooks/hand-back-core.d.ts.map +1 -1
- package/dist/hooks/hand-back-core.js +24 -11
- package/dist/hooks/hand-back-core.js.map +1 -1
- package/dist/hooks/session-start-unit-state-hook.d.ts +2 -1
- package/dist/hooks/session-start-unit-state-hook.d.ts.map +1 -1
- package/dist/hooks/session-start-unit-state-hook.js +9 -4
- package/dist/hooks/session-start-unit-state-hook.js.map +1 -1
- package/dist/hooks/stop-next-step-hook.d.ts.map +1 -1
- package/dist/hooks/stop-next-step-hook.js +1 -0
- package/dist/hooks/stop-next-step-hook.js.map +1 -1
- package/dist/orchestrator/assets-drift.d.ts +5 -0
- package/dist/orchestrator/assets-drift.d.ts.map +1 -1
- package/dist/orchestrator/assets-drift.js +12 -3
- package/dist/orchestrator/assets-drift.js.map +1 -1
- package/dist/orchestrator/project-initializer.d.ts.map +1 -1
- package/dist/orchestrator/project-initializer.js +1 -0
- package/dist/orchestrator/project-initializer.js.map +1 -1
- package/dist/orchestrator/templates/ai-src/commands/create-test.md +6 -3
- package/dist/orchestrator/templates/ai-src/commands/delivery.md +2 -0
- package/dist/orchestrator/templates/ai-src/commands/review.md +2 -0
- package/dist/orchestrator/templates/ai-src/commands/run-test.md +1 -1
- package/dist/orchestrator/templates/ai-src/partials/waiting-for-you.claude.md +11 -0
- package/dist/orchestrator/templates/ai-src/partials/waiting-for-you.codex.md +11 -0
- package/dist/orchestrator/templates/ai-src/partials/waiting-for-you.copilot.md +11 -0
- package/package.json +3 -3
- package/src/capabilities/discover.ts +15 -2
- package/src/cli/case-triage-hint.ts +31 -0
- package/src/cli/commands/audit.ts +1 -1
- package/src/cli/commands/contract-derive-command.ts +20 -8
- package/src/cli/commands/contract.ts +41 -7
- package/src/cli/commands/delivery.ts +56 -18
- package/src/cli/commands/gate.ts +2 -1
- package/src/cli/commands/generate.ts +13 -2
- package/src/cli/commands/journey.ts +8 -6
- package/src/cli/commands/next.ts +41 -12
- package/src/cli/commands/triage.ts +41 -3
- package/src/cli/commands/update.ts +6 -2
- package/src/cli/index.ts +5 -1
- package/src/cli/json-error-on-exit.ts +72 -0
- package/src/cli/project-sungen-invocation.ts +59 -0
- package/src/cli/run-command-hints.ts +47 -0
- package/src/cli/waiting-for-you-block.ts +27 -0
- package/src/contract/accept-opaque-steps.ts +114 -0
- package/src/contract/approve-contract.ts +10 -3
- package/src/contract/build-contract-verdict.ts +2 -2
- package/src/contract/build-trace-conformance.ts +11 -8
- package/src/contract/classify-contract-change.ts +3 -3
- package/src/contract/classify-trace-conformance.ts +76 -22
- package/src/contract/contract-schema.ts +31 -2
- package/src/contract/contracts-lock-file.ts +1 -0
- package/src/contract/derive-free-feature.ts +46 -3
- package/src/contract/project-contract-blockers.ts +4 -2
- package/src/contract/record-contract-approval.ts +41 -1
- package/src/contract/render-free-gherkin.ts +5 -0
- package/src/contract/resolve-unit-trace-identities.ts +35 -12
- package/src/contract/trace/collect-trace-evidence.ts +105 -36
- package/src/contract/trace/read-file-once.ts +95 -0
- package/src/contract/trace/scenario-id-claims.ts +60 -0
- package/src/contract/trace/select-final-attempt.ts +12 -5
- package/src/contract/trace/test-step-join.ts +6 -5
- package/src/contract/trace/trace-binding.ts +7 -4
- package/src/contract/trace/trace-file-reader.ts +34 -13
- package/src/contract/trace/trace-freshness.ts +110 -0
- package/src/contract/trace/trace-identity-resolution.ts +7 -4
- package/src/contract/trace/trace-run-record.ts +37 -15
- package/src/contract/trace/trace-steps.ts +1 -1
- package/src/contract/trace/trace-zip-limits.ts +6 -2
- package/src/contract/verify-approval-decisions.ts +9 -5
- package/src/decisions/confirmed-decision-commands.ts +25 -4
- package/src/decisions/decision-schema.ts +2 -1
- package/src/decisions/git-head-trust.ts +44 -0
- package/src/decisions/human-confirmation.ts +5 -0
- package/src/decisions/legacy-waiver-migration.ts +14 -3
- package/src/exporters/csv-exporter.ts +12 -4
- package/src/exporters/matrix/export.ts +11 -4
- package/src/exporters/matrix/xlsx-cells.ts +1 -1
- package/src/exporters/xlsx-exporter.ts +5 -4
- package/src/graph/board-human-actions.ts +80 -0
- package/src/graph/evaluate-graph.ts +45 -10
- package/src/graph/human-action.ts +33 -0
- package/src/graph/manual-triage-decisions.ts +55 -0
- package/src/graph/node-decl.ts +18 -0
- package/src/graph/nodes/test-case-contract-nodes.ts +28 -7
- package/src/graph/nodes/test-case-nodes.ts +37 -5
- package/src/graph/nodes/unit-audit-nodes.ts +2 -1
- package/src/graph/nodes/unit-contract-node.ts +20 -2
- package/src/graph/nodes/unit-design-nodes.ts +2 -1
- package/src/graph/test-case-results.ts +25 -4
- package/src/graph/test-case-satisfied.ts +7 -4
- package/src/graph/test-case-state-shape.ts +7 -2
- package/src/graph/unit-artifact-probes.ts +3 -1
- package/src/graph/unit-results-freshness.ts +165 -0
- package/src/harness/audit.ts +4 -13
- package/src/harness/catalog/gate-rules.yaml +3 -3
- package/src/harness/defect-draft.ts +13 -2
- package/src/harness/defects.ts +22 -9
- package/src/harness/flow-check.ts +11 -0
- package/src/harness/gates/audit-gate-verdict.ts +2 -1
- package/src/harness/gates/audit-input-hash.ts +27 -3
- package/src/harness/gates/audit-report-verification.ts +57 -24
- package/src/harness/gates/delivery-checklist.ts +39 -7
- package/src/harness/gates/delivery-decision-gate.ts +29 -1
- package/src/harness/gates/delivery-decision-step.ts +19 -3
- package/src/harness/gates/in-run-decision-check.ts +38 -13
- package/src/harness/gates/migrated-waiver-import-bounds.ts +103 -0
- package/src/harness/gates/migrated-waiver-review.ts +90 -37
- package/src/harness/journey.ts +174 -21
- package/src/harness/next-step.ts +34 -1
- package/src/harness/provenance.ts +99 -11
- package/src/harness/triage-manual-classification.ts +76 -0
- package/src/harness/unit-paths.ts +19 -0
- package/src/hooks/bash-read-only-segment.ts +130 -0
- package/src/hooks/bash-write-targets.ts +109 -23
- package/src/hooks/guard-protected-paths.ts +13 -3
- package/src/hooks/guard-rules.ts +37 -18
- package/src/hooks/guard-tty-spoof-rule.ts +6 -3
- package/src/hooks/hand-back-core.ts +24 -12
- package/src/hooks/session-start-unit-state-hook.ts +9 -4
- package/src/hooks/stop-next-step-hook.ts +1 -0
- package/src/orchestrator/assets-drift.ts +12 -5
- package/src/orchestrator/project-initializer.ts +1 -0
- package/src/orchestrator/templates/ai-src/commands/create-test.md +6 -3
- package/src/orchestrator/templates/ai-src/commands/delivery.md +2 -0
- package/src/orchestrator/templates/ai-src/commands/review.md +2 -0
- package/src/orchestrator/templates/ai-src/commands/run-test.md +1 -1
- package/src/orchestrator/templates/ai-src/partials/waiting-for-you.claude.md +11 -0
- package/src/orchestrator/templates/ai-src/partials/waiting-for-you.codex.md +11 -0
- package/src/orchestrator/templates/ai-src/partials/waiting-for-you.copilot.md +11 -0
|
@@ -33,20 +33,115 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.AUDIT_RULES_VERSION = void 0;
|
|
37
|
+
exports.bundledDriverRulesInputs = bundledDriverRulesInputs;
|
|
38
|
+
exports.rulesHashOf = rulesHashOf;
|
|
36
39
|
exports.getProvenance = getProvenance;
|
|
37
40
|
/**
|
|
38
|
-
* Provenance stamp for deterministic reports (score-determinism D1)
|
|
41
|
+
* Provenance stamp for deterministic reports (score-determinism D1), and the RULES the audit's
|
|
42
|
+
* verdict was judged by (#933, owner decision W4).
|
|
39
43
|
*
|
|
40
|
-
* The audit score is a pure function of the project files + the bundled
|
|
41
|
-
* Stamping
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
44
|
+
* The audit score is a pure function of the project files + the bundled catalogs + the scoring
|
|
45
|
+
* code. Stamping them into the report lets two users who get different scores see IMMEDIATELY
|
|
46
|
+
* whether the cause is a rules mismatch rather than a real difference in their test design — and
|
|
47
|
+
* lets `verifyAuditReport` tell a report judged by today's rules from one judged by other rules:
|
|
48
|
+
*
|
|
49
|
+
* sungenVersion which package wrote it — informational: a newer sungen with the same rules
|
|
50
|
+
* gives the same verdict, so the version alone never makes a report stale
|
|
51
|
+
* catalogHash sha256(universal-viewpoints.yaml), first 12 hex — the viewpoint catalog
|
|
52
|
+
* rulesHash sha256(AUDIT_RULES_VERSION + every catalog file under harness/catalog/ + each
|
|
53
|
+
* bundled driver's sources/catalogs), first 12 hex — everything the verdict
|
|
54
|
+
* depends on that is not the project's own files. No package VERSION is hashed:
|
|
55
|
+
* packages are lockstep-versioned, so a release would stale every report
|
|
45
56
|
*/
|
|
46
57
|
const fs = __importStar(require("fs"));
|
|
47
58
|
const path = __importStar(require("path"));
|
|
48
59
|
const crypto = __importStar(require("crypto"));
|
|
60
|
+
/**
|
|
61
|
+
* The version of the audit's SCORING CODE. Bump it (by one) in the same change whenever what
|
|
62
|
+
* `runAudit` computes for the same project can change: a sensor, a threshold, a gate term
|
|
63
|
+
* (audit-gate-terms.ts), the score model or weights, a finding that feeds the verdict, or the
|
|
64
|
+
* audit sensor of a bundled driver. Every report scored before the bump then reads stale and asks
|
|
65
|
+
* for one `sungen audit`. Catalog edits (harness/catalog/*.yaml) and bundled-driver changes (their
|
|
66
|
+
* sources and catalogs are hashed) need no bump.
|
|
67
|
+
* A release that changes none of these keeps every report trusted across the upgrade.
|
|
68
|
+
* Enforced by tests/audit/run.ts: its rules lock (tests/audit/audit-rules.lock.json) fails when the
|
|
69
|
+
* fixtures' audit output changes under an unchanged rules hash. After the bump, re-record it:
|
|
70
|
+
* npx tsx tests/audit/run.ts --record-rules-lock
|
|
71
|
+
*/
|
|
72
|
+
exports.AUDIT_RULES_VERSION = 1;
|
|
73
|
+
/** What is not a driver's rule: dependencies, build output, tests, docs, editor and lock files. */
|
|
74
|
+
const SKIP_DIR = new Set(['node_modules', 'dist', 'tests', 'test', 'coverage']);
|
|
75
|
+
const SKIP_FILE = /^(?:\.|package(?:-lock)?\.json$|tsconfig.*\.json$|.*\.(?:md|tsbuildinfo)$)/;
|
|
76
|
+
function driverFiles(root, rel = '') {
|
|
77
|
+
const out = [];
|
|
78
|
+
for (const e of fs.readdirSync(path.join(root, rel), { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name, 'en'))) {
|
|
79
|
+
if (e.name.startsWith('.'))
|
|
80
|
+
continue;
|
|
81
|
+
const r = rel ? `${rel}/${e.name}` : e.name;
|
|
82
|
+
if (e.isDirectory()) {
|
|
83
|
+
if (!SKIP_DIR.has(e.name))
|
|
84
|
+
out.push(...driverFiles(root, r));
|
|
85
|
+
}
|
|
86
|
+
else if (e.isFile() && !SKIP_FILE.test(e.name))
|
|
87
|
+
out.push(r);
|
|
88
|
+
}
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
91
|
+
/** The package root above a driver's resolved entry file (the dir whose package.json names it). */
|
|
92
|
+
function packageRootOf(entry, name) {
|
|
93
|
+
let dir = path.dirname(entry);
|
|
94
|
+
for (let i = 0; i < 8; i++) {
|
|
95
|
+
try {
|
|
96
|
+
if (JSON.parse(fs.readFileSync(path.join(dir, 'package.json'), 'utf8'))?.name === name)
|
|
97
|
+
return dir;
|
|
98
|
+
}
|
|
99
|
+
catch { /* keep walking */ }
|
|
100
|
+
const parent = path.dirname(dir);
|
|
101
|
+
if (parent === dir)
|
|
102
|
+
break;
|
|
103
|
+
dir = parent;
|
|
104
|
+
}
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
/** Each bundled driver as discovery would load it (project anchor, then core's), or `absent`. */
|
|
108
|
+
function bundledDriverRulesInputs() {
|
|
109
|
+
// Lazy: discovery pulls the capability registry, which nothing else here needs.
|
|
110
|
+
const { bundledDriverNames, resolveDriverCopy } = require('../capabilities/discover');
|
|
111
|
+
return bundledDriverNames().map((name) => {
|
|
112
|
+
const copy = resolveDriverCopy(name);
|
|
113
|
+
const dir = copy ? packageRootOf(copy.resolved, name) : null;
|
|
114
|
+
return { name, version: copy?.version, dir };
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
const CATALOG_DIR = path.join(__dirname, 'catalog');
|
|
118
|
+
const sha12 = (s) => crypto.createHash('sha256').update(s).digest('hex').slice(0, 12);
|
|
119
|
+
/**
|
|
120
|
+
* The rules hash: the scoring version, every *.yaml of the catalog dir (by name), and each bundled
|
|
121
|
+
* driver — every source / catalog file of its package (by relative path; build output, tests and
|
|
122
|
+
* dependencies excluded), or a stable `absent` marker when it is not installed. A driver's version is
|
|
123
|
+
* deliberately left out: releases bump every package in lockstep, and only content changes the rules.
|
|
124
|
+
*/
|
|
125
|
+
function rulesHashOf(rulesVersion, catalogDir = CATALOG_DIR, drivers = bundledDriverRulesInputs()) {
|
|
126
|
+
const files = fs.readdirSync(catalogDir).filter((f) => f.endsWith('.yaml')).sort();
|
|
127
|
+
const h = crypto.createHash('sha256').update(`audit-rules:${rulesVersion}\n`);
|
|
128
|
+
for (const f of files)
|
|
129
|
+
h.update(`${f}\n`).update(fs.readFileSync(path.join(catalogDir, f))).update('\n');
|
|
130
|
+
for (const d of [...drivers].sort((a, b) => a.name.localeCompare(b.name, 'en'))) {
|
|
131
|
+
h.update(`driver:${d.name}\n`);
|
|
132
|
+
if (!d.dir) {
|
|
133
|
+
h.update('absent\n');
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
for (const f of driverFiles(d.dir))
|
|
137
|
+
h.update(`${f}\n`).update(fs.readFileSync(path.join(d.dir, f))).update('\n');
|
|
138
|
+
}
|
|
139
|
+
return h.digest('hex').slice(0, 12);
|
|
140
|
+
}
|
|
141
|
+
let cached = null;
|
|
49
142
|
function getProvenance() {
|
|
143
|
+
if (cached)
|
|
144
|
+
return cached;
|
|
50
145
|
let sungenVersion = 'unknown';
|
|
51
146
|
try {
|
|
52
147
|
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'package.json'), 'utf-8'));
|
|
@@ -56,10 +151,15 @@ function getProvenance() {
|
|
|
56
151
|
catch { /* version stays 'unknown' */ }
|
|
57
152
|
let catalogHash = 'unknown';
|
|
58
153
|
try {
|
|
59
|
-
|
|
60
|
-
|
|
154
|
+
catalogHash = sha12(fs.readFileSync(path.join(CATALOG_DIR, 'universal-viewpoints.yaml'), 'utf-8'));
|
|
155
|
+
}
|
|
156
|
+
catch { /* hash stays 'unknown' */ }
|
|
157
|
+
let rulesHash = 'unknown';
|
|
158
|
+
try {
|
|
159
|
+
rulesHash = rulesHashOf(exports.AUDIT_RULES_VERSION);
|
|
61
160
|
}
|
|
62
161
|
catch { /* hash stays 'unknown' */ }
|
|
63
|
-
|
|
162
|
+
cached = { sungenVersion, catalogHash, rulesHash };
|
|
163
|
+
return cached;
|
|
64
164
|
}
|
|
65
165
|
//# sourceMappingURL=provenance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provenance.js","sourceRoot":"","sources":["../../src/harness/provenance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provenance.js","sourceRoot":"","sources":["../../src/harness/provenance.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEA,4DAQC;AAWD,kCAUC;AAID,sCAeC;AAxHD;;;;;;;;;;;;;;;;GAgBG;AACH,uCAAyB;AACzB,2CAA6B;AAC7B,+CAAiC;AAEjC;;;;;;;;;;;GAWG;AACU,QAAA,mBAAmB,GAAG,CAAC,CAAC;AAWrC,mGAAmG;AACnG,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;AAChF,MAAM,SAAS,GAAG,4EAA4E,CAAC;AAE/F,SAAS,WAAW,CAAC,IAAY,EAAE,GAAG,GAAG,EAAE;IACzC,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,aAAa,EAAE,IAAI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E,OAAO,MAAM,CAAC;IAC1B,IAAI,aAAa,GAAG,SAAS,CAAC;IAC9B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;QACnG,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ;YAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAAC;IAC1E,CAAC;IAAC,MAAM,CAAC,CAAC,6BAA6B,CAAC,CAAC;IAEzC,IAAI,WAAW,GAAG,SAAS,CAAC;IAC5B,IAAI,CAAC;QAAC,WAAW,GAAG,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,2BAA2B,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC,CAAC,0BAA0B,CAAC,CAAC;IAChJ,IAAI,SAAS,GAAG,SAAS,CAAC;IAC1B,IAAI,CAAC;QAAC,SAAS,GAAG,WAAW,CAAC,2BAAmB,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC,CAAC,0BAA0B,CAAC,CAAC;IAE1F,MAAM,GAAG,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;IACnD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `sungen triage --screen <u> --case <id> --as product|test-defect|environment --reason "…"` (#928):
|
|
3
|
+
* classify one red by hand — the one `sungen triage` left unclassified, or one it got wrong — as a
|
|
4
|
+
* `triage-classification` decision in the unit's `decisions/` (read back by graph/manual-triage-decisions.ts).
|
|
5
|
+
*
|
|
6
|
+
* validated first the class, a reason, a case that exists, is red and is not exempt — before any
|
|
7
|
+
* prompt, so a human never confirms something that is then rejected
|
|
8
|
+
* product stricter than any automatic class (it leads to a QA decision): anyone may record it
|
|
9
|
+
* test-defect, can hide a product defect behind "fix the test" / "re-run": a human types a
|
|
10
|
+
* environment confirmation on a terminal (DOS-13.4); without one it is refused, nothing is
|
|
11
|
+
* written and the exact command is printed. Only after the typed phrase does the
|
|
12
|
+
* entry carry `humanConfirmed: true`, and a reader ignores one without it
|
|
13
|
+
* bound evidence_hash = the case's red as it reads now; a re-run voids the classification
|
|
14
|
+
*/
|
|
15
|
+
import type { AppendResult } from '../decisions/append-decision';
|
|
16
|
+
import { ConfirmationIO } from '../decisions/human-confirmation';
|
|
17
|
+
import { ManualTriageClass } from '../graph/manual-triage-decisions';
|
|
18
|
+
export interface ClassifyRedCaseInput {
|
|
19
|
+
projectRoot: string;
|
|
20
|
+
unit: string;
|
|
21
|
+
caseId: string;
|
|
22
|
+
/** product | test-defect | environment */
|
|
23
|
+
as: string;
|
|
24
|
+
reason?: string;
|
|
25
|
+
io: ConfirmationIO;
|
|
26
|
+
}
|
|
27
|
+
export interface ClassifyRedCaseResult extends AppendResult {
|
|
28
|
+
caseId: string;
|
|
29
|
+
class: ManualTriageClass;
|
|
30
|
+
}
|
|
31
|
+
export declare function classifyRedCase(i: ClassifyRedCaseInput): Promise<ClassifyRedCaseResult>;
|
|
32
|
+
//# sourceMappingURL=triage-manual-classification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triage-manual-classification.d.ts","sourceRoot":"","sources":["../../src/harness/triage-manual-classification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAIjE,OAAO,EAAE,cAAc,EAA2C,MAAM,iCAAiC,CAAC;AAE1G,OAAO,EAAuC,iBAAiB,EAAwB,MAAM,kCAAkC,CAAC;AAKhI,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,cAAc,CAAC;CACpB;AAED,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IAAG,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,iBAAiB,CAAA;CAAE;AAExG,wBAAsB,eAAe,CAAC,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAsC7F"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.classifyRedCase = classifyRedCase;
|
|
4
|
+
const append_decision_1 = require("../decisions/append-decision");
|
|
5
|
+
const decision_source_1 = require("../decisions/decision-source");
|
|
6
|
+
const human_confirmation_1 = require("../decisions/human-confirmation");
|
|
7
|
+
const resolve_unit_1 = require("../cli/resolve-unit");
|
|
8
|
+
const manual_triage_decisions_1 = require("../graph/manual-triage-decisions");
|
|
9
|
+
const test_case_satisfied_1 = require("../graph/test-case-satisfied");
|
|
10
|
+
const test_case_states_1 = require("../graph/test-case-states");
|
|
11
|
+
const unit_gate_overrides_1 = require("./gates/unit-gate-overrides");
|
|
12
|
+
async function classifyRedCase(i) {
|
|
13
|
+
const cls = Object.prototype.hasOwnProperty.call(manual_triage_decisions_1.MANUAL_TRIAGE_AS, i.as) ? manual_triage_decisions_1.MANUAL_TRIAGE_AS[i.as] : undefined;
|
|
14
|
+
if (!cls)
|
|
15
|
+
throw new Error(`--as must be one of ${Object.keys(manual_triage_decisions_1.MANUAL_TRIAGE_AS).join(', ')} (got "${i.as}")`);
|
|
16
|
+
const reason = (i.reason ?? '').trim();
|
|
17
|
+
if (!reason)
|
|
18
|
+
throw new Error('--reason is required: a classification records WHY this red is what you say it is');
|
|
19
|
+
const found = (0, resolve_unit_1.resolveUnitCandidates)(i.unit, i.projectRoot);
|
|
20
|
+
if (found.length !== 1)
|
|
21
|
+
throw new Error(`"${i.unit}" does not name exactly one unit under qa/screens, qa/flows or qa/api`);
|
|
22
|
+
const unitDir = found[0].dir;
|
|
23
|
+
const scope = (0, unit_gate_overrides_1.unitScopeOfDir)(i.projectRoot, unitDir);
|
|
24
|
+
if (!scope)
|
|
25
|
+
throw new Error(`"${i.unit}" has no decisions scope`);
|
|
26
|
+
const cases = (0, test_case_states_1.testCaseStates)(i.projectRoot, i.unit, { unitDir, auditFindings: [] });
|
|
27
|
+
const tc = cases.find((c) => c.id === i.caseId);
|
|
28
|
+
if (!tc) {
|
|
29
|
+
const known = cases.slice(0, 8).map((c) => c.id).join(', ');
|
|
30
|
+
throw new Error(`no test case "${i.caseId}" in ${i.unit}${known ? ` — known: ${known}${cases.length > 8 ? ', …' : ''}` : ''}`);
|
|
31
|
+
}
|
|
32
|
+
if (tc.result !== 'failed' || !tc.evidence)
|
|
33
|
+
throw new Error(`${tc.id} has no red result to classify (result: ${tc.result})`);
|
|
34
|
+
const exempt = (0, test_case_satisfied_1.exemptionOf)(tc);
|
|
35
|
+
if (exempt)
|
|
36
|
+
throw new Error(`${tc.id} is exempt (${exempt}) — it needs no classification`);
|
|
37
|
+
const human = manual_triage_decisions_1.HUMAN_ONLY_TRIAGE.has(cls);
|
|
38
|
+
if (human) {
|
|
39
|
+
await (0, human_confirmation_1.requireTypedConfirmation)({
|
|
40
|
+
what: `classify the red ${tc.id} of ${i.unit} as ${cls}`,
|
|
41
|
+
phrase: tc.id,
|
|
42
|
+
command: (0, human_confirmation_1.formatCommand)(['sungen', 'triage', found[0].kind === 'api' ? '--api' : '--screen', i.unit, '--case', tc.id, '--as', i.as, '--reason', reason]),
|
|
43
|
+
summary: [`case: ${tc.title}`, `automatic triage: ${tc.triage ? `${tc.triage.class} (${tc.triage.ruleId})` : 'none current'}`, `reason: ${reason}`,
|
|
44
|
+
`recorded by: ${(0, decision_source_1.gitUserName)(i.projectRoot)}`, `as ${cls} it leaves the product-defect path — confirm only after reading its evidence (trace, error)`,
|
|
45
|
+
'it stops counting as soon as the case runs again'],
|
|
46
|
+
io: i.io,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
const draft = {
|
|
50
|
+
kind: manual_triage_decisions_1.TRIAGE_DECISION_KIND, anchors: [], text: `${tc.id} is ${cls}: ${tc.title}`, reason,
|
|
51
|
+
payload: { case: tc.id, class: cls, ...(human ? { humanConfirmed: true } : {}) },
|
|
52
|
+
source: { by: (0, decision_source_1.gitUserName)(i.projectRoot), where: 'cli' }, valid_from: new Date().toISOString(), visibility: 'internal', evidence_hash: tc.evidence,
|
|
53
|
+
};
|
|
54
|
+
return { ...(0, append_decision_1.appendDecision)(i.projectRoot, scope, draft), caseId: tc.id, class: cls };
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=triage-manual-classification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triage-manual-classification.js","sourceRoot":"","sources":["../../src/harness/triage-manual-classification.ts"],"names":[],"mappings":";;AAqCA,0CAsCC;AA5DD,kEAA8D;AAE9D,kEAA2D;AAC3D,wEAA0G;AAC1G,sDAA4D;AAC5D,8EAAgI;AAChI,sEAA2D;AAC3D,gEAA2D;AAC3D,qEAA6D;AActD,KAAK,UAAU,eAAe,CAAC,CAAuB;IAC3D,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,0CAAgB,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,0CAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9G,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,MAAM,CAAC,IAAI,CAAC,0CAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;I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AAM,GAAG,CAAC,CAAC,CAAC,cAAc,EAAE,EAAE,WAAW,MAAM,EAAE;gBAChJ,gBAAgB,IAAA,6BAAW,EAAC,CAAC,CAAC,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,6FAA6F;gBACpJ,kDAAkD,CAAC;YACrD,EAAE,EAAE,CAAC,CAAC,EAAE;SACT,CAAC,CAAC;IACL,CAAC;IACD,MAAM,KAAK,GAAkB;QAC3B,IAAI,EAAE,8CAAoB,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,OAAO,GAAG,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,MAAM;QACxF,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;QAChF,MAAM,EAAE,EAAE,EAAE,EAAE,IAAA,6BAAW,EAAC,CAAC,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,CAAC,QAAQ;KACnJ,CAAC;IACF,OAAO,EAAE,GAAG,IAAA,gCAAc,EAAC,CAAC,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;AACvF,CAAC"}
|
|
@@ -16,4 +16,12 @@ export declare const reportSlug: (unit: string) => string;
|
|
|
16
16
|
* behaviour (and error text) they already have.
|
|
17
17
|
*/
|
|
18
18
|
export declare function featureFilesFor(unitDir: string, unit: string): string[];
|
|
19
|
+
/**
|
|
20
|
+
* The catalog-resolution id for a unit dir (relative to qa/): screen · flows/<flow> · api/<area> ·
|
|
21
|
+
* api/flows/<flow>; a bare screen is its basename. Shared by the audit, which scores and links the
|
|
22
|
+
* unit under this id, and its inputsHash, which reads what the audit reads under the same id.
|
|
23
|
+
*/
|
|
24
|
+
export declare function catalogIdFromScreenDir(screenDir: string): string;
|
|
25
|
+
/** A screen unit — the only kind a sibling flow credits (TQ-4); flows and api units are not. */
|
|
26
|
+
export declare const isScreenUnitId: (catalogId: string) => boolean;
|
|
19
27
|
//# sourceMappingURL=unit-paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-paths.d.ts","sourceRoot":"","sources":["../../src/harness/unit-paths.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,KAAG,MAA6B,CAAC;AAC7E,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,KAAG,MAAsC,CAAC;AAEjF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAkBvE"}
|
|
1
|
+
{"version":3,"file":"unit-paths.d.ts","sourceRoot":"","sources":["../../src/harness/unit-paths.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,KAAG,MAA6B,CAAC;AAC7E,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,KAAG,MAAsC,CAAC;AAEjF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAkBvE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAShE;AAED,gGAAgG;AAChG,eAAO,MAAM,cAAc,GAAI,WAAW,MAAM,KAAG,OAA4C,CAAC"}
|
|
@@ -33,8 +33,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.reportSlug = exports.featureBasename = void 0;
|
|
36
|
+
exports.isScreenUnitId = exports.reportSlug = exports.featureBasename = void 0;
|
|
37
37
|
exports.featureFilesFor = featureFilesFor;
|
|
38
|
+
exports.catalogIdFromScreenDir = catalogIdFromScreenDir;
|
|
38
39
|
/**
|
|
39
40
|
* Unit-path helpers (api-flow fix). A unit id may be a bare name (`orders`, `login`) or a nested
|
|
40
41
|
* api-flow id (`flows/<flow>`). Three derivations the harness/CLI need:
|
|
@@ -86,4 +87,25 @@ function featureFilesFor(unitDir, unit) {
|
|
|
86
87
|
...names.filter((n) => n !== canonicalName),
|
|
87
88
|
].map((n) => path.join(dir, n));
|
|
88
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* The catalog-resolution id for a unit dir (relative to qa/): screen · flows/<flow> · api/<area> ·
|
|
92
|
+
* api/flows/<flow>; a bare screen is its basename. Shared by the audit, which scores and links the
|
|
93
|
+
* unit under this id, and its inputsHash, which reads what the audit reads under the same id.
|
|
94
|
+
*/
|
|
95
|
+
function catalogIdFromScreenDir(screenDir) {
|
|
96
|
+
const parts = screenDir.split(path.sep);
|
|
97
|
+
const qa = parts.lastIndexOf('qa');
|
|
98
|
+
if (qa >= 0) {
|
|
99
|
+
if (parts[qa + 1] === 'api' && parts[qa + 2] === 'flows' && parts[qa + 3])
|
|
100
|
+
return `api/flows/${parts[qa + 3]}`;
|
|
101
|
+
if (parts[qa + 1] === 'api' && parts[qa + 2])
|
|
102
|
+
return `api/${parts[qa + 2]}`;
|
|
103
|
+
if (parts[qa + 1] === 'flows' && parts[qa + 2])
|
|
104
|
+
return `flows/${parts[qa + 2]}`;
|
|
105
|
+
}
|
|
106
|
+
return path.basename(screenDir);
|
|
107
|
+
}
|
|
108
|
+
/** A screen unit — the only kind a sibling flow credits (TQ-4); flows and api units are not. */
|
|
109
|
+
const isScreenUnitId = (catalogId) => !/^(flows|api)\//.test(catalogId);
|
|
110
|
+
exports.isScreenUnitId = isScreenUnitId;
|
|
89
111
|
//# sourceMappingURL=unit-paths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-paths.js","sourceRoot":"","sources":["../../src/harness/unit-paths.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,0CAkBC;
|
|
1
|
+
{"version":3,"file":"unit-paths.js","sourceRoot":"","sources":["../../src/harness/unit-paths.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,0CAkBC;AAOD,wDASC;AAlED;;;;;;;;;;GAUG;AACH,uCAAyB;AACzB,2CAA6B;AAEtB,MAAM,eAAe,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAAhE,QAAA,eAAe,mBAAiD;AACtE,MAAM,UAAU,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;AAApE,QAAA,UAAU,cAA0D;AAEjF;;;;;;;;;;;;;;GAcG;AACH,SAAgB,eAAe,CAAC,OAAe,EAAE,IAAY;IAC3D,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAC3C,MAAM,aAAa,GAAG,GAAG,IAAA,uBAAe,EAAC,IAAI,CAAC,UAAU,CAAC;IACzD,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IAEhD,IAAI,KAAe,CAAC;IACpB,IAAI,CAAC;QACH,KAAK,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;IACpE,CAAC;IAAC,MA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C5E,IAAI,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,OAAO,IAAI,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;YAAE,OAAO,SAAS,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;IAClF,CAAC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,gGAAgG;AACzF,MAAM,cAAc,GAAG,CAAC,SAAiB,EAAW,EAAE,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAAnF,QAAA,cAAc,kBAAqE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BashSegment } from './bash-write-targets';
|
|
2
|
+
/** May any read-only segment of this line keep its exemption? */
|
|
3
|
+
export declare function lineKeepsReadOnlyExemption(command: string, segs: BashSegment[]): boolean;
|
|
4
|
+
export declare function isReadOnlyNodeEval(args: string[]): boolean;
|
|
5
|
+
/** Does this segment only read? (`words` holds its arguments and redirection targets.) */
|
|
6
|
+
export declare function isReadOnlySegment(seg: BashSegment): boolean;
|
|
7
|
+
/** Does everything downstream of segment `i` in its pipeline only read / filter? */
|
|
8
|
+
export declare function pipelineStaysReadOnly(segs: BashSegment[], i: number): boolean;
|
|
9
|
+
//# sourceMappingURL=bash-read-only-segment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bash-read-only-segment.d.ts","sourceRoot":"","sources":["../../src/hooks/bash-read-only-segment.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAwCxD,iEAAiE;AACjE,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,OAAO,CAGxF;AAaD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAI1D;AASD,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAO3D;AAYD,oFAAoF;AACpF,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAM7E"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.lineKeepsReadOnlyExemption = lineKeepsReadOnlyExemption;
|
|
37
|
+
exports.isReadOnlyNodeEval = isReadOnlyNodeEval;
|
|
38
|
+
exports.isReadOnlySegment = isReadOnlySegment;
|
|
39
|
+
exports.pipelineStaysReadOnly = pipelineStaysReadOnly;
|
|
40
|
+
/**
|
|
41
|
+
* Which Bash segments only READ, so they may name a protected path freely (bash-protected-mention).
|
|
42
|
+
*
|
|
43
|
+
* An allowlist, fail-closed (#968): a command is read-only only in the forms listed here. It drops
|
|
44
|
+
* back to "the guard cannot tell" when
|
|
45
|
+
* - the command word has a `/` outside the system bin dirs (`./cat`, `/tmp/evil/jq`),
|
|
46
|
+
* - a word holds `$`, `{`, `*`, `?` or `[` (`$'--output'`, `${…}`, `--{output=…,stat}`, a `q*` glob can
|
|
47
|
+
* hide an option name or a path),
|
|
48
|
+
* - an option runs a program or writes a file, also abbreviated where the tool accepts that
|
|
49
|
+
* (`rg --pre`, `git diff --output` / `--outp`, ugrep's `grep --filter` / `--save-config` / `--pager`
|
|
50
|
+
* / `--config`, `sort -o` / `--o…` / `--c…`),
|
|
51
|
+
* - git has any global option before its subcommand except `--no-pager` / `-P` / `--no-optional-locks`
|
|
52
|
+
* (`-c`, `--config-env`, `--exec-path`, `-C`, `--git-dir`… can point it at another program),
|
|
53
|
+
* - its output is piped into anything that is not a read-only command or filter (`| xargs rm`, `| sh`).
|
|
54
|
+
* And the whole LINE loses the exemption (lineKeepsReadOnlyExemption) when it uses command
|
|
55
|
+
* substitution or changes shell state that a later command obeys: any `NAME=value`, `export`,
|
|
56
|
+
* `declare`, `typeset`, `set`, `setopt`, `shopt`, `alias`, `unalias`, `hash`, `unset`, `read`,
|
|
57
|
+
* `enable`, `builtin`, `trap`, `source` / `.`, `eval`, or a function definition.
|
|
58
|
+
* `git grep` is not read-only at all: `-O` runs a program, also inside a flag cluster (`-nOrm`) and
|
|
59
|
+
* as an abbreviation (`--open=`). `node -e|-p` counts only when its script can do nothing but read
|
|
60
|
+
* (isReadOnlyNodeEval).
|
|
61
|
+
*
|
|
62
|
+
* Accepted floor, not closed here: `sungen` is listed read-only (it writes approval records only
|
|
63
|
+
* through its own human gates); a path built at runtime (`$VAR` away from a protected name), a
|
|
64
|
+
* symlink, or a script that writes without naming the path is out of reach; a bare directory
|
|
65
|
+
* (`rm -rf qa/decisions`, `cd qa && rm -rf decisions/`) is not a protected-path mention (#970);
|
|
66
|
+
* `git -C <dir> …` is not followed; a same-line `D=qa/decisions; … $D` is not tracked; pathless
|
|
67
|
+
* destructive git (`clean -fdx`, `stash`, `reset --hard`, `checkout .`, `apply`, `am`) is not seen;
|
|
68
|
+
* and a quoting trick the tokenizer reads differently from the shell can turn a deny into an ask.
|
|
69
|
+
* The backstop is release-time decision integrity: the git HEAD comparison and the in-run rule.
|
|
70
|
+
*/
|
|
71
|
+
const path = __importStar(require("path"));
|
|
72
|
+
const READ_ONLY = new Set(['cat', 'ls', 'head', 'tail', 'grep', 'rg', 'wc', 'diff', 'stat', 'jq', 'sungen', 'sungen.js']);
|
|
73
|
+
const GIT_READ_ONLY = new Set(['diff', 'log', 'show', 'status', 'check-ignore', 'ls-files', 'ls-tree', 'blame', 'rev-parse', 'cat-file']);
|
|
74
|
+
/** The only git global options allowed before a read-only subcommand. */
|
|
75
|
+
const GIT_SAFE_GLOBALS = new Set(['--no-pager', '-P', '--no-optional-locks']);
|
|
76
|
+
/** Filters that write only to stdout — safe as a pipe sink, in the forms isPipeFilter allows. */
|
|
77
|
+
const FILTERS = new Set(['sort', 'uniq', 'cut', 'tr']);
|
|
78
|
+
/** A command word with a `/` counts only from these dirs: `./cat` or `/tmp/evil/jq` is not `cat` / `jq`. */
|
|
79
|
+
const SYSTEM_BIN = new Set(['/usr/bin', '/bin', '/usr/local/bin', '/opt/homebrew/bin']);
|
|
80
|
+
/** Characters that let the shell build a word the guard cannot read: expansions, braces, globs. */
|
|
81
|
+
const OPAQUE_WORD = /[$*?[{]/;
|
|
82
|
+
/** Is `word` the long option `--<one of names>`, or an abbreviation of one at least `min` chars long? */
|
|
83
|
+
const longOpt = (names, min) => (word) => {
|
|
84
|
+
const m = /^--([^=]+)/.exec(word);
|
|
85
|
+
return !!m && names.some((n) => n === m[1] || (m[1].length >= min && n.startsWith(m[1])));
|
|
86
|
+
};
|
|
87
|
+
/** Options that make an otherwise read-only command run a program or write a file. */
|
|
88
|
+
const UNSAFE_OPT = {
|
|
89
|
+
rg: (w) => /^--(?:pre|hostname-bin)(?:=|$)/.test(w),
|
|
90
|
+
git: longOpt(['output', 'ext-diff', 'textconv'], 2),
|
|
91
|
+
// `grep` may be ugrep: --filter runs programs, --save-config writes, --pager / --view run one, --config / ---FILE load those
|
|
92
|
+
grep: (w) => w.startsWith('---') || longOpt(['filter', 'save-config', 'pager', 'view', 'config'], 3)(w),
|
|
93
|
+
};
|
|
94
|
+
const trustedWords = (seg) => !seg.assigns.length && !seg.words.some((w) => OPAQUE_WORD.test(w))
|
|
95
|
+
&& (!seg.cmdPath.includes('/') || SYSTEM_BIN.has(path.posix.dirname(seg.cmdPath)));
|
|
96
|
+
/** `$(…)`, backticks, `<(…)`, `>(…)`: a command's output becomes another command's words. */
|
|
97
|
+
const SUBSTITUTION = /\$\(|`|[<>]\(/;
|
|
98
|
+
/** Commands that change shell state a later command on the line obeys. */
|
|
99
|
+
const SHELL_STATE = new Set([
|
|
100
|
+
'export', 'declare', 'typeset', 'local', 'readonly', 'set', 'setopt', 'shopt', 'alias', 'unalias', 'hash', 'unset',
|
|
101
|
+
'read', 'enable', 'builtin', 'trap', 'source', '.', 'eval', 'function',
|
|
102
|
+
]);
|
|
103
|
+
/** `name() {` / `name() (` — a function definition (`function name` is caught by SHELL_STATE). */
|
|
104
|
+
const FUNCTION_DEF = /(?:^|[\s;&|])[\w.:-]+\s*\(\s*\)\s*[{(]/;
|
|
105
|
+
/** May any read-only segment of this line keep its exemption? */
|
|
106
|
+
function lineKeepsReadOnlyExemption(command, segs) {
|
|
107
|
+
return !SUBSTITUTION.test(command) && !FUNCTION_DEF.test(command)
|
|
108
|
+
&& !segs.some((s) => s.assigns.length || SHELL_STATE.has(s.cmd));
|
|
109
|
+
}
|
|
110
|
+
/** `node -e` / `node -p` whose script can only read: no write/exec API, no computed access, no escapes. */
|
|
111
|
+
const NODE_EVAL_FLAGS = new Set(['-e', '-p', '--eval', '--print']);
|
|
112
|
+
const NODE_UNSAFE = new RegExp([
|
|
113
|
+
'[`\\[\\\\]', // template literals, computed property access, string escapes
|
|
114
|
+
'flag', // `readFileSync(p, { flag: 'w' })` truncates p
|
|
115
|
+
'write', 'append', '\\brm', 'unlink', 'rename', 'copy', '\\bcp', 'mkd', 'truncate', 'stream', 'open', 'link',
|
|
116
|
+
'chmod', 'chown', 'utime', 'exec', 'spawn', 'fork', 'child', 'eval', 'function', 'import', 'constructor',
|
|
117
|
+
'proto', 'reflect', 'proxy', 'global', 'process', 'module', 'object', 'concat', '\\bvm\\b', 'worker', 'binding',
|
|
118
|
+
].join('|'), 'i');
|
|
119
|
+
const SAFE_REQUIRE = /\brequire\(\s*(['"])(?:(?:node:)?(?:fs|path)|[./][^'"]*\.json)\1\s*\)/g;
|
|
120
|
+
function isReadOnlyNodeEval(args) {
|
|
121
|
+
if (args.length !== 2 || !NODE_EVAL_FLAGS.has(args[0]))
|
|
122
|
+
return false;
|
|
123
|
+
const script = args[1];
|
|
124
|
+
return !NODE_UNSAFE.test(script) && !/\brequire\b/.test(script.replace(SAFE_REQUIRE, ''));
|
|
125
|
+
}
|
|
126
|
+
/** `git [--no-pager|-P|--no-optional-locks]… <read-only subcommand> …` — anchored, no other global option. */
|
|
127
|
+
function isReadOnlyGit(words) {
|
|
128
|
+
let k = 0;
|
|
129
|
+
while (GIT_SAFE_GLOBALS.has(words[k]))
|
|
130
|
+
k++;
|
|
131
|
+
return GIT_READ_ONLY.has(words[k] ?? '');
|
|
132
|
+
}
|
|
133
|
+
/** Does this segment only read? (`words` holds its arguments and redirection targets.) */
|
|
134
|
+
function isReadOnlySegment(seg) {
|
|
135
|
+
if (!seg.cmd || !trustedWords(seg))
|
|
136
|
+
return false;
|
|
137
|
+
const unsafe = UNSAFE_OPT[seg.cmd];
|
|
138
|
+
if (unsafe && seg.words.some(unsafe))
|
|
139
|
+
return false;
|
|
140
|
+
if (seg.cmd === 'git')
|
|
141
|
+
return isReadOnlyGit(seg.words);
|
|
142
|
+
if (seg.cmd === 'node')
|
|
143
|
+
return isReadOnlyNodeEval(seg.words);
|
|
144
|
+
return READ_ONLY.has(seg.cmd);
|
|
145
|
+
}
|
|
146
|
+
/** A pipe sink that cannot act on what it reads: a read-only command, or a stdout-only filter. */
|
|
147
|
+
function isPipeFilter(seg) {
|
|
148
|
+
if (isReadOnlySegment(seg))
|
|
149
|
+
return true;
|
|
150
|
+
if (!FILTERS.has(seg.cmd) || !trustedWords(seg))
|
|
151
|
+
return false;
|
|
152
|
+
// `sort -o out` / `--compress-program=…` (any `--o…` / `--c…` abbreviation) write or run; `uniq in out` writes its second operand.
|
|
153
|
+
if (seg.cmd === 'sort')
|
|
154
|
+
return !seg.words.some((w) => /^(?:-[^-]*o|--[oc])/.test(w));
|
|
155
|
+
if (seg.cmd === 'uniq')
|
|
156
|
+
return seg.words.every((w) => w.startsWith('-'));
|
|
157
|
+
return true; // cut, tr: operands are inputs or character sets
|
|
158
|
+
}
|
|
159
|
+
/** Does everything downstream of segment `i` in its pipeline only read / filter? */
|
|
160
|
+
function pipelineStaysReadOnly(segs, i) {
|
|
161
|
+
for (let j = i; segs[j]?.pipesTo; j++) {
|
|
162
|
+
const next = segs[j + 1];
|
|
163
|
+
if (!next || !isPipeFilter(next))
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=bash-read-only-segment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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ment {
|
|
3
3
|
/** The command name (basename, after env assignments and wrappers like `sudo`), or ''. */
|
|
4
4
|
cmd: string;
|
|
5
|
+
/** The command word as written (`./cat`, `/usr/bin/grep`, `cat`). */
|
|
6
|
+
cmdPath: string;
|
|
5
7
|
/** Its arguments, and every redirection target, as written. */
|
|
6
8
|
words: string[];
|
|
7
9
|
/** The directory it runs in — a preceding `cd` in the same line is followed. */
|
|
8
10
|
dir: string;
|
|
9
|
-
/** Absolute paths it writes via redirection, `tee` or `
|
|
11
|
+
/** Absolute paths it writes via redirection, `tee`, `sed -i` or `git … --output`. */
|
|
10
12
|
writes: string[];
|
|
13
|
+
/** False once a `cd` / `pushd` / `popd` on the line went somewhere the guard cannot resolve. */
|
|
14
|
+
dirKnown: boolean;
|
|
15
|
+
/** It writes a relative path while `dirKnown` is false — the guard cannot tell where. */
|
|
16
|
+
writesInUnknownDir: boolean;
|
|
17
|
+
/** Leading `NAME=value` assignments (a lone `X=…` is a segment too, with cmd ''). */
|
|
18
|
+
assigns: string[];
|
|
19
|
+
/** Its stdout feeds the next segment through `|`. */
|
|
20
|
+
pipesTo: boolean;
|
|
11
21
|
}
|
|
12
22
|
export declare function bashSegments(command: string, cwd: string): BashSegment[];
|
|
13
|
-
/** Absolute paths the command writes via redirection, `tee` or `
|
|
23
|
+
/** Absolute paths the command writes via redirection, `tee`, `sed -i` or `git --output`, resolved against `cwd`. */
|
|
14
24
|
export declare function bashWriteTargets(command: string, cwd: string): string[];
|
|
15
25
|
//# sourceMappingURL=bash-write-targets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash-write-targets.d.ts","sourceRoot":"","sources":["../../src/hooks/bash-write-targets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bash-write-targets.d.ts","sourceRoot":"","sources":["../../src/hooks/bash-write-targets.ts"],"names":[],"mappings":"AAmGA,iEAAiE;AACjE,MAAM,WAAW,WAAW;IAC1B,0FAA0F;IAC1F,GAAG,EAAE,MAAM,CAAC;IACZ,qEAAqE;IACrE,OAAO,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAC;IACZ,qFAAqF;IACrF,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,gGAAgG;IAChG,QAAQ,EAAE,OAAO,CAAC;IAClB,yFAAyF;IACzF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,qFAAqF;IACrF,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,qDAAqD;IACrD,OAAO,EAAE,OAAO,CAAC;CAClB;AAsBD,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,WAAW,EAAE,CAgDxE;AAED,oHAAoH;AACpH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAEvE"}
|