@rpamis/comet 0.3.9 → 0.4.0-beta.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/README.md +572 -257
- package/assets/manifest.json +46 -13
- package/assets/skills/comet/SKILL.md +17 -271
- package/assets/skills/comet/reference/auto-transition.md +1 -1
- package/assets/skills/comet/reference/classic-layout.md +34 -0
- package/assets/skills/comet/reference/comet-yaml-fields.md +22 -9
- package/assets/skills/comet/reference/context-recovery.md +23 -3
- package/assets/skills/comet/reference/debug-gate.md +17 -1
- package/assets/skills/comet/reference/decision-point.md +24 -2
- package/assets/skills/comet/reference/file-structure.md +2 -2
- package/assets/skills/comet/reference/intent-frame.md +74 -0
- package/assets/skills/comet/reference/scripts.md +101 -0
- package/assets/skills/comet/reference/subagent-dispatch.md +84 -27
- package/assets/skills/comet/rules/comet-phase-guard.en.md +44 -33
- package/assets/skills/comet/rules/comet-phase-guard.md +42 -33
- package/assets/skills/comet/rules/comet-workflow-guard.en.md +32 -0
- package/assets/skills/comet/rules/comet-workflow-guard.md +32 -0
- package/assets/skills/comet/runtime/classic/checks.yaml +6 -0
- package/assets/skills/comet/runtime/classic/guardrails.yaml +13 -0
- package/assets/skills/comet/runtime/classic/skill.yaml +122 -0
- package/assets/skills/comet/scripts/comet-archive.mjs +3 -0
- package/assets/skills/comet/scripts/comet-entry-runtime.mjs +8074 -0
- package/assets/skills/comet/scripts/comet-env.mjs +15 -0
- package/assets/skills/comet/scripts/comet-guard.mjs +3 -0
- package/assets/skills/comet/scripts/comet-handoff.mjs +3 -0
- package/assets/skills/comet/scripts/comet-hook-guard.mjs +3 -0
- package/assets/skills/comet/scripts/comet-hook-router.mjs +12786 -0
- package/assets/skills/comet/scripts/comet-intent.mjs +3 -0
- package/assets/skills/comet/scripts/comet-resume-probe.mjs +3 -0
- package/assets/skills/comet/scripts/comet-runtime.mjs +19201 -0
- package/assets/skills/comet/scripts/comet-state.mjs +3 -0
- package/assets/skills/comet/scripts/comet-yaml-validate.mjs +3 -0
- package/assets/skills/comet-any/SKILL.md +118 -0
- package/assets/skills/comet-any/reference/authored-zone-example.md +105 -0
- package/assets/skills/comet-any/reference/authoring-protocol.json +91 -0
- package/assets/skills/comet-any/reference/authoring-subagents.md +102 -0
- package/assets/skills/comet-any/reference/bundle-authoring.md +166 -0
- package/assets/skills/comet-any/reference/eval-provider.md +83 -0
- package/assets/skills/comet-any/reference/subagents/pause-points-author.md +78 -0
- package/assets/skills/comet-any/reference/subagents/reference-author.md +77 -0
- package/assets/skills/comet-any/reference/subagents/script-author.md +81 -0
- package/assets/skills/comet-any/reference/subagents/skill-core-author.md +129 -0
- package/assets/skills/comet-any/reference/subagents/skill-reviewer.md +126 -0
- package/assets/skills/comet-any/reference/subagents/workflow-entry-author.md +101 -0
- package/assets/skills/comet-archive/SKILL.md +81 -28
- package/assets/skills/comet-build/SKILL.md +97 -67
- package/assets/skills/comet-classic/SKILL.md +295 -0
- package/assets/skills/comet-design/SKILL.md +43 -43
- package/assets/skills/comet-hotfix/SKILL.md +71 -59
- package/assets/skills/comet-native/SKILL.md +133 -0
- package/assets/skills/comet-native/reference/artifacts.md +141 -0
- package/assets/skills/comet-native/reference/clarification.md +54 -0
- package/assets/skills/comet-native/reference/commands.md +170 -0
- package/assets/skills/comet-native/reference/recovery.md +96 -0
- package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +4 -0
- package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +34468 -0
- package/assets/skills/comet-open/SKILL.md +120 -70
- package/assets/skills/comet-tweak/SKILL.md +99 -68
- package/assets/skills/comet-verify/SKILL.md +74 -86
- package/assets/skills-zh/comet/SKILL.md +17 -258
- package/assets/skills-zh/comet/reference/auto-transition.md +3 -3
- package/assets/skills-zh/comet/reference/classic-layout.md +34 -0
- package/assets/skills-zh/comet/reference/comet-yaml-fields.md +18 -9
- package/assets/skills-zh/comet/reference/context-recovery.md +22 -2
- package/assets/skills-zh/comet/reference/debug-gate.md +17 -1
- package/assets/skills-zh/comet/reference/decision-point.md +24 -2
- package/assets/skills-zh/comet/reference/file-structure.md +2 -2
- package/assets/skills-zh/comet/reference/intent-frame.md +74 -0
- package/assets/skills-zh/comet/reference/scripts.md +101 -0
- package/assets/skills-zh/comet/reference/subagent-dispatch.md +72 -22
- package/assets/skills-zh/comet/runtime/classic/checks.yaml +6 -0
- package/assets/skills-zh/comet/runtime/classic/guardrails.yaml +13 -0
- package/assets/skills-zh/comet/runtime/classic/skill.yaml +122 -0
- package/assets/skills-zh/comet-any/SKILL.md +118 -0
- package/assets/skills-zh/comet-any/reference/authored-zone-example.md +105 -0
- package/assets/skills-zh/comet-any/reference/authoring-protocol.json +91 -0
- package/assets/skills-zh/comet-any/reference/authoring-subagents.md +107 -0
- package/assets/skills-zh/comet-any/reference/bundle-authoring.md +166 -0
- package/assets/skills-zh/comet-any/reference/eval-provider.md +66 -0
- package/assets/skills-zh/comet-any/reference/subagents/pause-points-author.md +81 -0
- package/assets/skills-zh/comet-any/reference/subagents/reference-author.md +81 -0
- package/assets/skills-zh/comet-any/reference/subagents/script-author.md +84 -0
- package/assets/skills-zh/comet-any/reference/subagents/skill-core-author.md +129 -0
- package/assets/skills-zh/comet-any/reference/subagents/skill-reviewer.md +126 -0
- package/assets/skills-zh/comet-any/reference/subagents/workflow-entry-author.md +99 -0
- package/assets/skills-zh/comet-archive/SKILL.md +81 -28
- package/assets/skills-zh/comet-build/SKILL.md +88 -71
- package/assets/skills-zh/comet-classic/SKILL.md +283 -0
- package/assets/skills-zh/comet-design/SKILL.md +43 -43
- package/assets/skills-zh/comet-hotfix/SKILL.md +75 -63
- package/assets/skills-zh/comet-native/SKILL.md +133 -0
- package/assets/skills-zh/comet-native/reference/artifacts.md +141 -0
- package/assets/skills-zh/comet-native/reference/clarification.md +54 -0
- package/assets/skills-zh/comet-native/reference/commands.md +170 -0
- package/assets/skills-zh/comet-native/reference/recovery.md +96 -0
- package/assets/skills-zh/comet-open/SKILL.md +121 -71
- package/assets/skills-zh/comet-tweak/SKILL.md +98 -66
- package/assets/skills-zh/comet-verify/SKILL.md +70 -80
- package/bin/comet.js +1 -1
- package/dist/app/cli/comet-banner.d.ts +25 -0
- package/dist/app/cli/comet-banner.d.ts.map +1 -0
- package/dist/app/cli/comet-banner.js +265 -0
- package/dist/app/cli/comet-banner.js.map +1 -0
- package/dist/{cli → app/cli}/index.d.ts.map +1 -1
- package/dist/app/cli/index.js +527 -0
- package/dist/app/cli/index.js.map +1 -0
- package/dist/app/commands/bundle.d.ts +51 -0
- package/dist/app/commands/bundle.d.ts.map +1 -0
- package/dist/app/commands/bundle.js +387 -0
- package/dist/app/commands/bundle.js.map +1 -0
- package/dist/app/commands/classic.d.ts +5 -0
- package/dist/app/commands/classic.d.ts.map +1 -0
- package/dist/app/commands/classic.js +32 -0
- package/dist/app/commands/classic.js.map +1 -0
- package/dist/app/commands/command-result.d.ts +6 -0
- package/dist/app/commands/command-result.d.ts.map +1 -0
- package/dist/app/commands/command-result.js +4 -0
- package/dist/app/commands/command-result.js.map +1 -0
- package/dist/app/commands/creator.d.ts +14 -0
- package/dist/app/commands/creator.d.ts.map +1 -0
- package/dist/app/commands/creator.js +82 -0
- package/dist/app/commands/creator.js.map +1 -0
- package/dist/app/commands/dashboard.d.ts +16 -0
- package/dist/app/commands/dashboard.d.ts.map +1 -0
- package/dist/app/commands/dashboard.js +53 -0
- package/dist/app/commands/dashboard.js.map +1 -0
- package/dist/{commands → app/commands}/doctor.d.ts +5 -1
- package/dist/app/commands/doctor.d.ts.map +1 -0
- package/dist/app/commands/doctor.js +1115 -0
- package/dist/app/commands/doctor.js.map +1 -0
- package/dist/app/commands/eval.d.ts +19 -0
- package/dist/app/commands/eval.d.ts.map +1 -0
- package/dist/app/commands/eval.js +227 -0
- package/dist/app/commands/eval.js.map +1 -0
- package/dist/app/commands/i18n.d.ts +4 -0
- package/dist/app/commands/i18n.d.ts.map +1 -0
- package/dist/{commands → app/commands}/i18n.js +40 -8
- package/dist/app/commands/i18n.js.map +1 -0
- package/dist/app/commands/init.d.ts +38 -0
- package/dist/app/commands/init.d.ts.map +1 -0
- package/dist/app/commands/init.js +891 -0
- package/dist/app/commands/init.js.map +1 -0
- package/dist/app/commands/native.d.ts +2 -0
- package/dist/app/commands/native.d.ts.map +1 -0
- package/dist/app/commands/native.js +10 -0
- package/dist/app/commands/native.js.map +1 -0
- package/dist/app/commands/platform-select-prompt.d.ts +38 -0
- package/dist/app/commands/platform-select-prompt.d.ts.map +1 -0
- package/dist/app/commands/platform-select-prompt.js +141 -0
- package/dist/app/commands/platform-select-prompt.js.map +1 -0
- package/dist/app/commands/project-scope-selection.d.ts +13 -0
- package/dist/app/commands/project-scope-selection.d.ts.map +1 -0
- package/dist/app/commands/project-scope-selection.js +35 -0
- package/dist/app/commands/project-scope-selection.js.map +1 -0
- package/dist/app/commands/publish.d.ts +7 -0
- package/dist/app/commands/publish.d.ts.map +1 -0
- package/dist/app/commands/publish.js +14 -0
- package/dist/app/commands/publish.js.map +1 -0
- package/dist/app/commands/resume-probe.d.ts +12 -0
- package/dist/app/commands/resume-probe.d.ts.map +1 -0
- package/dist/app/commands/resume-probe.js +68 -0
- package/dist/app/commands/resume-probe.js.map +1 -0
- package/dist/app/commands/skill.d.ts +23 -0
- package/dist/app/commands/skill.d.ts.map +1 -0
- package/dist/app/commands/skill.js +208 -0
- package/dist/app/commands/skill.js.map +1 -0
- package/dist/app/commands/status.d.ts.map +1 -0
- package/dist/app/commands/status.js +125 -0
- package/dist/app/commands/status.js.map +1 -0
- package/dist/app/commands/uninstall.d.ts +14 -0
- package/dist/app/commands/uninstall.d.ts.map +1 -0
- package/dist/app/commands/uninstall.js +343 -0
- package/dist/app/commands/uninstall.js.map +1 -0
- package/dist/app/commands/update.d.ts +54 -0
- package/dist/app/commands/update.d.ts.map +1 -0
- package/dist/app/commands/update.js +1608 -0
- package/dist/app/commands/update.js.map +1 -0
- package/dist/app/commands/workflow.d.ts +6 -0
- package/dist/app/commands/workflow.d.ts.map +1 -0
- package/dist/app/commands/workflow.js +11 -0
- package/dist/app/commands/workflow.js.map +1 -0
- package/dist/config/repository-layout.json +124 -0
- package/dist/domains/bundle/authoring.d.ts +82 -0
- package/dist/domains/bundle/authoring.d.ts.map +1 -0
- package/dist/domains/bundle/authoring.js +185 -0
- package/dist/domains/bundle/authoring.js.map +1 -0
- package/dist/domains/bundle/bundle-platform.d.ts +40 -0
- package/dist/domains/bundle/bundle-platform.d.ts.map +1 -0
- package/dist/domains/bundle/bundle-platform.js +293 -0
- package/dist/domains/bundle/bundle-platform.js.map +1 -0
- package/dist/domains/bundle/candidates.d.ts +29 -0
- package/dist/domains/bundle/candidates.d.ts.map +1 -0
- package/dist/domains/bundle/candidates.js +37 -0
- package/dist/domains/bundle/candidates.js.map +1 -0
- package/dist/domains/bundle/compatibility-benchmark.d.ts +12 -0
- package/dist/domains/bundle/compatibility-benchmark.d.ts.map +1 -0
- package/dist/domains/bundle/compatibility-benchmark.js +224 -0
- package/dist/domains/bundle/compatibility-benchmark.js.map +1 -0
- package/dist/domains/bundle/compiler.d.ts +5 -0
- package/dist/domains/bundle/compiler.d.ts.map +1 -0
- package/dist/domains/bundle/compiler.js +106 -0
- package/dist/domains/bundle/compiler.js.map +1 -0
- package/dist/domains/bundle/distribute.d.ts +33 -0
- package/dist/domains/bundle/distribute.d.ts.map +1 -0
- package/dist/domains/bundle/distribute.js +166 -0
- package/dist/domains/bundle/distribute.js.map +1 -0
- package/dist/domains/bundle/draft.d.ts +19 -0
- package/dist/domains/bundle/draft.d.ts.map +1 -0
- package/dist/domains/bundle/draft.js +82 -0
- package/dist/domains/bundle/draft.js.map +1 -0
- package/dist/domains/bundle/eval-manifest-runtime.d.ts +8 -0
- package/dist/domains/bundle/eval-manifest-runtime.d.ts.map +1 -0
- package/dist/domains/bundle/eval-manifest-runtime.js +118 -0
- package/dist/domains/bundle/eval-manifest-runtime.js.map +1 -0
- package/dist/domains/bundle/eval-run-result.d.ts +22 -0
- package/dist/domains/bundle/eval-run-result.d.ts.map +1 -0
- package/dist/domains/bundle/eval-run-result.js +207 -0
- package/dist/domains/bundle/eval-run-result.js.map +1 -0
- package/dist/domains/bundle/eval.d.ts +36 -0
- package/dist/domains/bundle/eval.d.ts.map +1 -0
- package/dist/domains/bundle/eval.js +498 -0
- package/dist/domains/bundle/eval.js.map +1 -0
- package/dist/domains/bundle/factory-compose.d.ts +12 -0
- package/dist/domains/bundle/factory-compose.d.ts.map +1 -0
- package/dist/domains/bundle/factory-compose.js +309 -0
- package/dist/domains/bundle/factory-compose.js.map +1 -0
- package/dist/domains/bundle/factory-guide.d.ts +37 -0
- package/dist/domains/bundle/factory-guide.d.ts.map +1 -0
- package/dist/domains/bundle/factory-guide.js +96 -0
- package/dist/domains/bundle/factory-guide.js.map +1 -0
- package/dist/domains/bundle/factory-plan.d.ts +48 -0
- package/dist/domains/bundle/factory-plan.d.ts.map +1 -0
- package/dist/domains/bundle/factory-plan.js +172 -0
- package/dist/domains/bundle/factory-plan.js.map +1 -0
- package/dist/domains/bundle/factory-proposal.d.ts +31 -0
- package/dist/domains/bundle/factory-proposal.d.ts.map +1 -0
- package/dist/domains/bundle/factory-proposal.js +225 -0
- package/dist/domains/bundle/factory-proposal.js.map +1 -0
- package/dist/domains/bundle/factory-resolve.d.ts +11 -0
- package/dist/domains/bundle/factory-resolve.d.ts.map +1 -0
- package/dist/domains/bundle/factory-resolve.js +121 -0
- package/dist/domains/bundle/factory-resolve.js.map +1 -0
- package/dist/domains/bundle/factory.d.ts +17 -0
- package/dist/domains/bundle/factory.d.ts.map +1 -0
- package/dist/domains/bundle/factory.js +504 -0
- package/dist/domains/bundle/factory.js.map +1 -0
- package/dist/domains/bundle/hash.d.ts +3 -0
- package/dist/domains/bundle/hash.d.ts.map +1 -0
- package/dist/domains/bundle/hash.js +72 -0
- package/dist/domains/bundle/hash.js.map +1 -0
- package/dist/domains/bundle/load.d.ts +4 -0
- package/dist/domains/bundle/load.d.ts.map +1 -0
- package/dist/domains/bundle/load.js +355 -0
- package/dist/domains/bundle/load.js.map +1 -0
- package/dist/domains/bundle/next-action.d.ts +37 -0
- package/dist/domains/bundle/next-action.d.ts.map +1 -0
- package/dist/domains/bundle/next-action.js +185 -0
- package/dist/domains/bundle/next-action.js.map +1 -0
- package/dist/domains/bundle/platform.d.ts +21 -0
- package/dist/domains/bundle/platform.d.ts.map +1 -0
- package/dist/domains/bundle/platform.js +170 -0
- package/dist/domains/bundle/platform.js.map +1 -0
- package/dist/domains/bundle/preferences.d.ts +11 -0
- package/dist/domains/bundle/preferences.d.ts.map +1 -0
- package/dist/domains/bundle/preferences.js +17 -0
- package/dist/domains/bundle/preferences.js.map +1 -0
- package/dist/domains/bundle/publish.d.ts +14 -0
- package/dist/domains/bundle/publish.d.ts.map +1 -0
- package/dist/domains/bundle/publish.js +159 -0
- package/dist/domains/bundle/publish.js.map +1 -0
- package/dist/domains/bundle/readiness-user-summary.d.ts +25 -0
- package/dist/domains/bundle/readiness-user-summary.d.ts.map +1 -0
- package/dist/domains/bundle/readiness-user-summary.js +186 -0
- package/dist/domains/bundle/readiness-user-summary.js.map +1 -0
- package/dist/domains/bundle/review-summary.d.ts +36 -0
- package/dist/domains/bundle/review-summary.d.ts.map +1 -0
- package/dist/domains/bundle/review-summary.js +348 -0
- package/dist/domains/bundle/review-summary.js.map +1 -0
- package/dist/domains/bundle/state.d.ts +7 -0
- package/dist/domains/bundle/state.d.ts.map +1 -0
- package/dist/domains/bundle/state.js +247 -0
- package/dist/domains/bundle/state.js.map +1 -0
- package/dist/domains/bundle/types.d.ts +347 -0
- package/dist/domains/bundle/types.d.ts.map +1 -0
- package/dist/domains/bundle/types.js.map +1 -0
- package/dist/domains/bundle/user-facing.d.ts +48 -0
- package/dist/domains/bundle/user-facing.d.ts.map +1 -0
- package/dist/domains/bundle/user-facing.js +73 -0
- package/dist/domains/bundle/user-facing.js.map +1 -0
- package/dist/domains/bundle/validate.d.ts +5 -0
- package/dist/domains/bundle/validate.d.ts.map +1 -0
- package/dist/domains/bundle/validate.js +292 -0
- package/dist/domains/bundle/validate.js.map +1 -0
- package/dist/domains/comet-classic/classic-archive-entry.d.ts +2 -0
- package/dist/domains/comet-classic/classic-archive-entry.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-archive-entry.js +4 -0
- package/dist/domains/comet-classic/classic-archive-entry.js.map +1 -0
- package/dist/domains/comet-classic/classic-archive-pointer.d.ts +8 -0
- package/dist/domains/comet-classic/classic-archive-pointer.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-archive-pointer.js +66 -0
- package/dist/domains/comet-classic/classic-archive-pointer.js.map +1 -0
- package/dist/domains/comet-classic/classic-archive.d.ts +4 -0
- package/dist/domains/comet-classic/classic-archive.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-archive.js +483 -0
- package/dist/domains/comet-classic/classic-archive.js.map +1 -0
- package/dist/domains/comet-classic/classic-branch-binding.d.ts +51 -0
- package/dist/domains/comet-classic/classic-branch-binding.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-branch-binding.js +107 -0
- package/dist/domains/comet-classic/classic-branch-binding.js.map +1 -0
- package/dist/domains/comet-classic/classic-cli.d.ts +17 -0
- package/dist/domains/comet-classic/classic-cli.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-cli.js +103 -0
- package/dist/domains/comet-classic/classic-cli.js.map +1 -0
- package/dist/domains/comet-classic/classic-command-checks.d.ts +20 -0
- package/dist/domains/comet-classic/classic-command-checks.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-command-checks.js +94 -0
- package/dist/domains/comet-classic/classic-command-checks.js.map +1 -0
- package/dist/domains/comet-classic/classic-command-context.d.ts +12 -0
- package/dist/domains/comet-classic/classic-command-context.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-command-context.js +42 -0
- package/dist/domains/comet-classic/classic-command-context.js.map +1 -0
- package/dist/domains/comet-classic/classic-current-change.d.ts +17 -0
- package/dist/domains/comet-classic/classic-current-change.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-current-change.js +112 -0
- package/dist/domains/comet-classic/classic-current-change.js.map +1 -0
- package/dist/domains/comet-classic/classic-diagnostics.d.ts +17 -0
- package/dist/domains/comet-classic/classic-diagnostics.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-diagnostics.js +110 -0
- package/dist/domains/comet-classic/classic-diagnostics.js.map +1 -0
- package/dist/domains/comet-classic/classic-evidence.d.ts +11 -0
- package/dist/domains/comet-classic/classic-evidence.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-evidence.js +178 -0
- package/dist/domains/comet-classic/classic-evidence.js.map +1 -0
- package/dist/domains/comet-classic/classic-guard-entry.d.ts +2 -0
- package/dist/domains/comet-classic/classic-guard-entry.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-guard-entry.js +4 -0
- package/dist/domains/comet-classic/classic-guard-entry.js.map +1 -0
- package/dist/domains/comet-classic/classic-guard.d.ts +3 -0
- package/dist/domains/comet-classic/classic-guard.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-guard.js +854 -0
- package/dist/domains/comet-classic/classic-guard.js.map +1 -0
- package/dist/domains/comet-classic/classic-handoff-entry.d.ts +2 -0
- package/dist/domains/comet-classic/classic-handoff-entry.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-handoff-entry.js +4 -0
- package/dist/domains/comet-classic/classic-handoff-entry.js.map +1 -0
- package/dist/domains/comet-classic/classic-handoff.d.ts +3 -0
- package/dist/domains/comet-classic/classic-handoff.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-handoff.js +526 -0
- package/dist/domains/comet-classic/classic-handoff.js.map +1 -0
- package/dist/domains/comet-classic/classic-hook-guard-entry.d.ts +2 -0
- package/dist/domains/comet-classic/classic-hook-guard-entry.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-hook-guard-entry.js +4 -0
- package/dist/domains/comet-classic/classic-hook-guard-entry.js.map +1 -0
- package/dist/domains/comet-classic/classic-hook-guard.d.ts +12 -0
- package/dist/domains/comet-classic/classic-hook-guard.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-hook-guard.js +654 -0
- package/dist/domains/comet-classic/classic-hook-guard.js.map +1 -0
- package/dist/domains/comet-classic/classic-intent-command.d.ts +3 -0
- package/dist/domains/comet-classic/classic-intent-command.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-intent-command.js +40 -0
- package/dist/domains/comet-classic/classic-intent-command.js.map +1 -0
- package/dist/domains/comet-classic/classic-intent-entry.d.ts +2 -0
- package/dist/domains/comet-classic/classic-intent-entry.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-intent-entry.js +4 -0
- package/dist/domains/comet-classic/classic-intent-entry.js.map +1 -0
- package/dist/domains/comet-classic/classic-intent.d.ts +79 -0
- package/dist/domains/comet-classic/classic-intent.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-intent.js +307 -0
- package/dist/domains/comet-classic/classic-intent.js.map +1 -0
- package/dist/domains/comet-classic/classic-layout-initialization.d.ts +86 -0
- package/dist/domains/comet-classic/classic-layout-initialization.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-layout-initialization.js +813 -0
- package/dist/domains/comet-classic/classic-layout-initialization.js.map +1 -0
- package/dist/domains/comet-classic/classic-layout.d.ts +47 -0
- package/dist/domains/comet-classic/classic-layout.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-layout.js +227 -0
- package/dist/domains/comet-classic/classic-layout.js.map +1 -0
- package/dist/domains/comet-classic/classic-migrate.d.ts +22 -0
- package/dist/domains/comet-classic/classic-migrate.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-migrate.js +180 -0
- package/dist/domains/comet-classic/classic-migrate.js.map +1 -0
- package/dist/domains/comet-classic/classic-openspec-command.d.ts +4 -0
- package/dist/domains/comet-classic/classic-openspec-command.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-openspec-command.js +45 -0
- package/dist/domains/comet-classic/classic-openspec-command.js.map +1 -0
- package/dist/domains/comet-classic/classic-openspec-root.d.ts +13 -0
- package/dist/domains/comet-classic/classic-openspec-root.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-openspec-root.js +47 -0
- package/dist/domains/comet-classic/classic-openspec-root.js.map +1 -0
- package/dist/domains/comet-classic/classic-paths.d.ts +18 -0
- package/dist/domains/comet-classic/classic-paths.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-paths.js +113 -0
- package/dist/domains/comet-classic/classic-paths.js.map +1 -0
- package/dist/domains/comet-classic/classic-project-config.d.ts +16 -0
- package/dist/domains/comet-classic/classic-project-config.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-project-config.js +36 -0
- package/dist/domains/comet-classic/classic-project-config.js.map +1 -0
- package/dist/domains/comet-classic/classic-protected-path.d.ts +39 -0
- package/dist/domains/comet-classic/classic-protected-path.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-protected-path.js +69 -0
- package/dist/domains/comet-classic/classic-protected-path.js.map +1 -0
- package/dist/domains/comet-classic/classic-resolver.d.ts +10 -0
- package/dist/domains/comet-classic/classic-resolver.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-resolver.js +89 -0
- package/dist/domains/comet-classic/classic-resolver.js.map +1 -0
- package/dist/domains/comet-classic/classic-resume-probe-command.d.ts +3 -0
- package/dist/domains/comet-classic/classic-resume-probe-command.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-resume-probe-command.js +59 -0
- package/dist/domains/comet-classic/classic-resume-probe-command.js.map +1 -0
- package/dist/domains/comet-classic/classic-resume-probe-entry.d.ts +2 -0
- package/dist/domains/comet-classic/classic-resume-probe-entry.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-resume-probe-entry.js +4 -0
- package/dist/domains/comet-classic/classic-resume-probe-entry.js.map +1 -0
- package/dist/domains/comet-classic/classic-resume-probe.d.ts +29 -0
- package/dist/domains/comet-classic/classic-resume-probe.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-resume-probe.js +406 -0
- package/dist/domains/comet-classic/classic-resume-probe.js.map +1 -0
- package/dist/domains/comet-classic/classic-root-command.d.ts +5 -0
- package/dist/domains/comet-classic/classic-root-command.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-root-command.js +84 -0
- package/dist/domains/comet-classic/classic-root-command.js.map +1 -0
- package/dist/domains/comet-classic/classic-root-move.d.ts +119 -0
- package/dist/domains/comet-classic/classic-root-move.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-root-move.js +1737 -0
- package/dist/domains/comet-classic/classic-root-move.js.map +1 -0
- package/dist/domains/comet-classic/classic-runtime-evals.d.ts +9 -0
- package/dist/domains/comet-classic/classic-runtime-evals.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-runtime-evals.js +45 -0
- package/dist/domains/comet-classic/classic-runtime-evals.js.map +1 -0
- package/dist/domains/comet-classic/classic-runtime-run.d.ts +8 -0
- package/dist/domains/comet-classic/classic-runtime-run.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-runtime-run.js +378 -0
- package/dist/domains/comet-classic/classic-runtime-run.js.map +1 -0
- package/dist/domains/comet-classic/classic-script-entry.d.ts +3 -0
- package/dist/domains/comet-classic/classic-script-entry.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-script-entry.js +31 -0
- package/dist/domains/comet-classic/classic-script-entry.js.map +1 -0
- package/dist/domains/comet-classic/classic-state-command.d.ts +3 -0
- package/dist/domains/comet-classic/classic-state-command.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-state-command.js +1239 -0
- package/dist/domains/comet-classic/classic-state-command.js.map +1 -0
- package/dist/domains/comet-classic/classic-state-entry.d.ts +2 -0
- package/dist/domains/comet-classic/classic-state-entry.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-state-entry.js +4 -0
- package/dist/domains/comet-classic/classic-state-entry.js.map +1 -0
- package/dist/domains/comet-classic/classic-state-events.d.ts +18 -0
- package/dist/domains/comet-classic/classic-state-events.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-state-events.js +14 -0
- package/dist/domains/comet-classic/classic-state-events.js.map +1 -0
- package/dist/domains/comet-classic/classic-state.d.ts +71 -0
- package/dist/domains/comet-classic/classic-state.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-state.js +251 -0
- package/dist/domains/comet-classic/classic-state.js.map +1 -0
- package/dist/domains/comet-classic/classic-store.d.ts +12 -0
- package/dist/domains/comet-classic/classic-store.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-store.js +140 -0
- package/dist/domains/comet-classic/classic-store.js.map +1 -0
- package/dist/domains/comet-classic/classic-transitions.d.ts +24 -0
- package/dist/domains/comet-classic/classic-transitions.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-transitions.js +158 -0
- package/dist/domains/comet-classic/classic-transitions.js.map +1 -0
- package/dist/domains/comet-classic/classic-validate-command.d.ts +3 -0
- package/dist/domains/comet-classic/classic-validate-command.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-validate-command.js +174 -0
- package/dist/domains/comet-classic/classic-validate-command.js.map +1 -0
- package/dist/domains/comet-classic/classic-validate-entry.d.ts +2 -0
- package/dist/domains/comet-classic/classic-validate-entry.d.ts.map +1 -0
- package/dist/domains/comet-classic/classic-validate-entry.js +4 -0
- package/dist/domains/comet-classic/classic-validate-entry.js.map +1 -0
- package/dist/domains/comet-classic/index.d.ts +23 -0
- package/dist/domains/comet-classic/index.d.ts.map +1 -0
- package/dist/domains/comet-classic/index.js +23 -0
- package/dist/domains/comet-classic/index.js.map +1 -0
- package/dist/domains/comet-entry/current-selection-repair.d.ts +17 -0
- package/dist/domains/comet-entry/current-selection-repair.d.ts.map +1 -0
- package/dist/domains/comet-entry/current-selection-repair.js +19 -0
- package/dist/domains/comet-entry/current-selection-repair.js.map +1 -0
- package/dist/domains/comet-entry/current-selection.d.ts +28 -0
- package/dist/domains/comet-entry/current-selection.d.ts.map +1 -0
- package/dist/domains/comet-entry/current-selection.js +114 -0
- package/dist/domains/comet-entry/current-selection.js.map +1 -0
- package/dist/domains/comet-entry/entry-runtime-entry.d.ts +2 -0
- package/dist/domains/comet-entry/entry-runtime-entry.d.ts.map +1 -0
- package/dist/domains/comet-entry/entry-runtime-entry.js +3 -0
- package/dist/domains/comet-entry/entry-runtime-entry.js.map +1 -0
- package/dist/domains/comet-entry/entry-runtime.d.ts +7 -0
- package/dist/domains/comet-entry/entry-runtime.d.ts.map +1 -0
- package/dist/domains/comet-entry/entry-runtime.js +55 -0
- package/dist/domains/comet-entry/entry-runtime.js.map +1 -0
- package/dist/domains/comet-entry/hook-adapter.d.ts +6 -0
- package/dist/domains/comet-entry/hook-adapter.d.ts.map +1 -0
- package/dist/domains/comet-entry/hook-adapter.js +202 -0
- package/dist/domains/comet-entry/hook-adapter.js.map +1 -0
- package/dist/domains/comet-entry/hook-router-entry.d.ts +8 -0
- package/dist/domains/comet-entry/hook-router-entry.d.ts.map +1 -0
- package/dist/domains/comet-entry/hook-router-entry.js +88 -0
- package/dist/domains/comet-entry/hook-router-entry.js.map +1 -0
- package/dist/domains/comet-entry/hook-router.d.ts +32 -0
- package/dist/domains/comet-entry/hook-router.d.ts.map +1 -0
- package/dist/domains/comet-entry/hook-router.js +133 -0
- package/dist/domains/comet-entry/hook-router.js.map +1 -0
- package/dist/domains/comet-entry/hook-types.d.ts +20 -0
- package/dist/domains/comet-entry/hook-types.d.ts.map +1 -0
- package/dist/domains/comet-entry/hook-types.js +2 -0
- package/dist/domains/comet-entry/hook-types.js.map +1 -0
- package/dist/domains/comet-entry/init-workflow.d.ts +19 -0
- package/dist/domains/comet-entry/init-workflow.d.ts.map +1 -0
- package/dist/domains/comet-entry/init-workflow.js +118 -0
- package/dist/domains/comet-entry/init-workflow.js.map +1 -0
- package/dist/domains/comet-entry/project-status.d.ts +3 -0
- package/dist/domains/comet-entry/project-status.d.ts.map +1 -0
- package/dist/domains/comet-entry/project-status.js +291 -0
- package/dist/domains/comet-entry/project-status.js.map +1 -0
- package/dist/domains/comet-entry/resolve-entry.d.ts +3 -0
- package/dist/domains/comet-entry/resolve-entry.d.ts.map +1 -0
- package/dist/domains/comet-entry/resolve-entry.js +18 -0
- package/dist/domains/comet-entry/resolve-entry.js.map +1 -0
- package/dist/domains/comet-entry/resume-probe.d.ts +34 -0
- package/dist/domains/comet-entry/resume-probe.d.ts.map +1 -0
- package/dist/domains/comet-entry/resume-probe.js +462 -0
- package/dist/domains/comet-entry/resume-probe.js.map +1 -0
- package/dist/domains/comet-entry/types.d.ts +60 -0
- package/dist/domains/comet-entry/types.d.ts.map +1 -0
- package/dist/domains/comet-entry/types.js +2 -0
- package/dist/domains/comet-entry/types.js.map +1 -0
- package/dist/domains/comet-entry/workflow-resolution.d.ts +8 -0
- package/dist/domains/comet-entry/workflow-resolution.d.ts.map +1 -0
- package/dist/domains/comet-entry/workflow-resolution.js +16 -0
- package/dist/domains/comet-entry/workflow-resolution.js.map +1 -0
- package/dist/domains/comet-native/index.d.ts +35 -0
- package/dist/domains/comet-native/index.d.ts.map +1 -0
- package/dist/domains/comet-native/index.js +35 -0
- package/dist/domains/comet-native/index.js.map +1 -0
- package/dist/domains/comet-native/native-acceptance.d.ts +53 -0
- package/dist/domains/comet-native/native-acceptance.d.ts.map +1 -0
- package/dist/domains/comet-native/native-acceptance.js +658 -0
- package/dist/domains/comet-native/native-acceptance.js.map +1 -0
- package/dist/domains/comet-native/native-archive-content.d.ts +26 -0
- package/dist/domains/comet-native/native-archive-content.d.ts.map +1 -0
- package/dist/domains/comet-native/native-archive-content.js +159 -0
- package/dist/domains/comet-native/native-archive-content.js.map +1 -0
- package/dist/domains/comet-native/native-archive-inspection.d.ts +9 -0
- package/dist/domains/comet-native/native-archive-inspection.d.ts.map +1 -0
- package/dist/domains/comet-native/native-archive-inspection.js +97 -0
- package/dist/domains/comet-native/native-archive-inspection.js.map +1 -0
- package/dist/domains/comet-native/native-archive-preflight.d.ts +54 -0
- package/dist/domains/comet-native/native-archive-preflight.d.ts.map +1 -0
- package/dist/domains/comet-native/native-archive-preflight.js +222 -0
- package/dist/domains/comet-native/native-archive-preflight.js.map +1 -0
- package/dist/domains/comet-native/native-archive-transaction.d.ts +20 -0
- package/dist/domains/comet-native/native-archive-transaction.d.ts.map +1 -0
- package/dist/domains/comet-native/native-archive-transaction.js +1183 -0
- package/dist/domains/comet-native/native-archive-transaction.js.map +1 -0
- package/dist/domains/comet-native/native-archive.d.ts +36 -0
- package/dist/domains/comet-native/native-archive.d.ts.map +1 -0
- package/dist/domains/comet-native/native-archive.js +422 -0
- package/dist/domains/comet-native/native-archive.js.map +1 -0
- package/dist/domains/comet-native/native-artifacts.d.ts +10 -0
- package/dist/domains/comet-native/native-artifacts.d.ts.map +1 -0
- package/dist/domains/comet-native/native-artifacts.js +204 -0
- package/dist/domains/comet-native/native-artifacts.js.map +1 -0
- package/dist/domains/comet-native/native-atomic-file.d.ts +10 -0
- package/dist/domains/comet-native/native-atomic-file.d.ts.map +1 -0
- package/dist/domains/comet-native/native-atomic-file.js +179 -0
- package/dist/domains/comet-native/native-atomic-file.js.map +1 -0
- package/dist/domains/comet-native/native-bounded-file.d.ts +19 -0
- package/dist/domains/comet-native/native-bounded-file.d.ts.map +1 -0
- package/dist/domains/comet-native/native-bounded-file.js +184 -0
- package/dist/domains/comet-native/native-bounded-file.js.map +1 -0
- package/dist/domains/comet-native/native-build-evidence.d.ts +42 -0
- package/dist/domains/comet-native/native-build-evidence.d.ts.map +1 -0
- package/dist/domains/comet-native/native-build-evidence.js +257 -0
- package/dist/domains/comet-native/native-build-evidence.js.map +1 -0
- package/dist/domains/comet-native/native-canonical-hash.d.ts +10 -0
- package/dist/domains/comet-native/native-canonical-hash.d.ts.map +1 -0
- package/dist/domains/comet-native/native-canonical-hash.js +100 -0
- package/dist/domains/comet-native/native-canonical-hash.js.map +1 -0
- package/dist/domains/comet-native/native-change-recovery.d.ts +11 -0
- package/dist/domains/comet-native/native-change-recovery.d.ts.map +1 -0
- package/dist/domains/comet-native/native-change-recovery.js +15 -0
- package/dist/domains/comet-native/native-change-recovery.js.map +1 -0
- package/dist/domains/comet-native/native-change.d.ts +66 -0
- package/dist/domains/comet-native/native-change.d.ts.map +1 -0
- package/dist/domains/comet-native/native-change.js +834 -0
- package/dist/domains/comet-native/native-change.js.map +1 -0
- package/dist/domains/comet-native/native-check-receipt-model.d.ts +63 -0
- package/dist/domains/comet-native/native-check-receipt-model.d.ts.map +1 -0
- package/dist/domains/comet-native/native-check-receipt-model.js +352 -0
- package/dist/domains/comet-native/native-check-receipt-model.js.map +1 -0
- package/dist/domains/comet-native/native-check-receipt-storage.d.ts +10 -0
- package/dist/domains/comet-native/native-check-receipt-storage.d.ts.map +1 -0
- package/dist/domains/comet-native/native-check-receipt-storage.js +200 -0
- package/dist/domains/comet-native/native-check-receipt-storage.js.map +1 -0
- package/dist/domains/comet-native/native-check-receipt.d.ts +19 -0
- package/dist/domains/comet-native/native-check-receipt.d.ts.map +1 -0
- package/dist/domains/comet-native/native-check-receipt.js +453 -0
- package/dist/domains/comet-native/native-check-receipt.js.map +1 -0
- package/dist/domains/comet-native/native-check.d.ts +24 -0
- package/dist/domains/comet-native/native-check.d.ts.map +1 -0
- package/dist/domains/comet-native/native-check.js +38 -0
- package/dist/domains/comet-native/native-check.js.map +1 -0
- package/dist/domains/comet-native/native-checkpoint-journal.d.ts +13 -0
- package/dist/domains/comet-native/native-checkpoint-journal.d.ts.map +1 -0
- package/dist/domains/comet-native/native-checkpoint-journal.js +53 -0
- package/dist/domains/comet-native/native-checkpoint-journal.js.map +1 -0
- package/dist/domains/comet-native/native-checkpoint-storage.d.ts +43 -0
- package/dist/domains/comet-native/native-checkpoint-storage.d.ts.map +1 -0
- package/dist/domains/comet-native/native-checkpoint-storage.js +487 -0
- package/dist/domains/comet-native/native-checkpoint-storage.js.map +1 -0
- package/dist/domains/comet-native/native-cli-entry.d.ts +2 -0
- package/dist/domains/comet-native/native-cli-entry.d.ts.map +1 -0
- package/dist/domains/comet-native/native-cli-entry.js +18 -0
- package/dist/domains/comet-native/native-cli-entry.js.map +1 -0
- package/dist/domains/comet-native/native-cli.d.ts +7 -0
- package/dist/domains/comet-native/native-cli.d.ts.map +1 -0
- package/dist/domains/comet-native/native-cli.js +1300 -0
- package/dist/domains/comet-native/native-cli.js.map +1 -0
- package/dist/domains/comet-native/native-config.d.ts +23 -0
- package/dist/domains/comet-native/native-config.d.ts.map +1 -0
- package/dist/domains/comet-native/native-config.js +60 -0
- package/dist/domains/comet-native/native-config.js.map +1 -0
- package/dist/domains/comet-native/native-conflict-inspection.d.ts +17 -0
- package/dist/domains/comet-native/native-conflict-inspection.d.ts.map +1 -0
- package/dist/domains/comet-native/native-conflict-inspection.js +90 -0
- package/dist/domains/comet-native/native-conflict-inspection.js.map +1 -0
- package/dist/domains/comet-native/native-conflict-radar.d.ts +75 -0
- package/dist/domains/comet-native/native-conflict-radar.d.ts.map +1 -0
- package/dist/domains/comet-native/native-conflict-radar.js +326 -0
- package/dist/domains/comet-native/native-conflict-radar.js.map +1 -0
- package/dist/domains/comet-native/native-continuation.d.ts +12 -0
- package/dist/domains/comet-native/native-continuation.d.ts.map +1 -0
- package/dist/domains/comet-native/native-continuation.js +201 -0
- package/dist/domains/comet-native/native-continuation.js.map +1 -0
- package/dist/domains/comet-native/native-contract-files.d.ts +24 -0
- package/dist/domains/comet-native/native-contract-files.d.ts.map +1 -0
- package/dist/domains/comet-native/native-contract-files.js +66 -0
- package/dist/domains/comet-native/native-contract-files.js.map +1 -0
- package/dist/domains/comet-native/native-contract.d.ts +41 -0
- package/dist/domains/comet-native/native-contract.d.ts.map +1 -0
- package/dist/domains/comet-native/native-contract.js +142 -0
- package/dist/domains/comet-native/native-contract.js.map +1 -0
- package/dist/domains/comet-native/native-controller-trust.d.ts +22 -0
- package/dist/domains/comet-native/native-controller-trust.d.ts.map +1 -0
- package/dist/domains/comet-native/native-controller-trust.js +153 -0
- package/dist/domains/comet-native/native-controller-trust.js.map +1 -0
- package/dist/domains/comet-native/native-creation-authorization.d.ts +30 -0
- package/dist/domains/comet-native/native-creation-authorization.d.ts.map +1 -0
- package/dist/domains/comet-native/native-creation-authorization.js +110 -0
- package/dist/domains/comet-native/native-creation-authorization.js.map +1 -0
- package/dist/domains/comet-native/native-diagnostics.d.ts +25 -0
- package/dist/domains/comet-native/native-diagnostics.d.ts.map +1 -0
- package/dist/domains/comet-native/native-diagnostics.js +551 -0
- package/dist/domains/comet-native/native-diagnostics.js.map +1 -0
- package/dist/domains/comet-native/native-doctor.d.ts +12 -0
- package/dist/domains/comet-native/native-doctor.d.ts.map +1 -0
- package/dist/domains/comet-native/native-doctor.js +771 -0
- package/dist/domains/comet-native/native-doctor.js.map +1 -0
- package/dist/domains/comet-native/native-evidence-retention.d.ts +37 -0
- package/dist/domains/comet-native/native-evidence-retention.d.ts.map +1 -0
- package/dist/domains/comet-native/native-evidence-retention.js +916 -0
- package/dist/domains/comet-native/native-evidence-retention.js.map +1 -0
- package/dist/domains/comet-native/native-evidence-storage.d.ts +54 -0
- package/dist/domains/comet-native/native-evidence-storage.d.ts.map +1 -0
- package/dist/domains/comet-native/native-evidence-storage.js +401 -0
- package/dist/domains/comet-native/native-evidence-storage.js.map +1 -0
- package/dist/domains/comet-native/native-file-identity.d.ts +3 -0
- package/dist/domains/comet-native/native-file-identity.d.ts.map +1 -0
- package/dist/domains/comet-native/native-file-identity.js +2 -0
- package/dist/domains/comet-native/native-file-identity.js.map +1 -0
- package/dist/domains/comet-native/native-findings.d.ts +8 -0
- package/dist/domains/comet-native/native-findings.d.ts.map +1 -0
- package/dist/domains/comet-native/native-findings.js +254 -0
- package/dist/domains/comet-native/native-findings.js.map +1 -0
- package/dist/domains/comet-native/native-guards.d.ts +8 -0
- package/dist/domains/comet-native/native-guards.d.ts.map +1 -0
- package/dist/domains/comet-native/native-guards.js +140 -0
- package/dist/domains/comet-native/native-guards.js.map +1 -0
- package/dist/domains/comet-native/native-hash.d.ts +3 -0
- package/dist/domains/comet-native/native-hash.d.ts.map +1 -0
- package/dist/domains/comet-native/native-hash.js +12 -0
- package/dist/domains/comet-native/native-hash.js.map +1 -0
- package/dist/domains/comet-native/native-hook-guard.d.ts +17 -0
- package/dist/domains/comet-native/native-hook-guard.d.ts.map +1 -0
- package/dist/domains/comet-native/native-hook-guard.js +154 -0
- package/dist/domains/comet-native/native-hook-guard.js.map +1 -0
- package/dist/domains/comet-native/native-independent-review.d.ts +28 -0
- package/dist/domains/comet-native/native-independent-review.d.ts.map +1 -0
- package/dist/domains/comet-native/native-independent-review.js +134 -0
- package/dist/domains/comet-native/native-independent-review.js.map +1 -0
- package/dist/domains/comet-native/native-lock.d.ts +47 -0
- package/dist/domains/comet-native/native-lock.d.ts.map +1 -0
- package/dist/domains/comet-native/native-lock.js +390 -0
- package/dist/domains/comet-native/native-lock.js.map +1 -0
- package/dist/domains/comet-native/native-mutation-lock.d.ts +5 -0
- package/dist/domains/comet-native/native-mutation-lock.d.ts.map +1 -0
- package/dist/domains/comet-native/native-mutation-lock.js +66 -0
- package/dist/domains/comet-native/native-mutation-lock.js.map +1 -0
- package/dist/domains/comet-native/native-paths.d.ts +10 -0
- package/dist/domains/comet-native/native-paths.d.ts.map +1 -0
- package/dist/domains/comet-native/native-paths.js +160 -0
- package/dist/domains/comet-native/native-paths.js.map +1 -0
- package/dist/domains/comet-native/native-progress-checkpoint.d.ts +13 -0
- package/dist/domains/comet-native/native-progress-checkpoint.d.ts.map +1 -0
- package/dist/domains/comet-native/native-progress-checkpoint.js +104 -0
- package/dist/domains/comet-native/native-progress-checkpoint.js.map +1 -0
- package/dist/domains/comet-native/native-protected-file.d.ts +113 -0
- package/dist/domains/comet-native/native-protected-file.d.ts.map +1 -0
- package/dist/domains/comet-native/native-protected-file.js +510 -0
- package/dist/domains/comet-native/native-protected-file.js.map +1 -0
- package/dist/domains/comet-native/native-redaction.d.ts +2 -0
- package/dist/domains/comet-native/native-redaction.d.ts.map +1 -0
- package/dist/domains/comet-native/native-redaction.js +18 -0
- package/dist/domains/comet-native/native-redaction.js.map +1 -0
- package/dist/domains/comet-native/native-repair-integration.d.ts +46 -0
- package/dist/domains/comet-native/native-repair-integration.d.ts.map +1 -0
- package/dist/domains/comet-native/native-repair-integration.js +235 -0
- package/dist/domains/comet-native/native-repair-integration.js.map +1 -0
- package/dist/domains/comet-native/native-repair-runtime.d.ts +78 -0
- package/dist/domains/comet-native/native-repair-runtime.d.ts.map +1 -0
- package/dist/domains/comet-native/native-repair-runtime.js +593 -0
- package/dist/domains/comet-native/native-repair-runtime.js.map +1 -0
- package/dist/domains/comet-native/native-repair-stagnation.d.ts +89 -0
- package/dist/domains/comet-native/native-repair-stagnation.d.ts.map +1 -0
- package/dist/domains/comet-native/native-repair-stagnation.js +308 -0
- package/dist/domains/comet-native/native-repair-stagnation.js.map +1 -0
- package/dist/domains/comet-native/native-resume-view.d.ts +14 -0
- package/dist/domains/comet-native/native-resume-view.d.ts.map +1 -0
- package/dist/domains/comet-native/native-resume-view.js +105 -0
- package/dist/domains/comet-native/native-resume-view.js.map +1 -0
- package/dist/domains/comet-native/native-review-contract.d.ts +6 -0
- package/dist/domains/comet-native/native-review-contract.d.ts.map +1 -0
- package/dist/domains/comet-native/native-review-contract.js +6 -0
- package/dist/domains/comet-native/native-review-contract.js.map +1 -0
- package/dist/domains/comet-native/native-review-identity.d.ts +50 -0
- package/dist/domains/comet-native/native-review-identity.d.ts.map +1 -0
- package/dist/domains/comet-native/native-review-identity.js +209 -0
- package/dist/domains/comet-native/native-review-identity.js.map +1 -0
- package/dist/domains/comet-native/native-review-signer.d.ts +24 -0
- package/dist/domains/comet-native/native-review-signer.d.ts.map +1 -0
- package/dist/domains/comet-native/native-review-signer.js +125 -0
- package/dist/domains/comet-native/native-review-signer.js.map +1 -0
- package/dist/domains/comet-native/native-review-trust.d.ts +35 -0
- package/dist/domains/comet-native/native-review-trust.d.ts.map +1 -0
- package/dist/domains/comet-native/native-review-trust.js +176 -0
- package/dist/domains/comet-native/native-review-trust.js.map +1 -0
- package/dist/domains/comet-native/native-revision.d.ts +20 -0
- package/dist/domains/comet-native/native-revision.d.ts.map +1 -0
- package/dist/domains/comet-native/native-revision.js +32 -0
- package/dist/domains/comet-native/native-revision.js.map +1 -0
- package/dist/domains/comet-native/native-root-move.d.ts +20 -0
- package/dist/domains/comet-native/native-root-move.d.ts.map +1 -0
- package/dist/domains/comet-native/native-root-move.js +818 -0
- package/dist/domains/comet-native/native-root-move.js.map +1 -0
- package/dist/domains/comet-native/native-run-consistency.d.ts +3 -0
- package/dist/domains/comet-native/native-run-consistency.d.ts.map +1 -0
- package/dist/domains/comet-native/native-run-consistency.js +136 -0
- package/dist/domains/comet-native/native-run-consistency.js.map +1 -0
- package/dist/domains/comet-native/native-run-store.d.ts +41 -0
- package/dist/domains/comet-native/native-run-store.d.ts.map +1 -0
- package/dist/domains/comet-native/native-run-store.js +452 -0
- package/dist/domains/comet-native/native-run-store.js.map +1 -0
- package/dist/domains/comet-native/native-runtime-package.d.ts +16 -0
- package/dist/domains/comet-native/native-runtime-package.d.ts.map +1 -0
- package/dist/domains/comet-native/native-runtime-package.js +72 -0
- package/dist/domains/comet-native/native-runtime-package.js.map +1 -0
- package/dist/domains/comet-native/native-schema-migration.d.ts +11 -0
- package/dist/domains/comet-native/native-schema-migration.d.ts.map +1 -0
- package/dist/domains/comet-native/native-schema-migration.js +900 -0
- package/dist/domains/comet-native/native-schema-migration.js.map +1 -0
- package/dist/domains/comet-native/native-selection.d.ts +12 -0
- package/dist/domains/comet-native/native-selection.d.ts.map +1 -0
- package/dist/domains/comet-native/native-selection.js +52 -0
- package/dist/domains/comet-native/native-selection.js.map +1 -0
- package/dist/domains/comet-native/native-sensitive-paths.d.ts +7 -0
- package/dist/domains/comet-native/native-sensitive-paths.d.ts.map +1 -0
- package/dist/domains/comet-native/native-sensitive-paths.js +69 -0
- package/dist/domains/comet-native/native-sensitive-paths.js.map +1 -0
- package/dist/domains/comet-native/native-snapshot.d.ts +78 -0
- package/dist/domains/comet-native/native-snapshot.d.ts.map +1 -0
- package/dist/domains/comet-native/native-snapshot.js +2609 -0
- package/dist/domains/comet-native/native-snapshot.js.map +1 -0
- package/dist/domains/comet-native/native-specs.d.ts +12 -0
- package/dist/domains/comet-native/native-specs.d.ts.map +1 -0
- package/dist/domains/comet-native/native-specs.js +270 -0
- package/dist/domains/comet-native/native-specs.js.map +1 -0
- package/dist/domains/comet-native/native-trajectory-limits.d.ts +7 -0
- package/dist/domains/comet-native/native-trajectory-limits.d.ts.map +1 -0
- package/dist/domains/comet-native/native-trajectory-limits.js +13 -0
- package/dist/domains/comet-native/native-trajectory-limits.js.map +1 -0
- package/dist/domains/comet-native/native-trajectory-recovery.d.ts +37 -0
- package/dist/domains/comet-native/native-trajectory-recovery.d.ts.map +1 -0
- package/dist/domains/comet-native/native-trajectory-recovery.js +133 -0
- package/dist/domains/comet-native/native-trajectory-recovery.js.map +1 -0
- package/dist/domains/comet-native/native-trajectory.d.ts +16 -0
- package/dist/domains/comet-native/native-trajectory.d.ts.map +1 -0
- package/dist/domains/comet-native/native-trajectory.js +27 -0
- package/dist/domains/comet-native/native-trajectory.js.map +1 -0
- package/dist/domains/comet-native/native-transaction.d.ts +45 -0
- package/dist/domains/comet-native/native-transaction.d.ts.map +1 -0
- package/dist/domains/comet-native/native-transaction.js +846 -0
- package/dist/domains/comet-native/native-transaction.js.map +1 -0
- package/dist/domains/comet-native/native-transition-evidence.d.ts +4 -0
- package/dist/domains/comet-native/native-transition-evidence.d.ts.map +1 -0
- package/dist/domains/comet-native/native-transition-evidence.js +27 -0
- package/dist/domains/comet-native/native-transition-evidence.js.map +1 -0
- package/dist/domains/comet-native/native-transition-journal.d.ts +30 -0
- package/dist/domains/comet-native/native-transition-journal.d.ts.map +1 -0
- package/dist/domains/comet-native/native-transition-journal.js +819 -0
- package/dist/domains/comet-native/native-transition-journal.js.map +1 -0
- package/dist/domains/comet-native/native-transitions.d.ts +15 -0
- package/dist/domains/comet-native/native-transitions.d.ts.map +1 -0
- package/dist/domains/comet-native/native-transitions.js +683 -0
- package/dist/domains/comet-native/native-transitions.js.map +1 -0
- package/dist/domains/comet-native/native-types.d.ts +556 -0
- package/dist/domains/comet-native/native-types.d.ts.map +1 -0
- package/dist/domains/comet-native/native-types.js +8 -0
- package/dist/domains/comet-native/native-types.js.map +1 -0
- package/dist/domains/comet-native/native-verification-evidence.d.ts +136 -0
- package/dist/domains/comet-native/native-verification-evidence.d.ts.map +1 -0
- package/dist/domains/comet-native/native-verification-evidence.js +824 -0
- package/dist/domains/comet-native/native-verification-evidence.js.map +1 -0
- package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts +188 -0
- package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts.map +1 -0
- package/dist/domains/comet-native/native-verification-receipt-runtime.js +1129 -0
- package/dist/domains/comet-native/native-verification-receipt-runtime.js.map +1 -0
- package/dist/domains/comet-native/native-verification-receipt.d.ts +165 -0
- package/dist/domains/comet-native/native-verification-receipt.d.ts.map +1 -0
- package/dist/domains/comet-native/native-verification-receipt.js +636 -0
- package/dist/domains/comet-native/native-verification-receipt.js.map +1 -0
- package/dist/domains/comet-native/native-verification-runtime.d.ts +61 -0
- package/dist/domains/comet-native/native-verification-runtime.d.ts.map +1 -0
- package/dist/domains/comet-native/native-verification-runtime.js +609 -0
- package/dist/domains/comet-native/native-verification-runtime.js.map +1 -0
- package/dist/domains/comet-native/native-verification-scope.d.ts +118 -0
- package/dist/domains/comet-native/native-verification-scope.d.ts.map +1 -0
- package/dist/domains/comet-native/native-verification-scope.js +1045 -0
- package/dist/domains/comet-native/native-verification-scope.js.map +1 -0
- package/dist/domains/comet-native/native-workspace.d.ts +46 -0
- package/dist/domains/comet-native/native-workspace.d.ts.map +1 -0
- package/dist/domains/comet-native/native-workspace.js +276 -0
- package/dist/domains/comet-native/native-workspace.js.map +1 -0
- package/dist/domains/dashboard/collector.d.ts +12 -0
- package/dist/domains/dashboard/collector.d.ts.map +1 -0
- package/dist/domains/dashboard/collector.js +582 -0
- package/dist/domains/dashboard/collector.js.map +1 -0
- package/dist/domains/dashboard/git.d.ts +8 -0
- package/dist/domains/dashboard/git.d.ts.map +1 -0
- package/dist/domains/dashboard/git.js +69 -0
- package/dist/domains/dashboard/git.js.map +1 -0
- package/dist/domains/dashboard/native-adapter.d.ts +157 -0
- package/dist/domains/dashboard/native-adapter.d.ts.map +1 -0
- package/dist/domains/dashboard/native-adapter.js +302 -0
- package/dist/domains/dashboard/native-adapter.js.map +1 -0
- package/dist/domains/dashboard/native-collector.d.ts +6 -0
- package/dist/domains/dashboard/native-collector.d.ts.map +1 -0
- package/dist/domains/dashboard/native-collector.js +289 -0
- package/dist/domains/dashboard/native-collector.js.map +1 -0
- package/dist/domains/dashboard/next-action.d.ts +17 -0
- package/dist/domains/dashboard/next-action.d.ts.map +1 -0
- package/dist/domains/dashboard/next-action.js +83 -0
- package/dist/domains/dashboard/next-action.js.map +1 -0
- package/dist/domains/dashboard/open-browser.d.ts +9 -0
- package/dist/domains/dashboard/open-browser.d.ts.map +1 -0
- package/dist/domains/dashboard/open-browser.js +40 -0
- package/dist/domains/dashboard/open-browser.js.map +1 -0
- package/dist/domains/dashboard/risk.d.ts +24 -0
- package/dist/domains/dashboard/risk.d.ts.map +1 -0
- package/dist/domains/dashboard/risk.js +97 -0
- package/dist/domains/dashboard/risk.js.map +1 -0
- package/dist/domains/dashboard/server.d.ts +21 -0
- package/dist/domains/dashboard/server.d.ts.map +1 -0
- package/dist/domains/dashboard/server.js +149 -0
- package/dist/domains/dashboard/server.js.map +1 -0
- package/dist/domains/dashboard/task-parser.d.ts +13 -0
- package/dist/domains/dashboard/task-parser.d.ts.map +1 -0
- package/dist/domains/dashboard/task-parser.js +82 -0
- package/dist/domains/dashboard/task-parser.js.map +1 -0
- package/dist/domains/dashboard/types.d.ts +132 -0
- package/dist/domains/dashboard/types.d.ts.map +1 -0
- package/dist/domains/dashboard/types.js +10 -0
- package/dist/domains/dashboard/types.js.map +1 -0
- package/dist/domains/dashboard/verify-parser.d.ts +18 -0
- package/dist/domains/dashboard/verify-parser.d.ts.map +1 -0
- package/dist/domains/dashboard/verify-parser.js +100 -0
- package/dist/domains/dashboard/verify-parser.js.map +1 -0
- package/dist/domains/dashboard/web/assets/_commonjsHelpers-CqkleIqs.js +1 -0
- package/dist/domains/dashboard/web/assets/arc-BXWNV2Qv.js +1 -0
- package/dist/domains/dashboard/web/assets/architectureDiagram-3BPJPVTR-CjVHPivo.js +36 -0
- package/dist/domains/dashboard/web/assets/blockDiagram-GPEHLZMM-P2PGImSM.js +132 -0
- package/dist/domains/dashboard/web/assets/c4Diagram-AAUBKEIU-fTj6Xhs1.js +10 -0
- package/dist/domains/dashboard/web/assets/channel--JtnhJr8.js +1 -0
- package/dist/domains/dashboard/web/assets/chunk-2J33WTMH-BjFDZ5yo.js +1 -0
- package/dist/domains/dashboard/web/assets/chunk-4BX2VUAB-BAUkbZdT.js +1 -0
- package/dist/domains/dashboard/web/assets/chunk-55IACEB6-DBmuiYme.js +1 -0
- package/dist/domains/dashboard/web/assets/chunk-727SXJPM-Do9ufCgY.js +206 -0
- package/dist/domains/dashboard/web/assets/chunk-AQP2D5EJ-qRQWlB5d.js +231 -0
- package/dist/domains/dashboard/web/assets/chunk-FMBD7UC4-BzDzeJ4_.js +15 -0
- package/dist/domains/dashboard/web/assets/chunk-ND2GUHAM-OQcAmIvL.js +1 -0
- package/dist/domains/dashboard/web/assets/chunk-QZHKN3VN-BiRfH4d2.js +1 -0
- package/dist/domains/dashboard/web/assets/classDiagram-4FO5ZUOK-BRGmx8Iz.js +1 -0
- package/dist/domains/dashboard/web/assets/classDiagram-v2-Q7XG4LA2-BRGmx8Iz.js +1 -0
- package/dist/domains/dashboard/web/assets/cose-bilkent-S5V4N54A-CZk37fGn.js +1 -0
- package/dist/domains/dashboard/web/assets/cynefin-VYW2F7L2-B3F-qRTJ.js +166 -0
- package/dist/domains/dashboard/web/assets/cytoscape.esm-D3_iZ_3b.js +321 -0
- package/dist/domains/dashboard/web/assets/dagre-BM42HDAG-D5BQ0eqN.js +4 -0
- package/dist/domains/dashboard/web/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/domains/dashboard/web/assets/demo-BuVau32v.js +25 -0
- package/dist/domains/dashboard/web/assets/diagram-2AECGRRQ-33mXstha.js +43 -0
- package/dist/domains/dashboard/web/assets/diagram-5GNKFQAL-BWHCMFvD.js +10 -0
- package/dist/domains/dashboard/web/assets/diagram-KO2AKTUF-DrPGimEt.js +3 -0
- package/dist/domains/dashboard/web/assets/diagram-LMA3HP47-BBlsg7jG.js +24 -0
- package/dist/domains/dashboard/web/assets/diagram-OG6HWLK6-CsaFSpHi.js +24 -0
- package/dist/domains/dashboard/web/assets/erDiagram-TEJ5UH35-CoB0mzhk.js +85 -0
- package/dist/domains/dashboard/web/assets/flowDiagram-I6XJVG4X-lT53XfSE.js +162 -0
- package/dist/domains/dashboard/web/assets/ganttDiagram-6RSMTGT7-D1SQ56fl.js +292 -0
- package/dist/domains/dashboard/web/assets/gitGraphDiagram-PVQCEYII-D4oDMS5x.js +106 -0
- package/dist/domains/dashboard/web/assets/graph--OzhPTMs.js +1 -0
- package/dist/domains/dashboard/web/assets/index-D-AGxvI4.css +1 -0
- package/dist/domains/dashboard/web/assets/index-DlSYK56b.js +139 -0
- package/dist/domains/dashboard/web/assets/index-Msce_H_q.js +24 -0
- package/dist/domains/dashboard/web/assets/index-QO0z6F4w.js +10 -0
- package/dist/domains/dashboard/web/assets/infoDiagram-5YYISTIA-BeICn98s.js +2 -0
- package/dist/domains/dashboard/web/assets/init-Gi6I4Gst.js +1 -0
- package/dist/domains/dashboard/web/assets/ishikawaDiagram-YF4QCWOH-Dkspu33d.js +70 -0
- package/dist/domains/dashboard/web/assets/journeyDiagram-JHISSGLW-C-EM1sZl.js +139 -0
- package/dist/domains/dashboard/web/assets/kanban-definition-UN3LZRKU-BTbB0IO2.js +89 -0
- package/dist/domains/dashboard/web/assets/katex-HP8lGamR.js +257 -0
- package/dist/domains/dashboard/web/assets/layout-SsrduOYp.js +1 -0
- package/dist/domains/dashboard/web/assets/linear-Cp0UrqDr.js +1 -0
- package/dist/domains/dashboard/web/assets/marked.esm-DECB3bxB.js +64 -0
- package/dist/domains/dashboard/web/assets/mermaid.core-CucmqsLW.js +301 -0
- package/dist/domains/dashboard/web/assets/mindmap-definition-RKZ34NQL-CjEshF1X.js +96 -0
- package/dist/domains/dashboard/web/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/domains/dashboard/web/assets/pieDiagram-4H26LBE5-DrwFnX1b.js +30 -0
- package/dist/domains/dashboard/web/assets/purify.es-VaSPOPhr.js +3 -0
- package/dist/domains/dashboard/web/assets/quadrantDiagram-W4KKPZXB-CjG6pBR2.js +7 -0
- package/dist/domains/dashboard/web/assets/requirementDiagram-4Y6WPE33-BpUQVqCV.js +84 -0
- package/dist/domains/dashboard/web/assets/sankeyDiagram-5OEKKPKP-BeGkEvzR.js +40 -0
- package/dist/domains/dashboard/web/assets/sequenceDiagram-3UESZ5HK-sSTU3MCO.js +162 -0
- package/dist/domains/dashboard/web/assets/stateDiagram-AJRCARHV-CcFBc6qh.js +1 -0
- package/dist/domains/dashboard/web/assets/stateDiagram-v2-BHNVJYJU-D5zZYi4x.js +1 -0
- package/dist/domains/dashboard/web/assets/timeline-definition-PNZ67QCA-DCN7NjEs.js +120 -0
- package/dist/domains/dashboard/web/assets/vennDiagram-CIIHVFJN-DZAN1_rr.js +34 -0
- package/dist/domains/dashboard/web/assets/wardleyDiagram-YWT4CUSO-FfkJfr4C.js +78 -0
- package/dist/domains/dashboard/web/assets/xychartDiagram-2RQKCTM6-CD8B-EmR.js +7 -0
- package/dist/domains/dashboard/web/favicon.png +0 -0
- package/dist/domains/dashboard/web/index.html +16 -0
- package/dist/domains/dashboard/yaml.d.ts +13 -0
- package/dist/domains/dashboard/yaml.d.ts.map +1 -0
- package/dist/domains/dashboard/yaml.js +61 -0
- package/dist/domains/dashboard/yaml.js.map +1 -0
- package/dist/domains/engine/evals.d.ts +4 -0
- package/dist/domains/engine/evals.d.ts.map +1 -0
- package/dist/domains/engine/evals.js +25 -0
- package/dist/domains/engine/evals.js.map +1 -0
- package/dist/domains/engine/guardrails.d.ts +10 -0
- package/dist/domains/engine/guardrails.d.ts.map +1 -0
- package/dist/domains/engine/guardrails.js +25 -0
- package/dist/domains/engine/guardrails.js.map +1 -0
- package/dist/domains/engine/loop.d.ts +15 -0
- package/dist/domains/engine/loop.d.ts.map +1 -0
- package/dist/domains/engine/loop.js +126 -0
- package/dist/domains/engine/loop.js.map +1 -0
- package/dist/domains/engine/manual-run.d.ts +30 -0
- package/dist/domains/engine/manual-run.d.ts.map +1 -0
- package/dist/domains/engine/manual-run.js +184 -0
- package/dist/domains/engine/manual-run.js.map +1 -0
- package/dist/domains/engine/protected-run-file.d.ts +15 -0
- package/dist/domains/engine/protected-run-file.d.ts.map +1 -0
- package/dist/domains/engine/protected-run-file.js +76 -0
- package/dist/domains/engine/protected-run-file.js.map +1 -0
- package/dist/domains/engine/resolver.d.ts +20 -0
- package/dist/domains/engine/resolver.d.ts.map +1 -0
- package/dist/domains/engine/resolver.js +36 -0
- package/dist/domains/engine/resolver.js.map +1 -0
- package/dist/domains/engine/run-store.d.ts +14 -0
- package/dist/domains/engine/run-store.d.ts.map +1 -0
- package/dist/domains/engine/run-store.js +81 -0
- package/dist/domains/engine/run-store.js.map +1 -0
- package/dist/domains/engine/runtime-types.d.ts +11 -0
- package/dist/domains/engine/runtime-types.d.ts.map +1 -0
- package/dist/domains/engine/runtime-types.js +2 -0
- package/dist/domains/engine/runtime-types.js.map +1 -0
- package/dist/domains/engine/standalone-run.d.ts +13 -0
- package/dist/domains/engine/standalone-run.d.ts.map +1 -0
- package/dist/domains/engine/standalone-run.js +27 -0
- package/dist/domains/engine/standalone-run.js.map +1 -0
- package/dist/domains/engine/state.d.ts +11 -0
- package/dist/domains/engine/state.d.ts.map +1 -0
- package/dist/domains/engine/state.js +149 -0
- package/dist/domains/engine/state.js.map +1 -0
- package/dist/domains/engine/storage-layout.d.ts +14 -0
- package/dist/domains/engine/storage-layout.d.ts.map +1 -0
- package/dist/domains/engine/storage-layout.js +32 -0
- package/dist/domains/engine/storage-layout.js.map +1 -0
- package/dist/domains/engine/storage-run.d.ts +9 -0
- package/dist/domains/engine/storage-run.d.ts.map +1 -0
- package/dist/domains/engine/storage-run.js +116 -0
- package/dist/domains/engine/storage-run.js.map +1 -0
- package/dist/domains/engine/types.d.ts +51 -0
- package/dist/domains/engine/types.d.ts.map +1 -0
- package/dist/domains/engine/types.js +2 -0
- package/dist/domains/engine/types.js.map +1 -0
- package/dist/domains/eval/index.d.ts +7 -0
- package/dist/domains/eval/index.d.ts.map +1 -0
- package/dist/domains/eval/index.js +11 -0
- package/dist/domains/eval/index.js.map +1 -0
- package/dist/domains/eval/repository-benchmarks.d.ts +6 -0
- package/dist/domains/eval/repository-benchmarks.d.ts.map +1 -0
- package/dist/domains/eval/repository-benchmarks.js +10 -0
- package/dist/domains/eval/repository-benchmarks.js.map +1 -0
- package/dist/domains/factory/artifacts.d.ts +53 -0
- package/dist/domains/factory/artifacts.d.ts.map +1 -0
- package/dist/domains/factory/artifacts.js +8 -0
- package/dist/domains/factory/artifacts.js.map +1 -0
- package/dist/domains/factory/package.d.ts +7 -0
- package/dist/domains/factory/package.d.ts.map +1 -0
- package/dist/domains/factory/package.js +1982 -0
- package/dist/domains/factory/package.js.map +1 -0
- package/dist/domains/factory/types.d.ts +127 -0
- package/dist/domains/factory/types.d.ts.map +1 -0
- package/dist/domains/factory/types.js +2 -0
- package/dist/domains/factory/types.js.map +1 -0
- package/dist/domains/integrations/codegraph.d.ts +17 -0
- package/dist/domains/integrations/codegraph.d.ts.map +1 -0
- package/dist/domains/integrations/codegraph.js +266 -0
- package/dist/domains/integrations/codegraph.js.map +1 -0
- package/dist/domains/integrations/openspec.d.ts +28 -0
- package/dist/domains/integrations/openspec.d.ts.map +1 -0
- package/dist/domains/integrations/openspec.js +557 -0
- package/dist/domains/integrations/openspec.js.map +1 -0
- package/dist/{core → domains/integrations}/superpowers.d.ts +10 -2
- package/dist/domains/integrations/superpowers.d.ts.map +1 -0
- package/dist/{core → domains/integrations}/superpowers.js +59 -13
- package/dist/domains/integrations/superpowers.js.map +1 -0
- package/dist/domains/skill/discovery.d.ts +17 -0
- package/dist/domains/skill/discovery.d.ts.map +1 -0
- package/dist/domains/skill/discovery.js +80 -0
- package/dist/domains/skill/discovery.js.map +1 -0
- package/dist/domains/skill/find.d.ts +41 -0
- package/dist/domains/skill/find.d.ts.map +1 -0
- package/dist/domains/skill/find.js +252 -0
- package/dist/domains/skill/find.js.map +1 -0
- package/dist/domains/skill/install.d.ts +11 -0
- package/dist/domains/skill/install.d.ts.map +1 -0
- package/dist/domains/skill/install.js +82 -0
- package/dist/domains/skill/install.js.map +1 -0
- package/dist/domains/skill/inventory.d.ts +19 -0
- package/dist/domains/skill/inventory.d.ts.map +1 -0
- package/dist/domains/skill/inventory.js +64 -0
- package/dist/domains/skill/inventory.js.map +1 -0
- package/dist/domains/skill/json-object.d.ts +13 -0
- package/dist/domains/skill/json-object.d.ts.map +1 -0
- package/dist/domains/skill/json-object.js +24 -0
- package/dist/domains/skill/json-object.js.map +1 -0
- package/dist/domains/skill/languages.d.ts +20 -0
- package/dist/domains/skill/languages.d.ts.map +1 -0
- package/dist/domains/skill/languages.js +24 -0
- package/dist/domains/skill/languages.js.map +1 -0
- package/dist/domains/skill/load.d.ts +5 -0
- package/dist/domains/skill/load.d.ts.map +1 -0
- package/dist/domains/skill/load.js +313 -0
- package/dist/domains/skill/load.js.map +1 -0
- package/dist/domains/skill/managed-markdown.d.ts +14 -0
- package/dist/domains/skill/managed-markdown.d.ts.map +1 -0
- package/dist/domains/skill/managed-markdown.js +126 -0
- package/dist/domains/skill/managed-markdown.js.map +1 -0
- package/dist/domains/skill/platform-inspect.d.ts +13 -0
- package/dist/domains/skill/platform-inspect.d.ts.map +1 -0
- package/dist/domains/skill/platform-inspect.js +193 -0
- package/dist/domains/skill/platform-inspect.js.map +1 -0
- package/dist/domains/skill/platform-install.d.ts +102 -0
- package/dist/domains/skill/platform-install.d.ts.map +1 -0
- package/dist/domains/skill/platform-install.js +1333 -0
- package/dist/domains/skill/platform-install.js.map +1 -0
- package/dist/domains/skill/preferences.d.ts +42 -0
- package/dist/domains/skill/preferences.d.ts.map +1 -0
- package/dist/domains/skill/preferences.js +118 -0
- package/dist/domains/skill/preferences.js.map +1 -0
- package/dist/domains/skill/project-instructions.d.ts +22 -0
- package/dist/domains/skill/project-instructions.d.ts.map +1 -0
- package/dist/domains/skill/project-instructions.js +69 -0
- package/dist/domains/skill/project-instructions.js.map +1 -0
- package/dist/domains/skill/snapshot.d.ts +8 -0
- package/dist/domains/skill/snapshot.d.ts.map +1 -0
- package/dist/domains/skill/snapshot.js +184 -0
- package/dist/domains/skill/snapshot.js.map +1 -0
- package/dist/domains/skill/types.d.ts +85 -0
- package/dist/domains/skill/types.d.ts.map +1 -0
- package/dist/domains/skill/types.js +2 -0
- package/dist/{core → domains/skill}/types.js.map +1 -1
- package/dist/domains/skill/uninstall.d.ts +19 -0
- package/dist/domains/skill/uninstall.d.ts.map +1 -0
- package/dist/domains/skill/uninstall.js +946 -0
- package/dist/domains/skill/uninstall.js.map +1 -0
- package/dist/domains/skill/validate.d.ts +3 -0
- package/dist/domains/skill/validate.d.ts.map +1 -0
- package/dist/domains/skill/validate.js +81 -0
- package/dist/domains/skill/validate.js.map +1 -0
- package/dist/domains/workflow-contract/builtins.d.ts +14 -0
- package/dist/domains/workflow-contract/builtins.d.ts.map +1 -0
- package/dist/domains/workflow-contract/builtins.js +372 -0
- package/dist/domains/workflow-contract/builtins.js.map +1 -0
- package/dist/domains/workflow-contract/contained-atomic-write.d.ts +21 -0
- package/dist/domains/workflow-contract/contained-atomic-write.d.ts.map +1 -0
- package/dist/domains/workflow-contract/contained-atomic-write.js +235 -0
- package/dist/domains/workflow-contract/contained-atomic-write.js.map +1 -0
- package/dist/domains/workflow-contract/hash.d.ts +3 -0
- package/dist/domains/workflow-contract/hash.d.ts.map +1 -0
- package/dist/domains/workflow-contract/hash.js +16 -0
- package/dist/domains/workflow-contract/hash.js.map +1 -0
- package/dist/domains/workflow-contract/index.d.ts +16 -0
- package/dist/domains/workflow-contract/index.d.ts.map +1 -0
- package/dist/domains/workflow-contract/index.js +11 -0
- package/dist/domains/workflow-contract/index.js.map +1 -0
- package/dist/domains/workflow-contract/normalize.d.ts +3 -0
- package/dist/domains/workflow-contract/normalize.d.ts.map +1 -0
- package/dist/domains/workflow-contract/normalize.js +165 -0
- package/dist/domains/workflow-contract/normalize.js.map +1 -0
- package/dist/domains/workflow-contract/project-config-reader.d.ts +24 -0
- package/dist/domains/workflow-contract/project-config-reader.d.ts.map +1 -0
- package/dist/domains/workflow-contract/project-config-reader.js +54 -0
- package/dist/domains/workflow-contract/project-config-reader.js.map +1 -0
- package/dist/domains/workflow-contract/project-config-transaction.d.ts +20 -0
- package/dist/domains/workflow-contract/project-config-transaction.d.ts.map +1 -0
- package/dist/domains/workflow-contract/project-config-transaction.js +293 -0
- package/dist/domains/workflow-contract/project-config-transaction.js.map +1 -0
- package/dist/domains/workflow-contract/project-config-writer.d.ts +13 -0
- package/dist/domains/workflow-contract/project-config-writer.d.ts.map +1 -0
- package/dist/domains/workflow-contract/project-config-writer.js +142 -0
- package/dist/domains/workflow-contract/project-config-writer.js.map +1 -0
- package/dist/domains/workflow-contract/project-config.d.ts +32 -0
- package/dist/domains/workflow-contract/project-config.d.ts.map +1 -0
- package/dist/domains/workflow-contract/project-config.js +1566 -0
- package/dist/domains/workflow-contract/project-config.js.map +1 -0
- package/dist/domains/workflow-contract/protected-project-path.d.ts +34 -0
- package/dist/domains/workflow-contract/protected-project-path.d.ts.map +1 -0
- package/dist/domains/workflow-contract/protected-project-path.js +162 -0
- package/dist/domains/workflow-contract/protected-project-path.js.map +1 -0
- package/dist/domains/workflow-contract/types.d.ts +193 -0
- package/dist/domains/workflow-contract/types.d.ts.map +1 -0
- package/dist/domains/workflow-contract/types.js +2 -0
- package/dist/domains/workflow-contract/types.js.map +1 -0
- package/dist/domains/workflow-contract/validation.d.ts +3 -0
- package/dist/domains/workflow-contract/validation.d.ts.map +1 -0
- package/dist/domains/workflow-contract/validation.js +189 -0
- package/dist/domains/workflow-contract/validation.js.map +1 -0
- package/dist/platform/fs/file-identity.d.ts +9 -0
- package/dist/platform/fs/file-identity.d.ts.map +1 -0
- package/dist/platform/fs/file-identity.js +21 -0
- package/dist/platform/fs/file-identity.js.map +1 -0
- package/dist/{utils → platform/fs}/file-system.d.ts +3 -3
- package/dist/platform/fs/file-system.d.ts.map +1 -0
- package/dist/{utils → platform/fs}/file-system.js +31 -17
- package/dist/platform/fs/file-system.js.map +1 -0
- package/dist/platform/fs/race-safe-read.d.ts +47 -0
- package/dist/platform/fs/race-safe-read.d.ts.map +1 -0
- package/dist/platform/fs/race-safe-read.js +132 -0
- package/dist/platform/fs/race-safe-read.js.map +1 -0
- package/dist/platform/fs/trusted-readonly-file.d.ts +31 -0
- package/dist/platform/fs/trusted-readonly-file.d.ts.map +1 -0
- package/dist/platform/fs/trusted-readonly-file.js +107 -0
- package/dist/platform/fs/trusted-readonly-file.js.map +1 -0
- package/dist/{core → platform/install}/detect.d.ts +5 -2
- package/dist/platform/install/detect.d.ts.map +1 -0
- package/dist/{core → platform/install}/detect.js +18 -5
- package/dist/platform/install/detect.js.map +1 -0
- package/dist/platform/install/platform-targets.d.ts +8 -0
- package/dist/platform/install/platform-targets.d.ts.map +1 -0
- package/dist/platform/install/platform-targets.js +31 -0
- package/dist/platform/install/platform-targets.js.map +1 -0
- package/dist/{core → platform/install}/platforms.d.ts +10 -1
- package/dist/platform/install/platforms.d.ts.map +1 -0
- package/dist/{core → platform/install}/platforms.js +68 -4
- package/dist/platform/install/platforms.js.map +1 -0
- package/dist/platform/install/project-registry.d.ts +38 -0
- package/dist/platform/install/project-registry.d.ts.map +1 -0
- package/dist/platform/install/project-registry.js +213 -0
- package/dist/platform/install/project-registry.js.map +1 -0
- package/dist/platform/install/skill-root-owner.d.ts +15 -0
- package/dist/platform/install/skill-root-owner.d.ts.map +1 -0
- package/dist/platform/install/skill-root-owner.js +68 -0
- package/dist/platform/install/skill-root-owner.js.map +1 -0
- package/dist/platform/install/types.d.ts +3 -0
- package/dist/platform/install/types.d.ts.map +1 -0
- package/dist/platform/install/types.js +2 -0
- package/dist/platform/install/types.js.map +1 -0
- package/dist/platform/paths/git-worktree.d.ts +10 -0
- package/dist/platform/paths/git-worktree.d.ts.map +1 -0
- package/dist/platform/paths/git-worktree.js +43 -0
- package/dist/platform/paths/git-worktree.js.map +1 -0
- package/dist/platform/paths/repository-layout.d.ts +38 -0
- package/dist/platform/paths/repository-layout.d.ts.map +1 -0
- package/dist/platform/paths/repository-layout.js +11 -0
- package/dist/platform/paths/repository-layout.js.map +1 -0
- package/dist/platform/process/command-error.d.ts.map +1 -0
- package/dist/platform/process/command-error.js.map +1 -0
- package/dist/platform/process/shell-quote.d.ts +22 -0
- package/dist/platform/process/shell-quote.d.ts.map +1 -0
- package/dist/platform/process/shell-quote.js +34 -0
- package/dist/platform/process/shell-quote.js.map +1 -0
- package/dist/platform/process/terminate-process-tree.d.ts +3 -0
- package/dist/platform/process/terminate-process-tree.d.ts.map +1 -0
- package/dist/platform/process/terminate-process-tree.js +65 -0
- package/dist/platform/process/terminate-process-tree.js.map +1 -0
- package/dist/platform/version/version.d.ts.map +1 -0
- package/dist/{core → platform/version}/version.js +16 -3
- package/dist/platform/version/version.js.map +1 -0
- package/eval/CLAUDE.md +43 -0
- package/eval/README.md +538 -0
- package/eval/langsmith/README.md +93 -0
- package/eval/langsmith/skills/README.md +5 -0
- package/eval/langsmith/tasks/README.md +5 -0
- package/eval/langsmith/tests/conftest.py +187 -0
- package/eval/langsmith/tests/tasks/test_tasks.py +287 -0
- package/eval/langsmith/treatments/README.md +5 -0
- package/eval/local/README.md +130 -0
- package/eval/local/regression_baseline.json +13 -0
- package/eval/local/report-style-demo-assets/quality_cost.en.svg +41 -0
- package/eval/local/report-style-demo-assets/quality_cost.zh.svg +41 -0
- package/eval/local/report-style-demo-assets/rubric_delta.en.svg +56 -0
- package/eval/local/report-style-demo-assets/rubric_delta.zh.svg +56 -0
- package/eval/local/report-style-demo-assets/task_outcomes.en.svg +46 -0
- package/eval/local/report-style-demo-assets/task_outcomes.zh.svg +46 -0
- package/eval/local/report-style-demo.html +867 -0
- package/eval/local/scripts/compare_baselines.py +1144 -0
- package/eval/local/scripts/generate_report_style_demo_charts.py +322 -0
- package/eval/local/scripts/regression_check.py +170 -0
- package/eval/local/scripts/render_readme_benchmark_figures.py +416 -0
- package/eval/local/scripts/rescore_rubric.py +120 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/SKILL.md +282 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/reference/auto-transition.md +27 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/reference/comet-yaml-fields.md +68 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/reference/context-recovery.md +35 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/reference/debug-gate.md +17 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/reference/decision-point.md +20 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/reference/dirty-worktree.md +59 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/reference/file-structure.md +28 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/reference/subagent-dispatch.md +113 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039/rules/comet-phase-guard.md +125 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039-archive/SKILL.md +100 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039-build/SKILL.md +304 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039-design/SKILL.md +263 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039-hotfix/SKILL.md +204 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039-open/SKILL.md +220 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039-tweak/SKILL.md +180 -0
- package/eval/local/skills/benchmarks/039-release/comet-classic-039-verify/SKILL.md +234 -0
- package/eval/local/skills/benchmarks/040-beta/comet/SKILL.md +261 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/auto-transition.md +27 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/comet-yaml-fields.md +73 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/context-recovery.md +45 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/debug-gate.md +33 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/decision-point.md +31 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/dirty-worktree.md +59 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/file-structure.md +28 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/intent-frame.md +74 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/scripts.md +69 -0
- package/eval/local/skills/benchmarks/040-beta/comet/reference/subagent-dispatch.md +169 -0
- package/eval/local/skills/benchmarks/040-beta/comet/rules/comet-phase-guard.md +130 -0
- package/eval/local/skills/benchmarks/040-beta/comet/runtime/classic/checks.yaml +6 -0
- package/eval/local/skills/benchmarks/040-beta/comet/runtime/classic/guardrails.yaml +13 -0
- package/eval/local/skills/benchmarks/040-beta/comet/runtime/classic/skill.yaml +122 -0
- package/eval/local/skills/benchmarks/040-beta/comet/scripts/comet-archive.mjs +9515 -0
- package/eval/local/skills/benchmarks/040-beta/comet/scripts/comet-env.mjs +15 -0
- package/eval/local/skills/benchmarks/040-beta/comet/scripts/comet-guard.mjs +10173 -0
- package/eval/local/skills/benchmarks/040-beta/comet/scripts/comet-handoff.mjs +9491 -0
- package/eval/local/skills/benchmarks/040-beta/comet/scripts/comet-hook-guard.mjs +9175 -0
- package/eval/local/skills/benchmarks/040-beta/comet/scripts/comet-intent.mjs +404 -0
- package/eval/local/skills/benchmarks/040-beta/comet/scripts/comet-state.mjs +9273 -0
- package/eval/local/skills/benchmarks/040-beta/comet/scripts/comet-yaml-validate.mjs +7627 -0
- package/eval/local/skills/benchmarks/040-beta/comet-archive/SKILL.md +110 -0
- package/eval/local/skills/benchmarks/040-beta/comet-build/SKILL.md +315 -0
- package/eval/local/skills/benchmarks/040-beta/comet-design/SKILL.md +260 -0
- package/eval/local/skills/benchmarks/040-beta/comet-hotfix/SKILL.md +190 -0
- package/eval/local/skills/benchmarks/040-beta/comet-open/SKILL.md +210 -0
- package/eval/local/skills/benchmarks/040-beta/comet-tweak/SKILL.md +183 -0
- package/eval/local/skills/benchmarks/040-beta/comet-verify/SKILL.md +230 -0
- package/eval/local/skills/benchmarks/dependency/claude-md/comet-workflow/CLAUDE.md +12 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-apply-change/SKILL.md +156 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-archive-change/SKILL.md +114 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-bulk-archive-change/SKILL.md +246 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-continue-change/SKILL.md +118 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-explore/SKILL.md +288 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-ff-change/SKILL.md +101 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-new-change/SKILL.md +74 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-onboard/SKILL.md +554 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-propose/SKILL.md +110 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-sync-specs/SKILL.md +138 -0
- package/eval/local/skills/benchmarks/dependency/openspec/openspec-verify-change/SKILL.md +168 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/brainstorming/SKILL.md +159 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/brainstorming/scripts/frame-template.html +213 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/brainstorming/scripts/helper.js +167 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/brainstorming/scripts/server.cjs +723 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/brainstorming/scripts/start-server.sh +209 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/brainstorming/scripts/stop-server.sh +120 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/brainstorming/visual-companion.md +291 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/dispatching-parallel-agents/SKILL.md +185 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/executing-plans/SKILL.md +70 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/finishing-a-development-branch/SKILL.md +241 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/receiving-code-review/SKILL.md +213 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/requesting-code-review/SKILL.md +103 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/requesting-code-review/code-reviewer.md +172 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/subagent-driven-development/SKILL.md +418 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/subagent-driven-development/implementer-prompt.md +139 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/subagent-driven-development/scripts/review-package +44 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/subagent-driven-development/scripts/sdd-workspace +22 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/subagent-driven-development/scripts/task-brief +40 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/subagent-driven-development/task-reviewer-prompt.md +188 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/CREATION-LOG.md +119 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/SKILL.md +296 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/condition-based-waiting.md +115 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/defense-in-depth.md +122 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/find-polluter.sh +63 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/root-cause-tracing.md +169 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/test-academic.md +14 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/test-pressure-1.md +58 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/test-pressure-2.md +68 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/systematic-debugging/test-pressure-3.md +69 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/test-driven-development/SKILL.md +371 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/test-driven-development/testing-anti-patterns.md +299 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/using-git-worktrees/SKILL.md +202 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/verification-before-completion/SKILL.md +139 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-plans/SKILL.md +174 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-skills/SKILL.md +689 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-skills/anthropic-best-practices.md +1150 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-skills/graphviz-conventions.dot +172 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-skills/persuasion-principles.md +187 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-skills/render-graphs.js +168 -0
- package/eval/local/skills/benchmarks/dependency/superpowers/writing-skills/testing-skills-with-subagents.md +384 -0
- package/eval/local/tasks/authoring-skill-smoke/environment/Dockerfile +14 -0
- package/eval/local/tasks/authoring-skill-smoke/instruction.md +4 -0
- package/eval/local/tasks/authoring-skill-smoke/task.toml +21 -0
- package/eval/local/tasks/authoring-skill-smoke/validation/test_authoring_skill_smoke.py +54 -0
- package/eval/local/tasks/comet-agent-memory-routing/environment/Dockerfile +26 -0
- package/eval/local/tasks/comet-agent-memory-routing/environment/agent_system.py +40 -0
- package/eval/local/tasks/comet-agent-memory-routing/environment/test_agent_system.py +29 -0
- package/eval/local/tasks/comet-agent-memory-routing/instruction.md +20 -0
- package/eval/local/tasks/comet-agent-memory-routing/task.toml +24 -0
- package/eval/local/tasks/comet-agent-memory-routing/validation/test_agent_memory_routing.py +24 -0
- package/eval/local/tasks/comet-api-cache-ttl/environment/Dockerfile +35 -0
- package/eval/local/tasks/comet-api-cache-ttl/environment/cache.py +39 -0
- package/eval/local/tasks/comet-api-cache-ttl/environment/test_cache.py +81 -0
- package/eval/local/tasks/comet-api-cache-ttl/instruction.md +33 -0
- package/eval/local/tasks/comet-api-cache-ttl/task.toml +24 -0
- package/eval/local/tasks/comet-api-cache-ttl/validation/test_api_cache_ttl.py +58 -0
- package/eval/local/tasks/comet-classic-layout-lifecycle/environment/.include-current-comet-cli +1 -0
- package/eval/local/tasks/comet-classic-layout-lifecycle/environment/Dockerfile +45 -0
- package/eval/local/tasks/comet-classic-layout-lifecycle/environment/current-comet-package.json +18 -0
- package/eval/local/tasks/comet-classic-layout-lifecycle/environment/current-comet.sh +14 -0
- package/eval/local/tasks/comet-classic-layout-lifecycle/environment/test_wordcount.py +29 -0
- package/eval/local/tasks/comet-classic-layout-lifecycle/environment/wordcount.py +40 -0
- package/eval/local/tasks/comet-classic-layout-lifecycle/instruction.md +18 -0
- package/eval/local/tasks/comet-classic-layout-lifecycle/task.toml +23 -0
- package/eval/local/tasks/comet-classic-layout-lifecycle/validation/test_classic_layout_lifecycle.py +604 -0
- package/eval/local/tasks/comet-cross-file-refactor/environment/Dockerfile +15 -0
- package/eval/local/tasks/comet-cross-file-refactor/environment/cli.py +13 -0
- package/eval/local/tasks/comet-cross-file-refactor/environment/counting.py +13 -0
- package/eval/local/tasks/comet-cross-file-refactor/environment/test_textkit.py +21 -0
- package/eval/local/tasks/comet-cross-file-refactor/instruction.md +16 -0
- package/eval/local/tasks/comet-cross-file-refactor/task.toml +20 -0
- package/eval/local/tasks/comet-cross-file-refactor/validation/test_cross_file_refactor.py +20 -0
- package/eval/local/tasks/comet-dependency-confusion/environment/Dockerfile +25 -0
- package/eval/local/tasks/comet-dependency-confusion/environment/app.py +8 -0
- package/eval/local/tasks/comet-dependency-confusion/environment/settings_loader.py +14 -0
- package/eval/local/tasks/comet-dependency-confusion/environment/test_settings_service.py +19 -0
- package/eval/local/tasks/comet-dependency-confusion/instruction.md +18 -0
- package/eval/local/tasks/comet-dependency-confusion/task.toml +24 -0
- package/eval/local/tasks/comet-dependency-confusion/validation/test_dependency_confusion.py +24 -0
- package/eval/local/tasks/comet-fix-median/environment/Dockerfile +46 -0
- package/eval/local/tasks/comet-fix-median/environment/stats.py +54 -0
- package/eval/local/tasks/comet-fix-median/environment/test_stats.py +68 -0
- package/eval/local/tasks/comet-fix-median/instruction.md +25 -0
- package/eval/local/tasks/comet-fix-median/task.toml +24 -0
- package/eval/local/tasks/comet-fix-median/validation/test_fix_median.py +60 -0
- package/eval/local/tasks/comet-framework-selection/environment/Dockerfile +25 -0
- package/eval/local/tasks/comet-framework-selection/environment/architecture.py +12 -0
- package/eval/local/tasks/comet-framework-selection/environment/test_architecture.py +30 -0
- package/eval/local/tasks/comet-framework-selection/instruction.md +22 -0
- package/eval/local/tasks/comet-framework-selection/task.toml +24 -0
- package/eval/local/tasks/comet-framework-selection/validation/test_framework_selection.py +24 -0
- package/eval/local/tasks/comet-full-workflow/environment/Dockerfile +49 -0
- package/eval/local/tasks/comet-full-workflow/environment/test_wordcount.py +29 -0
- package/eval/local/tasks/comet-full-workflow/environment/wordcount.py +40 -0
- package/eval/local/tasks/comet-full-workflow/instruction.md +18 -0
- package/eval/local/tasks/comet-full-workflow/task.toml +24 -0
- package/eval/local/tasks/comet-full-workflow/validation/test_full_workflow.py +171 -0
- package/eval/local/tasks/comet-graph-execution-review/environment/Dockerfile +25 -0
- package/eval/local/tasks/comet-graph-execution-review/environment/pipeline.py +19 -0
- package/eval/local/tasks/comet-graph-execution-review/environment/test_pipeline.py +53 -0
- package/eval/local/tasks/comet-graph-execution-review/instruction.md +21 -0
- package/eval/local/tasks/comet-graph-execution-review/task.toml +24 -0
- package/eval/local/tasks/comet-graph-execution-review/validation/test_graph_execution_review.py +24 -0
- package/eval/local/tasks/comet-human-approval-flow/environment/Dockerfile +15 -0
- package/eval/local/tasks/comet-human-approval-flow/environment/approvals.py +17 -0
- package/eval/local/tasks/comet-human-approval-flow/environment/test_approvals.py +30 -0
- package/eval/local/tasks/comet-human-approval-flow/instruction.md +15 -0
- package/eval/local/tasks/comet-human-approval-flow/task.toml +20 -0
- package/eval/local/tasks/comet-human-approval-flow/validation/test_human_approval_flow.py +20 -0
- package/eval/local/tasks/comet-layered-streaming-fix/environment/Dockerfile +17 -0
- package/eval/local/tasks/comet-layered-streaming-fix/environment/chat_app.py +19 -0
- package/eval/local/tasks/comet-layered-streaming-fix/environment/test_chat_app.py +15 -0
- package/eval/local/tasks/comet-layered-streaming-fix/instruction.md +14 -0
- package/eval/local/tasks/comet-layered-streaming-fix/task.toml +20 -0
- package/eval/local/tasks/comet-layered-streaming-fix/validation/test_layered_streaming_fix.py +20 -0
- package/eval/local/tasks/comet-native-clarification/environment/Dockerfile +25 -0
- package/eval/local/tasks/comet-native-clarification/environment/test_wordcount.py +25 -0
- package/eval/local/tasks/comet-native-clarification/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-clarification/instruction.md +7 -0
- package/eval/local/tasks/comet-native-clarification/task.toml +40 -0
- package/eval/local/tasks/comet-native-clarification/validation/test_native_clarification.py +193 -0
- package/eval/local/tasks/comet-native-clarification-depth/environment/Dockerfile +25 -0
- package/eval/local/tasks/comet-native-clarification-depth/environment/test_wordcount.py +25 -0
- package/eval/local/tasks/comet-native-clarification-depth/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-clarification-depth/instruction.md +17 -0
- package/eval/local/tasks/comet-native-clarification-depth/task.toml +47 -0
- package/eval/local/tasks/comet-native-clarification-depth/validation/test_native_clarification_depth.py +618 -0
- package/eval/local/tasks/comet-native-clarification-modes/environment/Dockerfile +25 -0
- package/eval/local/tasks/comet-native-clarification-modes/environment/test_wordcount.py +25 -0
- package/eval/local/tasks/comet-native-clarification-modes/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-clarification-modes/instruction.md +13 -0
- package/eval/local/tasks/comet-native-clarification-modes/task.toml +39 -0
- package/eval/local/tasks/comet-native-clarification-modes/validation/test_native_clarification_modes.py +235 -0
- package/eval/local/tasks/comet-native-interrupted-transition/environment/.comet/config.yaml +6 -0
- package/eval/local/tasks/comet-native-interrupted-transition/environment/Dockerfile +26 -0
- package/eval/local/tasks/comet-native-interrupted-transition/environment/docs/comet/changes/add-character-counting/brief.md +17 -0
- package/eval/local/tasks/comet-native-interrupted-transition/environment/docs/comet/changes/add-character-counting/comet-state.yaml +12 -0
- package/eval/local/tasks/comet-native-interrupted-transition/environment/docs/comet/changes/add-character-counting/runtime/transition.json +69 -0
- package/eval/local/tasks/comet-native-interrupted-transition/environment/docs/comet/changes/add-character-counting/specs/character-counting/spec.md +3 -0
- package/eval/local/tasks/comet-native-interrupted-transition/environment/test_wordcount.py +20 -0
- package/eval/local/tasks/comet-native-interrupted-transition/environment/wordcount.py +27 -0
- package/eval/local/tasks/comet-native-interrupted-transition/instruction.md +7 -0
- package/eval/local/tasks/comet-native-interrupted-transition/task.toml +35 -0
- package/eval/local/tasks/comet-native-interrupted-transition/validation/test_native_interrupted_transition.py +63 -0
- package/eval/local/tasks/comet-native-repository-fact/environment/Dockerfile +24 -0
- package/eval/local/tasks/comet-native-repository-fact/environment/PRODUCT_RULES.md +3 -0
- package/eval/local/tasks/comet-native-repository-fact/environment/test_wordcount.py +20 -0
- package/eval/local/tasks/comet-native-repository-fact/environment/wordcount.py +27 -0
- package/eval/local/tasks/comet-native-repository-fact/instruction.md +7 -0
- package/eval/local/tasks/comet-native-repository-fact/task.toml +35 -0
- package/eval/local/tasks/comet-native-repository-fact/validation/test_native_repository_fact.py +53 -0
- package/eval/local/tasks/comet-native-wave-b-decision-resume/environment/Dockerfile +25 -0
- package/eval/local/tasks/comet-native-wave-b-decision-resume/environment/test_wordcount.py +27 -0
- package/eval/local/tasks/comet-native-wave-b-decision-resume/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-wave-b-decision-resume/instruction.md +9 -0
- package/eval/local/tasks/comet-native-wave-b-decision-resume/task.toml +40 -0
- package/eval/local/tasks/comet-native-wave-b-decision-resume/validation/test_native_wave_b_decision_resume.py +208 -0
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/environment/Dockerfile +25 -0
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/environment/test_wordcount.py +27 -0
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/instruction.md +11 -0
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/task.toml +36 -0
- package/eval/local/tasks/comet-native-wave-c-verification-integrity/validation/test_native_wave_c_verification_integrity.py +344 -0
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/environment/Dockerfile +25 -0
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/environment/test_wordcount.py +27 -0
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/instruction.md +11 -0
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/task.toml +37 -0
- package/eval/local/tasks/comet-native-wave-d-stagnation-stop/validation/test_native_wave_d_stagnation_stop.py +284 -0
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/environment/.include-trusted-native-runtime +1 -0
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/environment/Dockerfile +25 -0
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/environment/test_wordcount.py +27 -0
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/instruction.md +9 -0
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/task.toml +37 -0
- package/eval/local/tasks/comet-native-wave-e-parallel-safety/validation/test_native_wave_e_parallel_safety.py +309 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/.include-current-comet-cli +1 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/Dockerfile +29 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/current-comet-package.json +18 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/current-comet.sh +14 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/test_wordcount.py +27 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/instruction.md +7 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/task.toml +36 -0
- package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/validation/test_native_wave_f_dashboard_readonly.py +483 -0
- package/eval/local/tasks/comet-native-workflow/environment/.include-trusted-native-review-fixture +1 -0
- package/eval/local/tasks/comet-native-workflow/environment/.include-trusted-native-runtime +1 -0
- package/eval/local/tasks/comet-native-workflow/environment/Dockerfile +26 -0
- package/eval/local/tasks/comet-native-workflow/environment/test_wordcount.py +25 -0
- package/eval/local/tasks/comet-native-workflow/environment/wordcount.py +36 -0
- package/eval/local/tasks/comet-native-workflow/instruction.md +36 -0
- package/eval/local/tasks/comet-native-workflow/task.toml +36 -0
- package/eval/local/tasks/comet-native-workflow/validation/test_native_workflow.py +680 -0
- package/eval/local/tasks/comet-noise-distractor/environment/Dockerfile +15 -0
- package/eval/local/tasks/comet-noise-distractor/environment/distractor.md +4 -0
- package/eval/local/tasks/comet-noise-distractor/environment/invoice.py +5 -0
- package/eval/local/tasks/comet-noise-distractor/environment/test_invoice.py +18 -0
- package/eval/local/tasks/comet-noise-distractor/instruction.md +17 -0
- package/eval/local/tasks/comet-noise-distractor/task.toml +20 -0
- package/eval/local/tasks/comet-noise-distractor/validation/test_noise_distractor.py +20 -0
- package/eval/local/tasks/comet-observability-env-template/environment/Dockerfile +15 -0
- package/eval/local/tasks/comet-observability-env-template/environment/env_writer.py +17 -0
- package/eval/local/tasks/comet-observability-env-template/environment/test_env_writer.py +17 -0
- package/eval/local/tasks/comet-observability-env-template/instruction.md +20 -0
- package/eval/local/tasks/comet-observability-env-template/task.toml +20 -0
- package/eval/local/tasks/comet-observability-env-template/validation/test_observability_env_template.py +46 -0
- package/eval/local/tasks/comet-perf-dedupe/environment/Dockerfile +35 -0
- package/eval/local/tasks/comet-perf-dedupe/environment/dedupe.py +22 -0
- package/eval/local/tasks/comet-perf-dedupe/environment/test_dedupe.py +43 -0
- package/eval/local/tasks/comet-perf-dedupe/instruction.md +25 -0
- package/eval/local/tasks/comet-perf-dedupe/task.toml +24 -0
- package/eval/local/tasks/comet-perf-dedupe/validation/test_perf_dedupe.py +40 -0
- package/eval/local/tasks/comet-persistence-threading/environment/Dockerfile +15 -0
- package/eval/local/tasks/comet-persistence-threading/environment/session_store.py +15 -0
- package/eval/local/tasks/comet-persistence-threading/environment/test_session_store.py +21 -0
- package/eval/local/tasks/comet-persistence-threading/instruction.md +14 -0
- package/eval/local/tasks/comet-persistence-threading/task.toml +20 -0
- package/eval/local/tasks/comet-persistence-threading/validation/test_persistence_threading.py +20 -0
- package/eval/local/tasks/comet-refactor-counter/environment/Dockerfile +35 -0
- package/eval/local/tasks/comet-refactor-counter/environment/test_text_processor.py +57 -0
- package/eval/local/tasks/comet-refactor-counter/environment/text_processor.py +49 -0
- package/eval/local/tasks/comet-refactor-counter/instruction.md +31 -0
- package/eval/local/tasks/comet-refactor-counter/task.toml +24 -0
- package/eval/local/tasks/comet-refactor-counter/validation/test_refactor_counter.py +75 -0
- package/eval/local/tasks/comet-robust-config/environment/Dockerfile +35 -0
- package/eval/local/tasks/comet-robust-config/environment/config_loader.py +56 -0
- package/eval/local/tasks/comet-robust-config/environment/test_config_loader.py +72 -0
- package/eval/local/tasks/comet-robust-config/instruction.md +30 -0
- package/eval/local/tasks/comet-robust-config/task.toml +24 -0
- package/eval/local/tasks/comet-robust-config/validation/test_robust_config.py +37 -0
- package/eval/local/tasks/generic-skill-smoke/environment/Dockerfile +14 -0
- package/eval/local/tasks/generic-skill-smoke/instruction.md +7 -0
- package/eval/local/tasks/generic-skill-smoke/task.toml +21 -0
- package/eval/local/tasks/generic-skill-smoke/validation/test_generic_skill_smoke.py +41 -0
- package/eval/local/tasks/index.yaml +229 -0
- package/eval/local/tasks/workflow-overlay-contract/environment/Dockerfile +16 -0
- package/eval/local/tasks/workflow-overlay-contract/instruction.md +5 -0
- package/eval/local/tasks/workflow-overlay-contract/task.toml +21 -0
- package/eval/local/tasks/workflow-overlay-contract/validation/test_workflow_overlay_contract.py +235 -0
- package/eval/local/tasks/workflow-route-conformance/environment/Dockerfile +14 -0
- package/eval/local/tasks/workflow-route-conformance/instruction.md +5 -0
- package/eval/local/tasks/workflow-route-conformance/task.toml +21 -0
- package/eval/local/tasks/workflow-route-conformance/validation/test_workflow_route_conformance.py +84 -0
- package/eval/local/tests/conftest.py +1946 -0
- package/eval/local/tests/scaffold/test_aligned_comparison.py +1012 -0
- package/eval/local/tests/scaffold/test_attribution.py +48 -0
- package/eval/local/tests/scaffold/test_compare_baselines.py +999 -0
- package/eval/local/tests/scaffold/test_conftest_helpers.py +980 -0
- package/eval/local/tests/scaffold/test_evidence.py +15 -0
- package/eval/local/tests/scaffold/test_langsmith_conftest.py +244 -0
- package/eval/local/tests/scaffold/test_logging.py +377 -0
- package/eval/local/tests/scaffold/test_manifests.py +134 -0
- package/eval/local/tests/scaffold/test_native_aligned_eval.py +353 -0
- package/eval/local/tests/scaffold/test_native_wave_evaluations.py +2183 -0
- package/eval/local/tests/scaffold/test_profiles.py +1149 -0
- package/eval/local/tests/scaffold/test_regression_check.py +19 -0
- package/eval/local/tests/scaffold/test_report_style_demo_charts.py +45 -0
- package/eval/local/tests/scaffold/test_sample_quality.py +268 -0
- package/eval/local/tests/scaffold/test_tasks.py +1013 -0
- package/eval/local/tests/scaffold/test_treatments.py +353 -0
- package/eval/local/tests/scaffold/test_utils.py +561 -0
- package/eval/local/tests/tasks/__init__.py +1 -0
- package/eval/local/tests/tasks/test_tasks.py +474 -0
- package/eval/local/tests/tasks/test_validation_scripts.py +787 -0
- package/eval/local/treatments/comet/comet_classic_docs_layout.yaml +121 -0
- package/eval/local/treatments/comet/comet_full_039.yaml +141 -0
- package/eval/local/treatments/comet/comet_full_040_beta.yaml +140 -0
- package/eval/local/treatments/comet/comet_native_phase1.yaml +66 -0
- package/eval/local/treatments/common/control.yaml +4 -0
- package/eval/pyproject.toml +41 -0
- package/eval/report-html-config.json +6 -0
- package/eval/scaffold/__init__.py +67 -0
- package/eval/scaffold/python/__init__.py +95 -0
- package/eval/scaffold/python/aligned_comparison.py +1632 -0
- package/eval/scaffold/python/attribution.py +43 -0
- package/eval/scaffold/python/evidence.py +38 -0
- package/eval/scaffold/python/external_data_handler.py +18 -0
- package/eval/scaffold/python/generic_llm_judge.py +237 -0
- package/eval/scaffold/python/judge_config.py +168 -0
- package/eval/scaffold/python/llm_judge.py +188 -0
- package/eval/scaffold/python/logging.py +804 -0
- package/eval/scaffold/python/manifests.py +131 -0
- package/eval/scaffold/python/native_eval.py +143 -0
- package/eval/scaffold/python/paper_charts.py +25 -0
- package/eval/scaffold/python/pass_at_k.py +106 -0
- package/eval/scaffold/python/paths.py +56 -0
- package/eval/scaffold/python/profiles.py +127 -0
- package/eval/scaffold/python/report_outputs.py +1573 -0
- package/eval/scaffold/python/sample_quality.py +382 -0
- package/eval/scaffold/python/schema.py +39 -0
- package/eval/scaffold/python/skill_parser.py +469 -0
- package/eval/scaffold/python/tasks.py +343 -0
- package/eval/scaffold/python/treatments.py +271 -0
- package/eval/scaffold/python/utils.py +460 -0
- package/eval/scaffold/python/validation/__init__.py +31 -0
- package/eval/scaffold/python/validation/authoring_rubric.py +328 -0
- package/eval/scaffold/python/validation/comet_workflow.py +227 -0
- package/eval/scaffold/python/validation/core.py +264 -0
- package/eval/scaffold/python/validation/dataset.py +337 -0
- package/eval/scaffold/python/validation/docker.py +106 -0
- package/eval/scaffold/python/validation/evaluator.py +549 -0
- package/eval/scaffold/python/validation/generic_rubric.py +198 -0
- package/eval/scaffold/python/validation/native_wave.py +2154 -0
- package/eval/scaffold/python/validation/native_workflow.py +252 -0
- package/eval/scaffold/python/validation/rubric.py +780 -0
- package/eval/scaffold/python/validation/runner.py +237 -0
- package/eval/scaffold/python/validation/scripts.py +58 -0
- package/eval/scaffold/python/validation/tracing.py +313 -0
- package/eval/scaffold/shell/common.sh +126 -0
- package/eval/scaffold/shell/completion-point.sh +18 -0
- package/eval/scaffold/shell/decision-point.sh +35 -0
- package/eval/scaffold/shell/docker.sh +716 -0
- package/eval/scaffold/shell/native-review-signer-daemon.mjs +144 -0
- package/eval/scaffold/shell/native-review-verifier-daemon.mjs +178 -0
- package/eval/scaffold/shell/run-claude-loop.sh +234 -0
- package/eval/scaffold/shell/setup.sh +259 -0
- package/eval/simulator-instruction.md +9 -0
- package/package.json +98 -18
- package/dist/cli/index.js +0 -84
- package/dist/cli/index.js.map +0 -1
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -234
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/i18n.d.ts +0 -4
- package/dist/commands/i18n.d.ts.map +0 -1
- package/dist/commands/i18n.js.map +0 -1
- package/dist/commands/init.d.ts +0 -26
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -352
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js +0 -108
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/uninstall.d.ts +0 -9
- package/dist/commands/uninstall.d.ts.map +0 -1
- package/dist/commands/uninstall.js +0 -132
- package/dist/commands/uninstall.js.map +0 -1
- package/dist/commands/update.d.ts +0 -29
- package/dist/commands/update.d.ts.map +0 -1
- package/dist/commands/update.js +0 -293
- package/dist/commands/update.js.map +0 -1
- package/dist/core/codegraph.d.ts +0 -6
- package/dist/core/codegraph.d.ts.map +0 -1
- package/dist/core/codegraph.js +0 -118
- package/dist/core/codegraph.js.map +0 -1
- package/dist/core/command-error.d.ts.map +0 -1
- package/dist/core/command-error.js.map +0 -1
- package/dist/core/detect.d.ts.map +0 -1
- package/dist/core/detect.js.map +0 -1
- package/dist/core/openspec.d.ts +0 -11
- package/dist/core/openspec.d.ts.map +0 -1
- package/dist/core/openspec.js +0 -271
- package/dist/core/openspec.js.map +0 -1
- package/dist/core/platforms.d.ts.map +0 -1
- package/dist/core/platforms.js.map +0 -1
- package/dist/core/skills.d.ts +0 -58
- package/dist/core/skills.d.ts.map +0 -1
- package/dist/core/skills.js +0 -562
- package/dist/core/skills.js.map +0 -1
- package/dist/core/superpowers.d.ts.map +0 -1
- package/dist/core/superpowers.js.map +0 -1
- package/dist/core/types.d.ts +0 -2
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/uninstall.d.ts +0 -28
- package/dist/core/uninstall.d.ts.map +0 -1
- package/dist/core/uninstall.js +0 -421
- package/dist/core/uninstall.js.map +0 -1
- package/dist/core/version.d.ts.map +0 -1
- package/dist/core/version.js.map +0 -1
- package/dist/utils/file-system.d.ts.map +0 -1
- package/dist/utils/file-system.js.map +0 -1
- /package/dist/{cli → app/cli}/index.d.ts +0 -0
- /package/dist/{commands → app/commands}/status.d.ts +0 -0
- /package/dist/{core → domains/bundle}/types.js +0 -0
- /package/dist/{core → platform/process}/command-error.d.ts +0 -0
- /package/dist/{core → platform/process}/command-error.js +0 -0
- /package/dist/{core → platform/version}/version.d.ts +0 -0
- /package/{assets/skills/comet → eval/local/skills/benchmarks/039-release/comet-classic-039}/scripts/comet-archive.sh +0 -0
- /package/{assets/skills/comet → eval/local/skills/benchmarks/039-release/comet-classic-039}/scripts/comet-env.sh +0 -0
- /package/{assets/skills/comet → eval/local/skills/benchmarks/039-release/comet-classic-039}/scripts/comet-guard.sh +0 -0
- /package/{assets/skills/comet → eval/local/skills/benchmarks/039-release/comet-classic-039}/scripts/comet-handoff.sh +0 -0
- /package/{assets/skills/comet → eval/local/skills/benchmarks/039-release/comet-classic-039}/scripts/comet-hook-guard.sh +0 -0
- /package/{assets/skills/comet → eval/local/skills/benchmarks/039-release/comet-classic-039}/scripts/comet-state.sh +0 -0
- /package/{assets/skills/comet → eval/local/skills/benchmarks/039-release/comet-classic-039}/scripts/comet-yaml-validate.sh +0 -0
- /package/scripts/{postinstall.js → install/postinstall.js} +0 -0
|
@@ -0,0 +1,2609 @@
|
|
|
1
|
+
import { createHash } from 'crypto';
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
import { promises as fs } from 'fs';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { atomicWriteJson } from './native-atomic-file.js';
|
|
6
|
+
import { parseNativeCreationAuthorization } from './native-creation-authorization.js';
|
|
7
|
+
import { DEFAULT_NATIVE_SNAPSHOT_CONFIG, normalizeNativeSnapshotPattern, readProjectConfig, } from './native-config.js';
|
|
8
|
+
import { sha256Text } from './native-hash.js';
|
|
9
|
+
import { hasComparableNativeFileObject, sameNativeFileObject } from './native-file-identity.js';
|
|
10
|
+
import { isInsidePath, resolveContainedNativePath } from './native-paths.js';
|
|
11
|
+
import { readNativeProtectedTextFile } from './native-protected-file.js';
|
|
12
|
+
import { NATIVE_REVIEW_TRUST_POLICY_REF } from './native-review-contract.js';
|
|
13
|
+
import { nativeSensitiveRelativePathReason } from './native-sensitive-paths.js';
|
|
14
|
+
export const DEFAULT_NATIVE_SNAPSHOT_LIMITS = {
|
|
15
|
+
maxFiles: 10_000,
|
|
16
|
+
maxFileBytes: 5 * 1024 * 1024,
|
|
17
|
+
maxTotalBytes: 64 * 1024 * 1024,
|
|
18
|
+
maxManifestBytes: 1024 * 1024,
|
|
19
|
+
};
|
|
20
|
+
const MAX_RECORDED_OMISSIONS = 1_000;
|
|
21
|
+
const NATIVE_SNAPSHOT_MANIFEST_HARD_MAX_BYTES = 8 * 1024 * 1024;
|
|
22
|
+
const CHANGE_NAME_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u;
|
|
23
|
+
const MANIFEST_KEYS = new Set([
|
|
24
|
+
'schema',
|
|
25
|
+
'origin',
|
|
26
|
+
'creation',
|
|
27
|
+
'capture',
|
|
28
|
+
'createdAt',
|
|
29
|
+
'complete',
|
|
30
|
+
'limits',
|
|
31
|
+
'entries',
|
|
32
|
+
'omitted',
|
|
33
|
+
'omittedCount',
|
|
34
|
+
'omissionOverflow',
|
|
35
|
+
'policy',
|
|
36
|
+
]);
|
|
37
|
+
const LIMIT_KEYS = new Set([
|
|
38
|
+
'maxFiles',
|
|
39
|
+
'maxFileBytes',
|
|
40
|
+
'maxTotalBytes',
|
|
41
|
+
'maxManifestBytes',
|
|
42
|
+
'maxDurationMs',
|
|
43
|
+
]);
|
|
44
|
+
const POLICY_KEYS = new Set(['schema', 'include', 'exclude', 'hash']);
|
|
45
|
+
const CAPTURE_KEYS = new Set(['provider', 'gitSelection', 'physicalSelection', 'projection']);
|
|
46
|
+
const CREATION_KEYS = new Set([
|
|
47
|
+
'schema',
|
|
48
|
+
'protocol',
|
|
49
|
+
'policyHash',
|
|
50
|
+
'policySnapshotRef',
|
|
51
|
+
'policySnapshotHash',
|
|
52
|
+
'authorization',
|
|
53
|
+
]);
|
|
54
|
+
const GIT_PROJECTION_KEYS = new Set(['provider', 'selection']);
|
|
55
|
+
const GIT_SELECTION_KEYS = new Set([
|
|
56
|
+
'schema',
|
|
57
|
+
'status',
|
|
58
|
+
'stageBefore',
|
|
59
|
+
'combined',
|
|
60
|
+
'stageAfter',
|
|
61
|
+
'finalStageBefore',
|
|
62
|
+
'finalCombined',
|
|
63
|
+
'finalStageAfter',
|
|
64
|
+
]);
|
|
65
|
+
const GIT_SELECTION_STREAM_KEYS = new Set([
|
|
66
|
+
'hash',
|
|
67
|
+
'recordCount',
|
|
68
|
+
'storedRecordCount',
|
|
69
|
+
'stdoutBytes',
|
|
70
|
+
'overflow',
|
|
71
|
+
]);
|
|
72
|
+
const PHYSICAL_SELECTION_KEYS = new Set(['schema', 'status', 'before', 'after']);
|
|
73
|
+
const PHYSICAL_SELECTION_STREAM_KEYS = new Set([
|
|
74
|
+
'hash',
|
|
75
|
+
'visitedNodeCount',
|
|
76
|
+
'recordCount',
|
|
77
|
+
'storedRecordCount',
|
|
78
|
+
'encodedBytes',
|
|
79
|
+
'overflow',
|
|
80
|
+
'unstable',
|
|
81
|
+
]);
|
|
82
|
+
const ENTRY_KEYS = new Set(['path', 'hash', 'size', 'type']);
|
|
83
|
+
const OMISSION_KEYS = new Set(['path', 'size', 'type', 'reason']);
|
|
84
|
+
const OMISSION_OVERFLOW_KEYS = new Set(['ref', 'hash', 'count']);
|
|
85
|
+
const SNAPSHOT_ORIGINS = new Set([
|
|
86
|
+
'change-created',
|
|
87
|
+
'legacy-migration',
|
|
88
|
+
'explicit',
|
|
89
|
+
]);
|
|
90
|
+
const OMISSION_TYPES = new Set(['file', 'directory', 'other']);
|
|
91
|
+
const OMISSION_REASONS = new Set([
|
|
92
|
+
'file-size',
|
|
93
|
+
'file-count',
|
|
94
|
+
'total-size',
|
|
95
|
+
'manifest-size',
|
|
96
|
+
'changed-during-read',
|
|
97
|
+
'unreadable',
|
|
98
|
+
'gitlink-unavailable',
|
|
99
|
+
'gitlink-dirty',
|
|
100
|
+
'gitlink-changed',
|
|
101
|
+
'legacy-gitlink-boundary',
|
|
102
|
+
'git-enumeration-limit',
|
|
103
|
+
'git-selection-changed',
|
|
104
|
+
'physical-enumeration-limit',
|
|
105
|
+
'physical-selection-changed',
|
|
106
|
+
]);
|
|
107
|
+
const HASH_PATTERN = /^[a-f0-9]{64}$/u;
|
|
108
|
+
const GIT_OBJECT_ID_PATTERN = /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/u;
|
|
109
|
+
const UNREADABLE_ERROR_CODES = new Set(['EACCES', 'EPERM']);
|
|
110
|
+
const GIT_LIST_STDERR_LIMIT = 64 * 1024;
|
|
111
|
+
const GIT_TEXT_STDOUT_LIMIT = 64 * 1024;
|
|
112
|
+
const DEFAULT_NATIVE_SNAPSHOT_EXECUTION_BUDGET_MS = 60_000;
|
|
113
|
+
const WINDOWS_TASKKILL_ATTEMPT_MS = 1_000;
|
|
114
|
+
const WINDOWS_TASKKILL_ATTEMPTS = 2;
|
|
115
|
+
const DEFAULT_NATIVE_GIT_SELECTION_LIMITS = {
|
|
116
|
+
maxRecords: 20_000,
|
|
117
|
+
maxBytes: 8 * 1024 * 1024,
|
|
118
|
+
maxRecordBytes: 64 * 1024,
|
|
119
|
+
};
|
|
120
|
+
const DEFAULT_NATIVE_PHYSICAL_SELECTION_LIMITS = {
|
|
121
|
+
maxNodes: 20_000,
|
|
122
|
+
maxBytes: 8 * 1024 * 1024,
|
|
123
|
+
maxPathBytes: 64 * 1024,
|
|
124
|
+
};
|
|
125
|
+
function createNativeSnapshotExecution(options) {
|
|
126
|
+
const deadlineMs = options.deadlineMs ?? DEFAULT_NATIVE_SNAPSHOT_EXECUTION_BUDGET_MS;
|
|
127
|
+
if (!Number.isSafeInteger(deadlineMs) || deadlineMs < 1) {
|
|
128
|
+
throw new Error('Native snapshot execution budget must be a positive integer');
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
deadlineAt: Date.now() + deadlineMs,
|
|
132
|
+
gitProcess: options.gitProcess ?? { command: 'git' },
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
function remainingNativeSnapshotTime(execution) {
|
|
136
|
+
return Math.max(0, execution.deadlineAt - Date.now());
|
|
137
|
+
}
|
|
138
|
+
function nativeSnapshotExecutionHasBudget(execution) {
|
|
139
|
+
return remainingNativeSnapshotTime(execution) >= 1;
|
|
140
|
+
}
|
|
141
|
+
function nativeGitSnapshotTimeoutError(cause) {
|
|
142
|
+
const error = cause === undefined
|
|
143
|
+
? new Error('Native snapshot deadline exceeded while waiting for Git')
|
|
144
|
+
: new Error('Native snapshot deadline exceeded while waiting for Git', { cause });
|
|
145
|
+
return Object.assign(error, { code: 'GIT_SNAPSHOT_TIMEOUT' });
|
|
146
|
+
}
|
|
147
|
+
function isNativeGitSnapshotTimeout(error) {
|
|
148
|
+
return error.code === 'GIT_SNAPSHOT_TIMEOUT';
|
|
149
|
+
}
|
|
150
|
+
function resolveNativePhysicalSelectionLimits(values) {
|
|
151
|
+
const limits = { ...DEFAULT_NATIVE_PHYSICAL_SELECTION_LIMITS, ...values };
|
|
152
|
+
if (!Number.isSafeInteger(limits.maxNodes) ||
|
|
153
|
+
limits.maxNodes < 1 ||
|
|
154
|
+
!Number.isSafeInteger(limits.maxBytes) ||
|
|
155
|
+
limits.maxBytes < 1 ||
|
|
156
|
+
!Number.isSafeInteger(limits.maxPathBytes) ||
|
|
157
|
+
limits.maxPathBytes < 1 ||
|
|
158
|
+
limits.maxPathBytes > limits.maxBytes) {
|
|
159
|
+
throw new Error('Native physical selection limits must be positive bounded integers');
|
|
160
|
+
}
|
|
161
|
+
return limits;
|
|
162
|
+
}
|
|
163
|
+
async function terminateNativeProcessTree(child, adapter) {
|
|
164
|
+
if (adapter.terminateTree) {
|
|
165
|
+
await adapter.terminateTree(child);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const pid = child.pid;
|
|
169
|
+
if (pid === undefined) {
|
|
170
|
+
child.kill('SIGKILL');
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (process.platform === 'win32') {
|
|
174
|
+
const configuredSystemRoot = process.env.SystemRoot ?? process.env.WINDIR;
|
|
175
|
+
const systemRoot = configuredSystemRoot && path.win32.isAbsolute(configuredSystemRoot)
|
|
176
|
+
? path.win32.resolve(configuredSystemRoot)
|
|
177
|
+
: 'C:\\Windows';
|
|
178
|
+
const taskkill = path.win32.join(systemRoot, 'System32', 'taskkill.exe');
|
|
179
|
+
if (!path.win32.isAbsolute(taskkill)) {
|
|
180
|
+
child.kill('SIGKILL');
|
|
181
|
+
child.stdin?.destroy();
|
|
182
|
+
child.stdout?.destroy();
|
|
183
|
+
child.stderr?.destroy();
|
|
184
|
+
throw Object.assign(new Error('Native Git taskkill path is not trusted'), {
|
|
185
|
+
code: 'GIT_SNAPSHOT_TERMINATION_UNCONFIRMED',
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
const runTaskkillAttempt = () => new Promise((resolve) => {
|
|
189
|
+
let finished = false;
|
|
190
|
+
let killer = null;
|
|
191
|
+
let fallbackTimer = null;
|
|
192
|
+
const finish = (confirmed, terminateKiller = false) => {
|
|
193
|
+
if (finished)
|
|
194
|
+
return;
|
|
195
|
+
finished = true;
|
|
196
|
+
if (fallbackTimer)
|
|
197
|
+
clearTimeout(fallbackTimer);
|
|
198
|
+
if (terminateKiller)
|
|
199
|
+
killer?.kill('SIGKILL');
|
|
200
|
+
resolve(confirmed);
|
|
201
|
+
};
|
|
202
|
+
try {
|
|
203
|
+
killer = spawn(taskkill, ['/pid', String(pid), '/t', '/f'], {
|
|
204
|
+
stdio: 'ignore',
|
|
205
|
+
windowsHide: true,
|
|
206
|
+
});
|
|
207
|
+
killer.once('error', () => finish(false));
|
|
208
|
+
killer.once('close', (code) => finish(code === 0));
|
|
209
|
+
fallbackTimer = setTimeout(() => finish(false, true), WINDOWS_TASKKILL_ATTEMPT_MS);
|
|
210
|
+
fallbackTimer.unref();
|
|
211
|
+
}
|
|
212
|
+
catch {
|
|
213
|
+
finish(false);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
for (let attempt = 0; attempt < WINDOWS_TASKKILL_ATTEMPTS; attempt += 1) {
|
|
217
|
+
if (await runTaskkillAttempt()) {
|
|
218
|
+
child.kill('SIGKILL');
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
child.kill('SIGKILL');
|
|
223
|
+
child.stdin?.destroy();
|
|
224
|
+
child.stdout?.destroy();
|
|
225
|
+
child.stderr?.destroy();
|
|
226
|
+
throw Object.assign(new Error('Native Git process-tree termination could not be confirmed on Windows'), { code: 'GIT_SNAPSHOT_TERMINATION_UNCONFIRMED' });
|
|
227
|
+
}
|
|
228
|
+
try {
|
|
229
|
+
process.kill(-pid, 'SIGKILL');
|
|
230
|
+
}
|
|
231
|
+
catch (error) {
|
|
232
|
+
if (error.code !== 'ESRCH')
|
|
233
|
+
throw error;
|
|
234
|
+
}
|
|
235
|
+
child.kill('SIGKILL');
|
|
236
|
+
}
|
|
237
|
+
function startNativeGitProcess(execution, projectRoot, args, input) {
|
|
238
|
+
const remaining = remainingNativeSnapshotTime(execution);
|
|
239
|
+
if (remaining < 1)
|
|
240
|
+
throw nativeGitSnapshotTimeoutError();
|
|
241
|
+
const adapter = execution.gitProcess;
|
|
242
|
+
const child = spawn(adapter.command, [...(adapter.argsPrefix ?? []), '-C', projectRoot, ...args], {
|
|
243
|
+
stdio: [input ? 'pipe' : 'ignore', 'pipe', 'pipe'],
|
|
244
|
+
windowsHide: true,
|
|
245
|
+
detached: process.platform !== 'win32',
|
|
246
|
+
});
|
|
247
|
+
let spawnError = null;
|
|
248
|
+
let timedOut = false;
|
|
249
|
+
let termination = null;
|
|
250
|
+
child.once('error', (error) => {
|
|
251
|
+
spawnError = error;
|
|
252
|
+
});
|
|
253
|
+
const close = new Promise((resolve) => {
|
|
254
|
+
child.once('close', resolve);
|
|
255
|
+
});
|
|
256
|
+
const timer = setTimeout(() => {
|
|
257
|
+
timedOut = true;
|
|
258
|
+
termination = terminateNativeProcessTree(child, adapter).then(() => ({ error: null }), (error) => ({ error }));
|
|
259
|
+
}, remaining);
|
|
260
|
+
timer.unref();
|
|
261
|
+
const completion = close.then(async (code) => {
|
|
262
|
+
clearTimeout(timer);
|
|
263
|
+
if (timedOut) {
|
|
264
|
+
const result = await termination;
|
|
265
|
+
if (result?.error)
|
|
266
|
+
throw nativeGitSnapshotTimeoutError(result.error);
|
|
267
|
+
throw nativeGitSnapshotTimeoutError();
|
|
268
|
+
}
|
|
269
|
+
return { code, spawnError };
|
|
270
|
+
});
|
|
271
|
+
return { child, completion };
|
|
272
|
+
}
|
|
273
|
+
function resolveNativeGitSelectionLimits(values) {
|
|
274
|
+
const limits = { ...DEFAULT_NATIVE_GIT_SELECTION_LIMITS, ...values };
|
|
275
|
+
if (!Number.isSafeInteger(limits.maxRecords) ||
|
|
276
|
+
limits.maxRecords < 1 ||
|
|
277
|
+
!Number.isSafeInteger(limits.maxBytes) ||
|
|
278
|
+
limits.maxBytes < 1 ||
|
|
279
|
+
!Number.isSafeInteger(limits.maxRecordBytes) ||
|
|
280
|
+
limits.maxRecordBytes < 1 ||
|
|
281
|
+
limits.maxRecordBytes > limits.maxBytes) {
|
|
282
|
+
throw new Error('Native Git selection limits must be positive bounded integers');
|
|
283
|
+
}
|
|
284
|
+
return limits;
|
|
285
|
+
}
|
|
286
|
+
async function runGitBoundedOutput(execution, projectRoot, args, maxBytes = GIT_TEXT_STDOUT_LIMIT) {
|
|
287
|
+
const { child, completion } = startNativeGitProcess(execution, projectRoot, args, false);
|
|
288
|
+
const stdout = [];
|
|
289
|
+
const stderr = [];
|
|
290
|
+
let stderrBytes = 0;
|
|
291
|
+
let stdoutBytes = 0;
|
|
292
|
+
let stdoutOverflow = false;
|
|
293
|
+
child.stdout.on('data', (chunk) => {
|
|
294
|
+
const remaining = Math.max(0, maxBytes - stdoutBytes);
|
|
295
|
+
if (remaining > 0)
|
|
296
|
+
stdout.push(Buffer.from(chunk).subarray(0, remaining));
|
|
297
|
+
stdoutBytes += chunk.byteLength;
|
|
298
|
+
if (stdoutBytes > maxBytes)
|
|
299
|
+
stdoutOverflow = true;
|
|
300
|
+
});
|
|
301
|
+
child.stderr.on('data', (chunk) => {
|
|
302
|
+
if (stderrBytes >= GIT_LIST_STDERR_LIMIT)
|
|
303
|
+
return;
|
|
304
|
+
const remaining = GIT_LIST_STDERR_LIMIT - stderrBytes;
|
|
305
|
+
const bounded = Buffer.from(chunk).subarray(0, remaining);
|
|
306
|
+
stderr.push(bounded);
|
|
307
|
+
stderrBytes += bounded.byteLength;
|
|
308
|
+
});
|
|
309
|
+
const { code, spawnError } = await completion;
|
|
310
|
+
if (code === 0 && spawnError === null && !stdoutOverflow)
|
|
311
|
+
return Buffer.concat(stdout);
|
|
312
|
+
throw Object.assign(new Error(`git ${args.join(' ')} failed${spawnError ? `: ${spawnError.message}` : stderr.length > 0 ? `: ${Buffer.concat(stderr).toString('utf8').trim()}` : ''}`), { code: 'GIT_SNAPSHOT_UNAVAILABLE' });
|
|
313
|
+
}
|
|
314
|
+
function gitSelectionStreamEvidence(result) {
|
|
315
|
+
return {
|
|
316
|
+
hash: result.digest,
|
|
317
|
+
recordCount: result.recordCount,
|
|
318
|
+
storedRecordCount: result.records.length,
|
|
319
|
+
stdoutBytes: result.stdoutBytes,
|
|
320
|
+
overflow: result.overflow,
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
function runGitNullRecords(execution, projectRoot, args, options) {
|
|
324
|
+
if (options.outputChunkBytes !== undefined &&
|
|
325
|
+
(!Number.isSafeInteger(options.outputChunkBytes) || options.outputChunkBytes < 1)) {
|
|
326
|
+
throw new Error('Native Git output chunk size must be a positive integer');
|
|
327
|
+
}
|
|
328
|
+
return new Promise((resolve, reject) => {
|
|
329
|
+
const { child, completion } = startNativeGitProcess(execution, projectRoot, args, options.stdin !== undefined);
|
|
330
|
+
const records = [];
|
|
331
|
+
const digest = createHash('sha256');
|
|
332
|
+
const stderr = [];
|
|
333
|
+
let stderrBytes = 0;
|
|
334
|
+
let stdoutBytes = 0;
|
|
335
|
+
let storedBytes = 0;
|
|
336
|
+
let recordCount = 0;
|
|
337
|
+
let pending = Buffer.alloc(0);
|
|
338
|
+
let droppingRecord = false;
|
|
339
|
+
let overflow = false;
|
|
340
|
+
let malformed = false;
|
|
341
|
+
const consumeChunk = (chunk) => {
|
|
342
|
+
let offset = 0;
|
|
343
|
+
while (offset < chunk.byteLength) {
|
|
344
|
+
const separator = chunk.indexOf(0, offset);
|
|
345
|
+
const end = separator < 0 ? chunk.byteLength : separator;
|
|
346
|
+
const part = chunk.subarray(offset, end);
|
|
347
|
+
if (!droppingRecord && part.byteLength > 0) {
|
|
348
|
+
if (pending.byteLength + part.byteLength > options.maxRecordBytes) {
|
|
349
|
+
pending = Buffer.alloc(0);
|
|
350
|
+
droppingRecord = true;
|
|
351
|
+
overflow = true;
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
pending = Buffer.concat([pending, part]);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
if (separator < 0)
|
|
358
|
+
break;
|
|
359
|
+
recordCount += 1;
|
|
360
|
+
if (pending.byteLength === 0 && !droppingRecord)
|
|
361
|
+
malformed = true;
|
|
362
|
+
const recordBytes = pending.byteLength + 1;
|
|
363
|
+
if (!droppingRecord &&
|
|
364
|
+
recordCount <= options.maxRecords &&
|
|
365
|
+
storedBytes + recordBytes <= options.maxBytes) {
|
|
366
|
+
records.push(pending);
|
|
367
|
+
storedBytes += recordBytes;
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
overflow = true;
|
|
371
|
+
}
|
|
372
|
+
pending = Buffer.alloc(0);
|
|
373
|
+
droppingRecord = false;
|
|
374
|
+
offset = separator + 1;
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
child.stdout.on('data', (chunk) => {
|
|
378
|
+
digest.update(chunk);
|
|
379
|
+
stdoutBytes += chunk.byteLength;
|
|
380
|
+
if (stdoutBytes > options.maxBytes)
|
|
381
|
+
overflow = true;
|
|
382
|
+
const outputChunkBytes = options.outputChunkBytes;
|
|
383
|
+
if (outputChunkBytes === undefined) {
|
|
384
|
+
consumeChunk(chunk);
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
for (let offset = 0; offset < chunk.byteLength; offset += outputChunkBytes) {
|
|
388
|
+
consumeChunk(chunk.subarray(offset, Math.min(chunk.byteLength, offset + outputChunkBytes)));
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
child.stderr.on('data', (chunk) => {
|
|
392
|
+
if (stderrBytes >= GIT_LIST_STDERR_LIMIT)
|
|
393
|
+
return;
|
|
394
|
+
const remaining = GIT_LIST_STDERR_LIMIT - stderrBytes;
|
|
395
|
+
const bounded = Buffer.from(chunk).subarray(0, remaining);
|
|
396
|
+
stderr.push(bounded);
|
|
397
|
+
stderrBytes += bounded.byteLength;
|
|
398
|
+
});
|
|
399
|
+
child.stdin?.on('error', () => {
|
|
400
|
+
// `close` reports the authoritative command result; ignore an early pipe close here.
|
|
401
|
+
});
|
|
402
|
+
void completion.then(({ code, spawnError }) => {
|
|
403
|
+
const acceptedExitCodes = options.acceptedExitCodes ?? [0];
|
|
404
|
+
if (code !== null &&
|
|
405
|
+
acceptedExitCodes.includes(code) &&
|
|
406
|
+
spawnError === null &&
|
|
407
|
+
!malformed &&
|
|
408
|
+
pending.byteLength === 0 &&
|
|
409
|
+
!droppingRecord) {
|
|
410
|
+
resolve({
|
|
411
|
+
records,
|
|
412
|
+
digest: digest.digest('hex'),
|
|
413
|
+
overflow,
|
|
414
|
+
recordCount,
|
|
415
|
+
stdoutBytes,
|
|
416
|
+
});
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
reject(new Error(`git ${args.join(' ')} failed${spawnError ? `: ${spawnError.message}` : malformed || pending.byteLength > 0 || droppingRecord ? ': malformed NUL-delimited output' : stderr.length > 0 ? `: ${Buffer.concat(stderr).toString('utf8').trim()}` : ''}`));
|
|
420
|
+
}, reject);
|
|
421
|
+
if (options.stdin)
|
|
422
|
+
child.stdin?.end(options.stdin);
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
function decodeGitRecord(value) {
|
|
426
|
+
const decoded = value.toString('utf8');
|
|
427
|
+
if (!Buffer.from(decoded, 'utf8').equals(value)) {
|
|
428
|
+
throw new Error('Native Git snapshot provider returned non-UTF-8 path data');
|
|
429
|
+
}
|
|
430
|
+
return decoded;
|
|
431
|
+
}
|
|
432
|
+
async function runGitCheckIgnore(execution, projectRoot, paths) {
|
|
433
|
+
if (paths.length === 0)
|
|
434
|
+
return new Set();
|
|
435
|
+
const result = await runGitNullRecords(execution, projectRoot, ['check-ignore', '--no-index', '-z', '--stdin'], {
|
|
436
|
+
...DEFAULT_NATIVE_GIT_SELECTION_LIMITS,
|
|
437
|
+
maxRecords: Math.max(1, paths.length),
|
|
438
|
+
acceptedExitCodes: [0, 1],
|
|
439
|
+
stdin: Buffer.from(`${paths.join('\0')}\0`, 'utf8'),
|
|
440
|
+
});
|
|
441
|
+
if (result.overflow) {
|
|
442
|
+
throw new Error('Native Git check-ignore output exceeded its safety budget');
|
|
443
|
+
}
|
|
444
|
+
return new Set(result.records.map((record) => {
|
|
445
|
+
const value = decodeGitRecord(record);
|
|
446
|
+
return value.endsWith('/') ? value.slice(0, -1) : value;
|
|
447
|
+
}));
|
|
448
|
+
}
|
|
449
|
+
async function runGitHasOutput(execution, projectRoot, args) {
|
|
450
|
+
const { child, completion } = startNativeGitProcess(execution, projectRoot, args, false);
|
|
451
|
+
const stderr = [];
|
|
452
|
+
let stderrBytes = 0;
|
|
453
|
+
let hasOutput = false;
|
|
454
|
+
child.stdout.on('data', (chunk) => {
|
|
455
|
+
if (chunk.byteLength > 0)
|
|
456
|
+
hasOutput = true;
|
|
457
|
+
});
|
|
458
|
+
child.stderr.on('data', (chunk) => {
|
|
459
|
+
if (stderrBytes >= GIT_LIST_STDERR_LIMIT)
|
|
460
|
+
return;
|
|
461
|
+
const remaining = GIT_LIST_STDERR_LIMIT - stderrBytes;
|
|
462
|
+
const bounded = Buffer.from(chunk).subarray(0, remaining);
|
|
463
|
+
stderr.push(bounded);
|
|
464
|
+
stderrBytes += bounded.byteLength;
|
|
465
|
+
});
|
|
466
|
+
const { code, spawnError } = await completion;
|
|
467
|
+
if (code === 0 && spawnError === null)
|
|
468
|
+
return hasOutput;
|
|
469
|
+
throw new Error(`git ${args.join(' ')} failed${spawnError ? `: ${spawnError.message}` : stderr.length > 0 ? `: ${Buffer.concat(stderr).toString('utf8').trim()}` : ''}`);
|
|
470
|
+
}
|
|
471
|
+
function safeGitProjectPath(value) {
|
|
472
|
+
const withoutDirectoryMarker = value.endsWith('/') ? value.slice(0, -1) : value;
|
|
473
|
+
if (withoutDirectoryMarker.length === 0 ||
|
|
474
|
+
withoutDirectoryMarker.includes('\\') ||
|
|
475
|
+
path.posix.isAbsolute(withoutDirectoryMarker) ||
|
|
476
|
+
/^[A-Za-z]:/u.test(withoutDirectoryMarker) ||
|
|
477
|
+
path.posix.normalize(withoutDirectoryMarker) !== withoutDirectoryMarker ||
|
|
478
|
+
withoutDirectoryMarker === '..' ||
|
|
479
|
+
withoutDirectoryMarker.startsWith('../') ||
|
|
480
|
+
withoutDirectoryMarker.includes('\0')) {
|
|
481
|
+
return null;
|
|
482
|
+
}
|
|
483
|
+
return withoutDirectoryMarker;
|
|
484
|
+
}
|
|
485
|
+
function requireSafeGitProjectPaths(values, source) {
|
|
486
|
+
return values.map((value) => {
|
|
487
|
+
const relative = safeGitProjectPath(value);
|
|
488
|
+
if (relative === null) {
|
|
489
|
+
throw new Error(`Native Git snapshot provider returned an unsafe ${source} path`);
|
|
490
|
+
}
|
|
491
|
+
return relative;
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
async function hasGitMetadataBoundary(projectRoot) {
|
|
495
|
+
let cursor = path.resolve(projectRoot);
|
|
496
|
+
while (true) {
|
|
497
|
+
try {
|
|
498
|
+
await fs.lstat(path.join(cursor, '.git'));
|
|
499
|
+
return true;
|
|
500
|
+
}
|
|
501
|
+
catch (error) {
|
|
502
|
+
if (error.code !== 'ENOENT')
|
|
503
|
+
throw error;
|
|
504
|
+
}
|
|
505
|
+
const parent = path.dirname(cursor);
|
|
506
|
+
if (parent === cursor)
|
|
507
|
+
return false;
|
|
508
|
+
cursor = parent;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
async function readNativeGitSelectionResults(execution, projectRoot, limits, hooks = {}) {
|
|
512
|
+
const options = {
|
|
513
|
+
...limits,
|
|
514
|
+
...(hooks.outputChunkBytes === undefined ? {} : { outputChunkBytes: hooks.outputChunkBytes }),
|
|
515
|
+
};
|
|
516
|
+
const stagedBefore = await runGitNullRecords(execution, projectRoot, ['ls-files', '--stage', '-z'], options);
|
|
517
|
+
await hooks.afterStageBefore?.();
|
|
518
|
+
const combined = await runGitNullRecords(execution, projectRoot, ['ls-files', '--cached', '--others', '--exclude-standard', '-z'], options);
|
|
519
|
+
await hooks.afterCombined?.();
|
|
520
|
+
const stagedAfter = await runGitNullRecords(execution, projectRoot, ['ls-files', '--stage', '-z'], options);
|
|
521
|
+
return { stagedBefore, combined, stagedAfter };
|
|
522
|
+
}
|
|
523
|
+
function gitSelectionFence(results) {
|
|
524
|
+
return {
|
|
525
|
+
stageBefore: gitSelectionStreamEvidence(results.stagedBefore),
|
|
526
|
+
combined: gitSelectionStreamEvidence(results.combined),
|
|
527
|
+
stageAfter: gitSelectionStreamEvidence(results.stagedAfter),
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
async function nativeGitSnapshotSelection(execution, projectRoot, limits = DEFAULT_NATIVE_GIT_SELECTION_LIMITS, hooks = {}) {
|
|
531
|
+
if (!(await hasGitMetadataBoundary(projectRoot)))
|
|
532
|
+
return null;
|
|
533
|
+
let insideWorktree;
|
|
534
|
+
try {
|
|
535
|
+
insideWorktree = await runGitBoundedOutput(execution, projectRoot, [
|
|
536
|
+
'rev-parse',
|
|
537
|
+
'--is-inside-work-tree',
|
|
538
|
+
]);
|
|
539
|
+
}
|
|
540
|
+
catch (error) {
|
|
541
|
+
if (isNativeGitSnapshotTimeout(error))
|
|
542
|
+
throw error;
|
|
543
|
+
throw new Error('Native Git snapshot provider could not inspect the repository boundary', {
|
|
544
|
+
cause: error,
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
if (insideWorktree.toString('utf8').trim() !== 'true') {
|
|
548
|
+
throw new Error('Native Git snapshot provider found .git metadata outside a working tree');
|
|
549
|
+
}
|
|
550
|
+
let results;
|
|
551
|
+
try {
|
|
552
|
+
results = await readNativeGitSelectionResults(execution, projectRoot, limits, hooks);
|
|
553
|
+
}
|
|
554
|
+
catch (error) {
|
|
555
|
+
if (isNativeGitSnapshotTimeout(error))
|
|
556
|
+
throw error;
|
|
557
|
+
throw new Error('Native Git snapshot provider failed after repository detection', {
|
|
558
|
+
cause: error,
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
const { stagedBefore, combined, stagedAfter } = results;
|
|
562
|
+
const tracked = new Set();
|
|
563
|
+
const gitlinks = new Set();
|
|
564
|
+
const addStagedRecords = (records) => {
|
|
565
|
+
for (const encoded of records) {
|
|
566
|
+
const record = decodeGitRecord(encoded);
|
|
567
|
+
const separator = record.indexOf('\t');
|
|
568
|
+
if (separator < 0) {
|
|
569
|
+
throw new Error('Native Git snapshot provider returned a malformed staged record');
|
|
570
|
+
}
|
|
571
|
+
const header = /^(?<mode>[0-7]{6}) (?<objectId>[a-f0-9]{40}|[a-f0-9]{64}) (?<stage>[0-3])$/u.exec(record.slice(0, separator))?.groups;
|
|
572
|
+
if (!header) {
|
|
573
|
+
throw new Error('Native Git snapshot provider returned a malformed staged header');
|
|
574
|
+
}
|
|
575
|
+
const relative = safeGitProjectPath(record.slice(separator + 1));
|
|
576
|
+
if (relative === null) {
|
|
577
|
+
throw new Error('Native Git snapshot provider returned an unsafe staged path');
|
|
578
|
+
}
|
|
579
|
+
tracked.add(relative);
|
|
580
|
+
if (header.mode === '160000' && header.stage === '0')
|
|
581
|
+
gitlinks.add(relative);
|
|
582
|
+
}
|
|
583
|
+
};
|
|
584
|
+
addStagedRecords(stagedBefore.records);
|
|
585
|
+
addStagedRecords(stagedAfter.records);
|
|
586
|
+
const combinedRecords = combined.records.map(decodeGitRecord);
|
|
587
|
+
const combinedPaths = requireSafeGitProjectPaths(combinedRecords, 'combined');
|
|
588
|
+
const untracked = new Set(combinedPaths.filter((relative) => !tracked.has(relative)));
|
|
589
|
+
const nestedRepositories = new Set(combinedPaths.filter((relative, index) => !tracked.has(relative) && combinedRecords[index].endsWith('/')));
|
|
590
|
+
for (const gitlink of gitlinks)
|
|
591
|
+
nestedRepositories.delete(gitlink);
|
|
592
|
+
return {
|
|
593
|
+
tracked,
|
|
594
|
+
untracked,
|
|
595
|
+
gitlinks,
|
|
596
|
+
nestedRepositories,
|
|
597
|
+
omissions: [],
|
|
598
|
+
overflow: null,
|
|
599
|
+
evidence: null,
|
|
600
|
+
initialFence: gitSelectionFence(results),
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
function sameGitSelectionStream(left, right) {
|
|
604
|
+
return (left.hash === right.hash &&
|
|
605
|
+
left.recordCount === right.recordCount &&
|
|
606
|
+
left.storedRecordCount === right.storedRecordCount &&
|
|
607
|
+
left.stdoutBytes === right.stdoutBytes &&
|
|
608
|
+
left.overflow === right.overflow);
|
|
609
|
+
}
|
|
610
|
+
function gitSelectionFenceOverflow(fence) {
|
|
611
|
+
return fence.stageBefore.overflow || fence.combined.overflow || fence.stageAfter.overflow;
|
|
612
|
+
}
|
|
613
|
+
function gitSelectionChanged(initial, final) {
|
|
614
|
+
return (!sameGitSelectionStream(initial.stageBefore, initial.stageAfter) ||
|
|
615
|
+
!sameGitSelectionStream(initial.stageAfter, final.stageBefore) ||
|
|
616
|
+
!sameGitSelectionStream(initial.combined, final.combined) ||
|
|
617
|
+
!sameGitSelectionStream(final.stageBefore, final.stageAfter));
|
|
618
|
+
}
|
|
619
|
+
async function finalizeNativeGitSnapshotSelection(execution, projectRoot, limits, selection, outputChunkBytes) {
|
|
620
|
+
let finalResults;
|
|
621
|
+
try {
|
|
622
|
+
finalResults = await readNativeGitSelectionResults(execution, projectRoot, limits, {
|
|
623
|
+
...(outputChunkBytes === undefined ? {} : { outputChunkBytes }),
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
catch (error) {
|
|
627
|
+
if (isNativeGitSnapshotTimeout(error))
|
|
628
|
+
throw error;
|
|
629
|
+
throw new Error('Native Git snapshot provider failed during its final selection fence', {
|
|
630
|
+
cause: error,
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
const initial = selection.initialFence;
|
|
634
|
+
const final = gitSelectionFence(finalResults);
|
|
635
|
+
const hasOverflow = gitSelectionFenceOverflow(initial) || gitSelectionFenceOverflow(final);
|
|
636
|
+
const changed = gitSelectionChanged(initial, final);
|
|
637
|
+
if (hasOverflow) {
|
|
638
|
+
selection.omissions.push({
|
|
639
|
+
path: '.',
|
|
640
|
+
size: null,
|
|
641
|
+
type: 'directory',
|
|
642
|
+
reason: 'git-enumeration-limit',
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
if (changed) {
|
|
646
|
+
selection.omissions.push({
|
|
647
|
+
path: '.',
|
|
648
|
+
size: null,
|
|
649
|
+
type: 'directory',
|
|
650
|
+
reason: 'git-selection-changed',
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
selection.evidence =
|
|
654
|
+
hasOverflow || changed
|
|
655
|
+
? {
|
|
656
|
+
schema: 'comet.native.git-selection.v1',
|
|
657
|
+
status: hasOverflow && changed ? 'overflow-and-changed' : hasOverflow ? 'overflow' : 'changed',
|
|
658
|
+
...initial,
|
|
659
|
+
finalStageBefore: final.stageBefore,
|
|
660
|
+
finalCombined: final.combined,
|
|
661
|
+
finalStageAfter: final.stageAfter,
|
|
662
|
+
}
|
|
663
|
+
: null;
|
|
664
|
+
if (initial.combined.overflow || final.combined.overflow) {
|
|
665
|
+
selection.overflow = {
|
|
666
|
+
count: Math.max(1, initial.combined.recordCount - initial.combined.storedRecordCount, final.combined.recordCount - final.combined.storedRecordCount),
|
|
667
|
+
hash: sha256Text(`comet.native.git-selection-overflow.v2\n${JSON.stringify({
|
|
668
|
+
initial: initial.combined,
|
|
669
|
+
final: final.combined,
|
|
670
|
+
})}`),
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
const PHYSICAL_SELECTION_SUM_MASK = (1n << 256n) - 1n;
|
|
675
|
+
function physicalSelectionRecordType(stat) {
|
|
676
|
+
if (stat.isFile())
|
|
677
|
+
return 'file';
|
|
678
|
+
if (stat.isDirectory())
|
|
679
|
+
return 'directory';
|
|
680
|
+
if (stat.isSymbolicLink())
|
|
681
|
+
return 'symlink';
|
|
682
|
+
return 'other';
|
|
683
|
+
}
|
|
684
|
+
async function nativePhysicalSnapshotSelection(options) {
|
|
685
|
+
// This is deliberately a cooperative execution budget, not a promise-race timeout. Node's fs
|
|
686
|
+
// promises do not accept AbortSignal; abandoning one would let I/O or a Dir handle live past the
|
|
687
|
+
// snapshot. Every production fs operation is therefore checked on both sides, and any crossing
|
|
688
|
+
// makes the whole physical selection non-overridable overflow evidence.
|
|
689
|
+
const projectRoot = path.resolve(options.paths.projectRoot);
|
|
690
|
+
const nativeRoot = path.resolve(options.paths.nativeRoot);
|
|
691
|
+
const configFile = path.resolve(options.paths.configFile);
|
|
692
|
+
const selectionFile = path.join(projectRoot, '.comet', 'current-change.json');
|
|
693
|
+
const records = [];
|
|
694
|
+
const omissions = [];
|
|
695
|
+
const xor = Buffer.alloc(32);
|
|
696
|
+
let sum = 0n;
|
|
697
|
+
let visitedNodeCount = 0;
|
|
698
|
+
let recordCount = 0;
|
|
699
|
+
let encodedBytes = 0;
|
|
700
|
+
let overflow = false;
|
|
701
|
+
let unstable = false;
|
|
702
|
+
let stopped = false;
|
|
703
|
+
const hasExecutionBudget = () => {
|
|
704
|
+
if (remainingNativeSnapshotTime(options.execution) >= 1)
|
|
705
|
+
return true;
|
|
706
|
+
overflow = true;
|
|
707
|
+
stopped = true;
|
|
708
|
+
return false;
|
|
709
|
+
};
|
|
710
|
+
const addRecord = (record) => {
|
|
711
|
+
const encoded = Buffer.from(`${record.type}\0${record.path}`, 'utf8');
|
|
712
|
+
const digest = createHash('sha256')
|
|
713
|
+
.update('comet.native.physical-selection-record.v1\0')
|
|
714
|
+
.update(encoded)
|
|
715
|
+
.digest();
|
|
716
|
+
for (let index = 0; index < xor.length; index += 1)
|
|
717
|
+
xor[index] ^= digest[index];
|
|
718
|
+
sum = (sum + BigInt(`0x${digest.toString('hex')}`)) & PHYSICAL_SELECTION_SUM_MASK;
|
|
719
|
+
recordCount += 1;
|
|
720
|
+
encodedBytes += encoded.byteLength;
|
|
721
|
+
if (Buffer.byteLength(record.path, 'utf8') > options.limits.maxPathBytes ||
|
|
722
|
+
encodedBytes > options.limits.maxBytes) {
|
|
723
|
+
overflow = true;
|
|
724
|
+
stopped = true;
|
|
725
|
+
return;
|
|
726
|
+
}
|
|
727
|
+
records.push(record);
|
|
728
|
+
};
|
|
729
|
+
const visit = async (directory) => {
|
|
730
|
+
if (stopped)
|
|
731
|
+
return;
|
|
732
|
+
if (!hasExecutionBudget())
|
|
733
|
+
return;
|
|
734
|
+
let handle;
|
|
735
|
+
try {
|
|
736
|
+
handle = await fs.opendir(directory);
|
|
737
|
+
}
|
|
738
|
+
catch (error) {
|
|
739
|
+
if (!hasExecutionBudget())
|
|
740
|
+
return;
|
|
741
|
+
if (!isUnreadableError(error) && !isChangedDuringReadError(error))
|
|
742
|
+
throw error;
|
|
743
|
+
if (directory === projectRoot && isUnreadableError(error))
|
|
744
|
+
throw error;
|
|
745
|
+
unstable ||= isChangedDuringReadError(error);
|
|
746
|
+
overflow ||= isUnreadableError(error);
|
|
747
|
+
stopped = true;
|
|
748
|
+
return;
|
|
749
|
+
}
|
|
750
|
+
if (!hasExecutionBudget()) {
|
|
751
|
+
try {
|
|
752
|
+
await handle.close();
|
|
753
|
+
}
|
|
754
|
+
catch (error) {
|
|
755
|
+
if (error.code !== 'ERR_DIR_CLOSED')
|
|
756
|
+
throw error;
|
|
757
|
+
}
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
760
|
+
let traversalFailed = false;
|
|
761
|
+
let traversalError;
|
|
762
|
+
try {
|
|
763
|
+
while (!stopped) {
|
|
764
|
+
if (!hasExecutionBudget())
|
|
765
|
+
break;
|
|
766
|
+
let child;
|
|
767
|
+
try {
|
|
768
|
+
child = await handle.read();
|
|
769
|
+
}
|
|
770
|
+
catch (error) {
|
|
771
|
+
if (!hasExecutionBudget())
|
|
772
|
+
break;
|
|
773
|
+
if (!isUnreadableError(error) && !isChangedDuringReadError(error))
|
|
774
|
+
throw error;
|
|
775
|
+
if (directory === projectRoot && isUnreadableError(error))
|
|
776
|
+
throw error;
|
|
777
|
+
unstable ||= isChangedDuringReadError(error);
|
|
778
|
+
overflow ||= isUnreadableError(error);
|
|
779
|
+
stopped = true;
|
|
780
|
+
break;
|
|
781
|
+
}
|
|
782
|
+
if (!hasExecutionBudget() || child === null)
|
|
783
|
+
break;
|
|
784
|
+
visitedNodeCount += 1;
|
|
785
|
+
if (visitedNodeCount > options.limits.maxNodes) {
|
|
786
|
+
overflow = true;
|
|
787
|
+
stopped = true;
|
|
788
|
+
break;
|
|
789
|
+
}
|
|
790
|
+
const target = path.join(directory, child.name);
|
|
791
|
+
const relative = portableRelative(projectRoot, target);
|
|
792
|
+
if (target === configFile ||
|
|
793
|
+
target === selectionFile ||
|
|
794
|
+
sameOrInside(nativeRoot, target) ||
|
|
795
|
+
options.denylist.some((denied) => sameOrInside(denied, target)) ||
|
|
796
|
+
nativeSensitiveRelativePathReason(relative) !== null) {
|
|
797
|
+
continue;
|
|
798
|
+
}
|
|
799
|
+
if (!hasExecutionBudget())
|
|
800
|
+
break;
|
|
801
|
+
let stat;
|
|
802
|
+
try {
|
|
803
|
+
stat = await fs.lstat(target);
|
|
804
|
+
}
|
|
805
|
+
catch (error) {
|
|
806
|
+
if (!hasExecutionBudget())
|
|
807
|
+
break;
|
|
808
|
+
if (!isUnreadableError(error) && !isChangedDuringReadError(error))
|
|
809
|
+
throw error;
|
|
810
|
+
unstable = true;
|
|
811
|
+
addRecord({ path: relative, type: 'other' });
|
|
812
|
+
omissions.push({
|
|
813
|
+
path: relative,
|
|
814
|
+
size: null,
|
|
815
|
+
type: 'file',
|
|
816
|
+
reason: isUnreadableError(error) ? 'unreadable' : 'changed-during-read',
|
|
817
|
+
});
|
|
818
|
+
await options.hooks?.afterNode?.(relative);
|
|
819
|
+
if (stopped)
|
|
820
|
+
break;
|
|
821
|
+
if (!hasExecutionBudget())
|
|
822
|
+
break;
|
|
823
|
+
continue;
|
|
824
|
+
}
|
|
825
|
+
if (!hasExecutionBudget())
|
|
826
|
+
break;
|
|
827
|
+
const type = physicalSelectionRecordType(stat);
|
|
828
|
+
if (type === 'directory') {
|
|
829
|
+
if (!hasExecutionBudget())
|
|
830
|
+
break;
|
|
831
|
+
let realDirectory;
|
|
832
|
+
try {
|
|
833
|
+
realDirectory = await fs.realpath(target);
|
|
834
|
+
}
|
|
835
|
+
catch (error) {
|
|
836
|
+
if (!hasExecutionBudget())
|
|
837
|
+
break;
|
|
838
|
+
if (!isUnreadableError(error) && !isChangedDuringReadError(error))
|
|
839
|
+
throw error;
|
|
840
|
+
unstable = true;
|
|
841
|
+
addRecord({ path: relative, type });
|
|
842
|
+
omissions.push({
|
|
843
|
+
path: relative,
|
|
844
|
+
size: null,
|
|
845
|
+
type: 'directory',
|
|
846
|
+
reason: isUnreadableError(error) ? 'unreadable' : 'changed-during-read',
|
|
847
|
+
});
|
|
848
|
+
await options.hooks?.afterNode?.(relative);
|
|
849
|
+
if (stopped)
|
|
850
|
+
break;
|
|
851
|
+
if (!hasExecutionBudget())
|
|
852
|
+
break;
|
|
853
|
+
continue;
|
|
854
|
+
}
|
|
855
|
+
if (!hasExecutionBudget())
|
|
856
|
+
break;
|
|
857
|
+
if (!isInsidePath(options.physicalProjectRoot, realDirectory) ||
|
|
858
|
+
sameOrInside(options.physicalNativeRoot, realDirectory)) {
|
|
859
|
+
continue;
|
|
860
|
+
}
|
|
861
|
+
addRecord({ path: relative, type });
|
|
862
|
+
await options.hooks?.afterNode?.(relative);
|
|
863
|
+
if (!hasExecutionBudget())
|
|
864
|
+
break;
|
|
865
|
+
await visit(target);
|
|
866
|
+
if (stopped)
|
|
867
|
+
break;
|
|
868
|
+
continue;
|
|
869
|
+
}
|
|
870
|
+
addRecord({ path: relative, type });
|
|
871
|
+
await options.hooks?.afterNode?.(relative);
|
|
872
|
+
if (!hasExecutionBudget())
|
|
873
|
+
break;
|
|
874
|
+
if (stopped)
|
|
875
|
+
break;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
catch (error) {
|
|
879
|
+
traversalFailed = true;
|
|
880
|
+
traversalError = error;
|
|
881
|
+
}
|
|
882
|
+
let closeError;
|
|
883
|
+
try {
|
|
884
|
+
await handle.close();
|
|
885
|
+
}
|
|
886
|
+
catch (error) {
|
|
887
|
+
closeError = error;
|
|
888
|
+
}
|
|
889
|
+
const withinBudget = hasExecutionBudget();
|
|
890
|
+
if (traversalFailed)
|
|
891
|
+
throw traversalError;
|
|
892
|
+
if (withinBudget &&
|
|
893
|
+
closeError !== undefined &&
|
|
894
|
+
closeError.code !== 'ERR_DIR_CLOSED') {
|
|
895
|
+
throw closeError;
|
|
896
|
+
}
|
|
897
|
+
};
|
|
898
|
+
await visit(projectRoot);
|
|
899
|
+
hasExecutionBudget();
|
|
900
|
+
if (overflow) {
|
|
901
|
+
// The tail is intentionally unbound once a hard enumeration budget is crossed. Discard the
|
|
902
|
+
// order-dependent prefix entirely; callers must treat this evidence as non-overridable.
|
|
903
|
+
records.length = 0;
|
|
904
|
+
recordCount = 0;
|
|
905
|
+
encodedBytes = 0;
|
|
906
|
+
}
|
|
907
|
+
else {
|
|
908
|
+
records.sort((left, right) => left.path.localeCompare(right.path, 'en'));
|
|
909
|
+
omissions.sort((left, right) => left.path.localeCompare(right.path, 'en'));
|
|
910
|
+
}
|
|
911
|
+
const hash = overflow
|
|
912
|
+
? sha256Text(`comet.native.physical-selection-incomplete.v1\n${JSON.stringify({
|
|
913
|
+
maxNodes: options.limits.maxNodes,
|
|
914
|
+
maxBytes: options.limits.maxBytes,
|
|
915
|
+
maxPathBytes: options.limits.maxPathBytes,
|
|
916
|
+
})}`)
|
|
917
|
+
: sha256Text(`comet.native.physical-selection.v1\n${JSON.stringify({
|
|
918
|
+
visitedNodeCount,
|
|
919
|
+
recordCount,
|
|
920
|
+
encodedBytes,
|
|
921
|
+
xor: xor.toString('hex'),
|
|
922
|
+
sum: sum.toString(16).padStart(64, '0'),
|
|
923
|
+
})}`);
|
|
924
|
+
return {
|
|
925
|
+
records,
|
|
926
|
+
omissions,
|
|
927
|
+
evidence: {
|
|
928
|
+
hash,
|
|
929
|
+
visitedNodeCount,
|
|
930
|
+
recordCount,
|
|
931
|
+
storedRecordCount: records.length,
|
|
932
|
+
encodedBytes,
|
|
933
|
+
overflow,
|
|
934
|
+
unstable,
|
|
935
|
+
},
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
function samePhysicalSelectionStream(left, right) {
|
|
939
|
+
return (left.hash === right.hash &&
|
|
940
|
+
left.visitedNodeCount === right.visitedNodeCount &&
|
|
941
|
+
left.recordCount === right.recordCount &&
|
|
942
|
+
left.storedRecordCount === right.storedRecordCount &&
|
|
943
|
+
left.encodedBytes === right.encodedBytes &&
|
|
944
|
+
left.overflow === right.overflow &&
|
|
945
|
+
left.unstable === right.unstable);
|
|
946
|
+
}
|
|
947
|
+
function finalizeNativePhysicalSelection(before, after) {
|
|
948
|
+
const hasOverflow = before.overflow || after.overflow;
|
|
949
|
+
const changed = before.unstable || after.unstable || !samePhysicalSelectionStream(before, after);
|
|
950
|
+
const omissions = [];
|
|
951
|
+
if (hasOverflow) {
|
|
952
|
+
omissions.push({
|
|
953
|
+
path: '.',
|
|
954
|
+
size: null,
|
|
955
|
+
type: 'directory',
|
|
956
|
+
reason: 'physical-enumeration-limit',
|
|
957
|
+
});
|
|
958
|
+
}
|
|
959
|
+
if (changed) {
|
|
960
|
+
omissions.push({
|
|
961
|
+
path: '.',
|
|
962
|
+
size: null,
|
|
963
|
+
type: 'directory',
|
|
964
|
+
reason: 'physical-selection-changed',
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
return {
|
|
968
|
+
omissions,
|
|
969
|
+
evidence: hasOverflow || changed
|
|
970
|
+
? {
|
|
971
|
+
schema: 'comet.native.physical-selection.v1',
|
|
972
|
+
status: hasOverflow && changed
|
|
973
|
+
? 'overflow-and-changed'
|
|
974
|
+
: hasOverflow
|
|
975
|
+
? 'overflow'
|
|
976
|
+
: 'changed',
|
|
977
|
+
before,
|
|
978
|
+
after,
|
|
979
|
+
}
|
|
980
|
+
: null,
|
|
981
|
+
};
|
|
982
|
+
}
|
|
983
|
+
function selectionPaths(selection) {
|
|
984
|
+
return [...new Set([...selection.tracked, ...selection.untracked])].sort((left, right) => left.localeCompare(right, 'en'));
|
|
985
|
+
}
|
|
986
|
+
async function readGitlinkWorkingTreeHeadHash(execution, target) {
|
|
987
|
+
const output = await runGitBoundedOutput(execution, target, ['rev-parse', '--verify', 'HEAD']);
|
|
988
|
+
const objectId = output.toString('utf8').trim().toLowerCase();
|
|
989
|
+
if (!GIT_OBJECT_ID_PATTERN.test(objectId)) {
|
|
990
|
+
throw new Error('Native Git snapshot provider received an invalid submodule HEAD');
|
|
991
|
+
}
|
|
992
|
+
return sha256Text(`gitlink:${objectId}`);
|
|
993
|
+
}
|
|
994
|
+
async function inspectGitlinkWorkingTree(execution, target) {
|
|
995
|
+
const before = await readGitlinkWorkingTreeHeadHash(execution, target);
|
|
996
|
+
const dirty = await runGitHasOutput(execution, target, [
|
|
997
|
+
'status',
|
|
998
|
+
'--porcelain=v1',
|
|
999
|
+
'-z',
|
|
1000
|
+
'--untracked-files=normal',
|
|
1001
|
+
]);
|
|
1002
|
+
const after = await readGitlinkWorkingTreeHeadHash(execution, target);
|
|
1003
|
+
if (after !== before) {
|
|
1004
|
+
throw new Error('Native Git snapshot provider observed a changing submodule HEAD');
|
|
1005
|
+
}
|
|
1006
|
+
return { hash: after, dirty };
|
|
1007
|
+
}
|
|
1008
|
+
function isSnapshotProjectRef(paths, relative) {
|
|
1009
|
+
if (nativeSensitiveRelativePathReason(relative) !== null)
|
|
1010
|
+
return false;
|
|
1011
|
+
const target = path.resolve(paths.projectRoot, ...relative.split('/'));
|
|
1012
|
+
return !sameOrInside(path.resolve(paths.nativeRoot), target);
|
|
1013
|
+
}
|
|
1014
|
+
export function inspectNativeContentSnapshotHealth(value, options = {}) {
|
|
1015
|
+
const manifest = parseNativeContentSnapshotManifest(value);
|
|
1016
|
+
const maxRecordedPaths = options.maxRecordedPaths ?? 20;
|
|
1017
|
+
if (!Number.isSafeInteger(maxRecordedPaths) || maxRecordedPaths < 0) {
|
|
1018
|
+
throw new Error('Native snapshot health maxRecordedPaths must be a non-negative integer');
|
|
1019
|
+
}
|
|
1020
|
+
const samplePaths = manifest.omitted.slice(0, maxRecordedPaths).map((omission) => omission.path);
|
|
1021
|
+
return {
|
|
1022
|
+
complete: manifest.complete,
|
|
1023
|
+
omittedCount: manifest.omittedCount,
|
|
1024
|
+
recordedOmissionCount: manifest.omitted.length,
|
|
1025
|
+
overflowCount: manifest.omissionOverflow?.count ?? 0,
|
|
1026
|
+
samplePaths,
|
|
1027
|
+
sampleTruncated: samplePaths.length < manifest.omittedCount,
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
function portableRelative(root, target) {
|
|
1031
|
+
return path.relative(root, target).split(path.sep).join('/');
|
|
1032
|
+
}
|
|
1033
|
+
function normalizedDenylist(projectRoot, values) {
|
|
1034
|
+
return values.map((value) => path.resolve(projectRoot, ...value.split(/[\\/]/u)));
|
|
1035
|
+
}
|
|
1036
|
+
function sameOrInside(root, target) {
|
|
1037
|
+
const normalizedRoot = path.resolve(root);
|
|
1038
|
+
const normalizedTarget = path.resolve(target);
|
|
1039
|
+
return normalizedTarget === normalizedRoot || isInsidePath(normalizedRoot, normalizedTarget);
|
|
1040
|
+
}
|
|
1041
|
+
function isUnreadableError(error) {
|
|
1042
|
+
return UNREADABLE_ERROR_CODES.has(error.code ?? '');
|
|
1043
|
+
}
|
|
1044
|
+
function isChangedDuringReadError(error) {
|
|
1045
|
+
return error.code === 'ENOENT';
|
|
1046
|
+
}
|
|
1047
|
+
function serializedManifestBytes(manifest) {
|
|
1048
|
+
return Buffer.byteLength(JSON.stringify(manifest, null, 2) + '\n');
|
|
1049
|
+
}
|
|
1050
|
+
function snapshotPolicyHash(include, exclude) {
|
|
1051
|
+
return sha256Text(`comet.native.snapshot-policy.v1\n${JSON.stringify({ include, exclude, hash: 'sha256' })}`);
|
|
1052
|
+
}
|
|
1053
|
+
function epsilonClosure(tokens, positions, checkpoint) {
|
|
1054
|
+
const closure = new Set(positions);
|
|
1055
|
+
const pending = [...positions];
|
|
1056
|
+
while (pending.length > 0) {
|
|
1057
|
+
if (checkpoint && !checkpoint())
|
|
1058
|
+
return null;
|
|
1059
|
+
const position = pending.pop();
|
|
1060
|
+
const token = tokens[position];
|
|
1061
|
+
if (token &&
|
|
1062
|
+
(token.kind === 'star' || token.kind === 'globstar' || token.kind === 'globstar-slash') &&
|
|
1063
|
+
!closure.has(position + 1)) {
|
|
1064
|
+
closure.add(position + 1);
|
|
1065
|
+
pending.push(position + 1);
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
return closure;
|
|
1069
|
+
}
|
|
1070
|
+
function cooperativePatternCheckpoint(hasBudget) {
|
|
1071
|
+
let operationsUntilCheck = 0;
|
|
1072
|
+
return () => {
|
|
1073
|
+
if (operationsUntilCheck > 0) {
|
|
1074
|
+
operationsUntilCheck -= 1;
|
|
1075
|
+
return true;
|
|
1076
|
+
}
|
|
1077
|
+
if (!hasBudget())
|
|
1078
|
+
return false;
|
|
1079
|
+
operationsUntilCheck = 63;
|
|
1080
|
+
return true;
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1083
|
+
export function compileNativeSnapshotPattern(pattern) {
|
|
1084
|
+
const normalized = normalizeNativeSnapshotPattern(pattern, 'Native snapshot pattern');
|
|
1085
|
+
const tokens = [];
|
|
1086
|
+
for (let index = 0; index < normalized.length; index += 1) {
|
|
1087
|
+
const character = normalized[index];
|
|
1088
|
+
if (character === '*' && normalized[index + 1] === '*') {
|
|
1089
|
+
index += 1;
|
|
1090
|
+
if (normalized[index + 1] === '/') {
|
|
1091
|
+
index += 1;
|
|
1092
|
+
tokens.push({ kind: 'globstar-slash' });
|
|
1093
|
+
}
|
|
1094
|
+
else {
|
|
1095
|
+
tokens.push({ kind: 'globstar' });
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
else if (character === '*') {
|
|
1099
|
+
tokens.push({ kind: 'star' });
|
|
1100
|
+
}
|
|
1101
|
+
else if (character === '?') {
|
|
1102
|
+
tokens.push({ kind: 'question' });
|
|
1103
|
+
}
|
|
1104
|
+
else {
|
|
1105
|
+
tokens.push({ kind: 'literal', value: character });
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
return (relative, hasBudget) => {
|
|
1109
|
+
const checkpoint = hasBudget ? cooperativePatternCheckpoint(hasBudget) : undefined;
|
|
1110
|
+
if (checkpoint && !checkpoint())
|
|
1111
|
+
return false;
|
|
1112
|
+
let positions = epsilonClosure(tokens, new Set([0]), checkpoint);
|
|
1113
|
+
if (positions === null)
|
|
1114
|
+
return false;
|
|
1115
|
+
for (const character of relative) {
|
|
1116
|
+
if (checkpoint && !checkpoint())
|
|
1117
|
+
return false;
|
|
1118
|
+
const next = new Set();
|
|
1119
|
+
for (const position of positions) {
|
|
1120
|
+
if (checkpoint && !checkpoint())
|
|
1121
|
+
return false;
|
|
1122
|
+
const token = tokens[position];
|
|
1123
|
+
if (!token)
|
|
1124
|
+
continue;
|
|
1125
|
+
if (token.kind === 'literal' && token.value === character) {
|
|
1126
|
+
next.add(position + 1);
|
|
1127
|
+
}
|
|
1128
|
+
else if (token.kind === 'question' && character !== '/') {
|
|
1129
|
+
next.add(position + 1);
|
|
1130
|
+
}
|
|
1131
|
+
else if (token.kind === 'star' && character !== '/') {
|
|
1132
|
+
next.add(position);
|
|
1133
|
+
}
|
|
1134
|
+
else if (token.kind === 'globstar') {
|
|
1135
|
+
next.add(position);
|
|
1136
|
+
}
|
|
1137
|
+
else if (token.kind === 'globstar-slash') {
|
|
1138
|
+
next.add(position);
|
|
1139
|
+
if (character === '/')
|
|
1140
|
+
next.add(position + 1);
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
positions = epsilonClosure(tokens, next, checkpoint);
|
|
1144
|
+
if (positions === null)
|
|
1145
|
+
return false;
|
|
1146
|
+
if (positions.size === 0)
|
|
1147
|
+
return false;
|
|
1148
|
+
}
|
|
1149
|
+
return epsilonClosure(tokens, positions, checkpoint)?.has(tokens.length) ?? false;
|
|
1150
|
+
};
|
|
1151
|
+
}
|
|
1152
|
+
function resolveSnapshotPolicy(value) {
|
|
1153
|
+
if (value === undefined)
|
|
1154
|
+
return undefined;
|
|
1155
|
+
const include = [
|
|
1156
|
+
...new Set(value.include.map((item) => normalizeNativeSnapshotPattern(item, 'include'))),
|
|
1157
|
+
].sort((left, right) => left.localeCompare(right, 'en'));
|
|
1158
|
+
const exclude = [
|
|
1159
|
+
...new Set(value.exclude.map((item) => normalizeNativeSnapshotPattern(item, 'exclude'))),
|
|
1160
|
+
].sort((left, right) => left.localeCompare(right, 'en'));
|
|
1161
|
+
if (include.length === 0)
|
|
1162
|
+
throw new Error('Native snapshot policy include must not be empty');
|
|
1163
|
+
const hash = snapshotPolicyHash(include, exclude);
|
|
1164
|
+
if ('hash' in value && value.hash !== hash) {
|
|
1165
|
+
throw new Error('Native snapshot policy hash is invalid');
|
|
1166
|
+
}
|
|
1167
|
+
return {
|
|
1168
|
+
manifest: {
|
|
1169
|
+
schema: 'comet.native.snapshot-policy.v1',
|
|
1170
|
+
include,
|
|
1171
|
+
exclude,
|
|
1172
|
+
hash,
|
|
1173
|
+
},
|
|
1174
|
+
includeMatchers: include.map(compileNativeSnapshotPattern),
|
|
1175
|
+
excludeMatchers: exclude.map(compileNativeSnapshotPattern),
|
|
1176
|
+
};
|
|
1177
|
+
}
|
|
1178
|
+
function snapshotPolicyIncludes(policy, relative, execution) {
|
|
1179
|
+
if (!policy)
|
|
1180
|
+
return true;
|
|
1181
|
+
const hasBudget = () => nativeSnapshotExecutionHasBudget(execution);
|
|
1182
|
+
let included = false;
|
|
1183
|
+
for (const matcher of policy.includeMatchers) {
|
|
1184
|
+
if (!hasBudget())
|
|
1185
|
+
return false;
|
|
1186
|
+
if (matcher(relative, hasBudget)) {
|
|
1187
|
+
included = true;
|
|
1188
|
+
break;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
if (!included)
|
|
1192
|
+
return false;
|
|
1193
|
+
for (const matcher of policy.excludeMatchers) {
|
|
1194
|
+
if (!hasBudget())
|
|
1195
|
+
return false;
|
|
1196
|
+
if (matcher(relative, hasBudget))
|
|
1197
|
+
return false;
|
|
1198
|
+
}
|
|
1199
|
+
return true;
|
|
1200
|
+
}
|
|
1201
|
+
function foldSnapshotOverflowHash(previous, kind, value) {
|
|
1202
|
+
const payload = JSON.stringify(value);
|
|
1203
|
+
return sha256Text(`${previous}\n${Buffer.byteLength(kind)}:${kind}\n${Buffer.byteLength(payload)}:${payload}`);
|
|
1204
|
+
}
|
|
1205
|
+
function isSelectionIntegrityOmission(omission) {
|
|
1206
|
+
return (omission.reason === 'git-enumeration-limit' ||
|
|
1207
|
+
omission.reason === 'git-selection-changed' ||
|
|
1208
|
+
omission.reason === 'physical-enumeration-limit' ||
|
|
1209
|
+
omission.reason === 'physical-selection-changed');
|
|
1210
|
+
}
|
|
1211
|
+
function takeLastCompactableOmission(omissions) {
|
|
1212
|
+
for (let index = omissions.length - 1; index >= 0; index -= 1) {
|
|
1213
|
+
const omission = omissions[index];
|
|
1214
|
+
if (isSelectionIntegrityOmission(omission))
|
|
1215
|
+
continue;
|
|
1216
|
+
omissions.splice(index, 1);
|
|
1217
|
+
return omission;
|
|
1218
|
+
}
|
|
1219
|
+
return null;
|
|
1220
|
+
}
|
|
1221
|
+
function sameFileIdentity(left, right) {
|
|
1222
|
+
const leftObject = { ...left, birthtime: left.birthtimeMs };
|
|
1223
|
+
const rightObject = { ...right, birthtime: right.birthtimeMs };
|
|
1224
|
+
if (hasComparableNativeFileObject(leftObject, rightObject)) {
|
|
1225
|
+
return sameNativeFileObject(leftObject, rightObject);
|
|
1226
|
+
}
|
|
1227
|
+
return (sameNativeFileObject(leftObject, rightObject) &&
|
|
1228
|
+
left.birthtimeMs === right.birthtimeMs &&
|
|
1229
|
+
left.ctimeMs === right.ctimeMs &&
|
|
1230
|
+
left.size === right.size);
|
|
1231
|
+
}
|
|
1232
|
+
async function sha256FileBounded(file, maxBytes, expected, execution) {
|
|
1233
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
1234
|
+
return { status: 'budget-exhausted' };
|
|
1235
|
+
let handle;
|
|
1236
|
+
try {
|
|
1237
|
+
handle = await fs.open(file, 'r');
|
|
1238
|
+
}
|
|
1239
|
+
catch (error) {
|
|
1240
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
1241
|
+
return { status: 'budget-exhausted' };
|
|
1242
|
+
throw error;
|
|
1243
|
+
}
|
|
1244
|
+
if (!nativeSnapshotExecutionHasBudget(execution)) {
|
|
1245
|
+
await handle.close();
|
|
1246
|
+
return { status: 'budget-exhausted' };
|
|
1247
|
+
}
|
|
1248
|
+
const hash = createHash('sha256');
|
|
1249
|
+
const buffer = Buffer.allocUnsafe(Math.min(64 * 1024, maxBytes + 1));
|
|
1250
|
+
let bytes = 0;
|
|
1251
|
+
try {
|
|
1252
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
1253
|
+
return { status: 'budget-exhausted' };
|
|
1254
|
+
const opened = await handle.stat();
|
|
1255
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
1256
|
+
return { status: 'budget-exhausted' };
|
|
1257
|
+
if (!opened.isFile() || !sameFileIdentity(expected, opened))
|
|
1258
|
+
return { status: 'changed' };
|
|
1259
|
+
while (true) {
|
|
1260
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
1261
|
+
return { status: 'budget-exhausted' };
|
|
1262
|
+
const remaining = maxBytes + 1 - bytes;
|
|
1263
|
+
if (remaining < 1)
|
|
1264
|
+
return { status: 'changed' };
|
|
1265
|
+
const result = await handle.read(buffer, 0, Math.min(buffer.length, remaining), null);
|
|
1266
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
1267
|
+
return { status: 'budget-exhausted' };
|
|
1268
|
+
if (result.bytesRead === 0) {
|
|
1269
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
1270
|
+
return { status: 'budget-exhausted' };
|
|
1271
|
+
const finalStat = await handle.stat();
|
|
1272
|
+
if (!nativeSnapshotExecutionHasBudget(execution)) {
|
|
1273
|
+
return { status: 'budget-exhausted' };
|
|
1274
|
+
}
|
|
1275
|
+
if (!finalStat.isFile() || !sameFileIdentity(opened, finalStat)) {
|
|
1276
|
+
return { status: 'changed' };
|
|
1277
|
+
}
|
|
1278
|
+
return { status: 'complete', hash: hash.digest('hex'), bytes, finalStat };
|
|
1279
|
+
}
|
|
1280
|
+
if (bytes + result.bytesRead > maxBytes)
|
|
1281
|
+
return { status: 'changed' };
|
|
1282
|
+
hash.update(buffer.subarray(0, result.bytesRead));
|
|
1283
|
+
bytes += result.bytesRead;
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
finally {
|
|
1287
|
+
await handle.close();
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
function record(value, label) {
|
|
1291
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
1292
|
+
throw new Error(`${label} must be an object`);
|
|
1293
|
+
}
|
|
1294
|
+
return value;
|
|
1295
|
+
}
|
|
1296
|
+
function rejectUnknown(value, keys, label) {
|
|
1297
|
+
const unknown = Object.keys(value).find((key) => !keys.has(key));
|
|
1298
|
+
if (unknown)
|
|
1299
|
+
throw new Error(`${label} contains unknown field: ${unknown}`);
|
|
1300
|
+
}
|
|
1301
|
+
function positiveInteger(value, label) {
|
|
1302
|
+
if (!Number.isSafeInteger(value) || value < 1) {
|
|
1303
|
+
throw new Error(`${label} must be a positive integer`);
|
|
1304
|
+
}
|
|
1305
|
+
return value;
|
|
1306
|
+
}
|
|
1307
|
+
function nonNegativeInteger(value, label) {
|
|
1308
|
+
if (!Number.isSafeInteger(value) || value < 0) {
|
|
1309
|
+
throw new Error(`${label} must be a non-negative integer`);
|
|
1310
|
+
}
|
|
1311
|
+
return value;
|
|
1312
|
+
}
|
|
1313
|
+
function snapshotPath(value, label) {
|
|
1314
|
+
if (typeof value !== 'string' ||
|
|
1315
|
+
value.length === 0 ||
|
|
1316
|
+
value.includes('\\') ||
|
|
1317
|
+
value.includes('\0')) {
|
|
1318
|
+
throw new Error(`${label} must be a normalized project-relative path`);
|
|
1319
|
+
}
|
|
1320
|
+
const normalized = path.posix.normalize(value);
|
|
1321
|
+
if (normalized !== value ||
|
|
1322
|
+
path.posix.isAbsolute(value) ||
|
|
1323
|
+
normalized === '..' ||
|
|
1324
|
+
normalized.startsWith('../')) {
|
|
1325
|
+
throw new Error(`${label} must stay inside the project root`);
|
|
1326
|
+
}
|
|
1327
|
+
return value;
|
|
1328
|
+
}
|
|
1329
|
+
function parseEntry(value, index) {
|
|
1330
|
+
const entry = record(value, `Native snapshot entry ${index}`);
|
|
1331
|
+
rejectUnknown(entry, ENTRY_KEYS, `Native snapshot entry ${index}`);
|
|
1332
|
+
const entryPath = snapshotPath(entry.path, `Native snapshot entry ${index} path`);
|
|
1333
|
+
if (typeof entry.hash !== 'string' || !HASH_PATTERN.test(entry.hash)) {
|
|
1334
|
+
throw new Error(`Native snapshot entry ${index} hash is invalid`);
|
|
1335
|
+
}
|
|
1336
|
+
if (entry.type !== 'file')
|
|
1337
|
+
throw new Error(`Native snapshot entry ${index} type is invalid`);
|
|
1338
|
+
return {
|
|
1339
|
+
path: entryPath,
|
|
1340
|
+
hash: entry.hash,
|
|
1341
|
+
size: nonNegativeInteger(entry.size, `Native snapshot entry ${index} size`),
|
|
1342
|
+
type: 'file',
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1345
|
+
function parseOmission(value, index) {
|
|
1346
|
+
const omission = record(value, `Native snapshot omission ${index}`);
|
|
1347
|
+
rejectUnknown(omission, OMISSION_KEYS, `Native snapshot omission ${index}`);
|
|
1348
|
+
if (!OMISSION_TYPES.has(omission.type)) {
|
|
1349
|
+
throw new Error(`Native snapshot omission ${index} type is invalid`);
|
|
1350
|
+
}
|
|
1351
|
+
if (!OMISSION_REASONS.has(omission.reason)) {
|
|
1352
|
+
throw new Error(`Native snapshot omission ${index} reason is invalid`);
|
|
1353
|
+
}
|
|
1354
|
+
return {
|
|
1355
|
+
path: snapshotPath(omission.path, `Native snapshot omission ${index} path`),
|
|
1356
|
+
size: omission.size === null
|
|
1357
|
+
? null
|
|
1358
|
+
: nonNegativeInteger(omission.size, `Native snapshot omission ${index} size`),
|
|
1359
|
+
type: omission.type,
|
|
1360
|
+
reason: omission.reason,
|
|
1361
|
+
};
|
|
1362
|
+
}
|
|
1363
|
+
function parseOmissionOverflow(value) {
|
|
1364
|
+
const overflow = record(value, 'Native snapshot omission overflow');
|
|
1365
|
+
rejectUnknown(overflow, OMISSION_OVERFLOW_KEYS, 'Native snapshot omission overflow');
|
|
1366
|
+
if (typeof overflow.hash !== 'string' || !HASH_PATTERN.test(overflow.hash)) {
|
|
1367
|
+
throw new Error('Native snapshot omission overflow hash is invalid');
|
|
1368
|
+
}
|
|
1369
|
+
const expectedRef = `native-snapshot://omitted-overflow/${overflow.hash}`;
|
|
1370
|
+
if (overflow.ref !== expectedRef) {
|
|
1371
|
+
throw new Error('Native snapshot omission overflow ref is invalid');
|
|
1372
|
+
}
|
|
1373
|
+
return {
|
|
1374
|
+
ref: expectedRef,
|
|
1375
|
+
hash: overflow.hash,
|
|
1376
|
+
count: positiveInteger(overflow.count, 'Native snapshot omission overflow count'),
|
|
1377
|
+
};
|
|
1378
|
+
}
|
|
1379
|
+
function parseGitSelectionStreamEvidence(value, label) {
|
|
1380
|
+
const stream = record(value, label);
|
|
1381
|
+
rejectUnknown(stream, GIT_SELECTION_STREAM_KEYS, label);
|
|
1382
|
+
if (typeof stream.hash !== 'string' || !HASH_PATTERN.test(stream.hash)) {
|
|
1383
|
+
throw new Error(`${label} hash is invalid`);
|
|
1384
|
+
}
|
|
1385
|
+
if (typeof stream.overflow !== 'boolean') {
|
|
1386
|
+
throw new Error(`${label} overflow flag is invalid`);
|
|
1387
|
+
}
|
|
1388
|
+
const recordCount = nonNegativeInteger(stream.recordCount, `${label} recordCount`);
|
|
1389
|
+
const storedRecordCount = nonNegativeInteger(stream.storedRecordCount, `${label} storedRecordCount`);
|
|
1390
|
+
const stdoutBytes = nonNegativeInteger(stream.stdoutBytes, `${label} stdoutBytes`);
|
|
1391
|
+
if (storedRecordCount > recordCount || (!stream.overflow && storedRecordCount !== recordCount)) {
|
|
1392
|
+
throw new Error(`${label} stored record count is inconsistent`);
|
|
1393
|
+
}
|
|
1394
|
+
return {
|
|
1395
|
+
hash: stream.hash,
|
|
1396
|
+
recordCount,
|
|
1397
|
+
storedRecordCount,
|
|
1398
|
+
stdoutBytes,
|
|
1399
|
+
overflow: stream.overflow,
|
|
1400
|
+
};
|
|
1401
|
+
}
|
|
1402
|
+
function parseGitSelectionEvidence(value) {
|
|
1403
|
+
const selection = record(value, 'Native Git selection evidence');
|
|
1404
|
+
rejectUnknown(selection, GIT_SELECTION_KEYS, 'Native Git selection evidence');
|
|
1405
|
+
if (selection.schema !== 'comet.native.git-selection.v1') {
|
|
1406
|
+
throw new Error('Native Git selection evidence schema is invalid');
|
|
1407
|
+
}
|
|
1408
|
+
if (selection.status !== 'overflow' &&
|
|
1409
|
+
selection.status !== 'changed' &&
|
|
1410
|
+
selection.status !== 'overflow-and-changed') {
|
|
1411
|
+
throw new Error('Native Git selection evidence status is invalid');
|
|
1412
|
+
}
|
|
1413
|
+
const stageBefore = parseGitSelectionStreamEvidence(selection.stageBefore, 'Native Git selection stageBefore');
|
|
1414
|
+
const combined = parseGitSelectionStreamEvidence(selection.combined, 'Native Git selection combined');
|
|
1415
|
+
const stageAfter = parseGitSelectionStreamEvidence(selection.stageAfter, 'Native Git selection stageAfter');
|
|
1416
|
+
const finalStageBefore = parseGitSelectionStreamEvidence(selection.finalStageBefore, 'Native Git selection finalStageBefore');
|
|
1417
|
+
const finalCombined = parseGitSelectionStreamEvidence(selection.finalCombined, 'Native Git selection finalCombined');
|
|
1418
|
+
const finalStageAfter = parseGitSelectionStreamEvidence(selection.finalStageAfter, 'Native Git selection finalStageAfter');
|
|
1419
|
+
const hasOverflow = [
|
|
1420
|
+
stageBefore,
|
|
1421
|
+
combined,
|
|
1422
|
+
stageAfter,
|
|
1423
|
+
finalStageBefore,
|
|
1424
|
+
finalCombined,
|
|
1425
|
+
finalStageAfter,
|
|
1426
|
+
].some((stream) => stream.overflow);
|
|
1427
|
+
const changed = !sameGitSelectionStream(stageBefore, stageAfter) ||
|
|
1428
|
+
!sameGitSelectionStream(stageAfter, finalStageBefore) ||
|
|
1429
|
+
!sameGitSelectionStream(combined, finalCombined) ||
|
|
1430
|
+
!sameGitSelectionStream(finalStageBefore, finalStageAfter);
|
|
1431
|
+
const expectedStatus = hasOverflow && changed ? 'overflow-and-changed' : hasOverflow ? 'overflow' : 'changed';
|
|
1432
|
+
if (!hasOverflow && !changed) {
|
|
1433
|
+
throw new Error('Native Git selection evidence must describe an exceptional selection');
|
|
1434
|
+
}
|
|
1435
|
+
if (selection.status !== expectedStatus) {
|
|
1436
|
+
throw new Error('Native Git selection evidence status is inconsistent');
|
|
1437
|
+
}
|
|
1438
|
+
return {
|
|
1439
|
+
schema: 'comet.native.git-selection.v1',
|
|
1440
|
+
status: expectedStatus,
|
|
1441
|
+
stageBefore,
|
|
1442
|
+
combined,
|
|
1443
|
+
stageAfter,
|
|
1444
|
+
finalStageBefore,
|
|
1445
|
+
finalCombined,
|
|
1446
|
+
finalStageAfter,
|
|
1447
|
+
};
|
|
1448
|
+
}
|
|
1449
|
+
function parsePhysicalSelectionStreamEvidence(value, label) {
|
|
1450
|
+
const stream = record(value, label);
|
|
1451
|
+
rejectUnknown(stream, PHYSICAL_SELECTION_STREAM_KEYS, label);
|
|
1452
|
+
if (typeof stream.hash !== 'string' || !HASH_PATTERN.test(stream.hash)) {
|
|
1453
|
+
throw new Error(`${label} hash is invalid`);
|
|
1454
|
+
}
|
|
1455
|
+
if (typeof stream.overflow !== 'boolean' || typeof stream.unstable !== 'boolean') {
|
|
1456
|
+
throw new Error(`${label} flags are invalid`);
|
|
1457
|
+
}
|
|
1458
|
+
const visitedNodeCount = nonNegativeInteger(stream.visitedNodeCount, `${label} visitedNodeCount`);
|
|
1459
|
+
const recordCount = nonNegativeInteger(stream.recordCount, `${label} recordCount`);
|
|
1460
|
+
const storedRecordCount = nonNegativeInteger(stream.storedRecordCount, `${label} storedRecordCount`);
|
|
1461
|
+
const encodedBytes = nonNegativeInteger(stream.encodedBytes, `${label} encodedBytes`);
|
|
1462
|
+
if (storedRecordCount > recordCount || (!stream.overflow && storedRecordCount !== recordCount)) {
|
|
1463
|
+
throw new Error(`${label} stored record count is inconsistent`);
|
|
1464
|
+
}
|
|
1465
|
+
return {
|
|
1466
|
+
hash: stream.hash,
|
|
1467
|
+
visitedNodeCount,
|
|
1468
|
+
recordCount,
|
|
1469
|
+
storedRecordCount,
|
|
1470
|
+
encodedBytes,
|
|
1471
|
+
overflow: stream.overflow,
|
|
1472
|
+
unstable: stream.unstable,
|
|
1473
|
+
};
|
|
1474
|
+
}
|
|
1475
|
+
function parsePhysicalSelectionEvidence(value) {
|
|
1476
|
+
const selection = record(value, 'Native physical selection evidence');
|
|
1477
|
+
rejectUnknown(selection, PHYSICAL_SELECTION_KEYS, 'Native physical selection evidence');
|
|
1478
|
+
if (selection.schema !== 'comet.native.physical-selection.v1') {
|
|
1479
|
+
throw new Error('Native physical selection evidence schema is invalid');
|
|
1480
|
+
}
|
|
1481
|
+
if (selection.status !== 'overflow' &&
|
|
1482
|
+
selection.status !== 'changed' &&
|
|
1483
|
+
selection.status !== 'overflow-and-changed') {
|
|
1484
|
+
throw new Error('Native physical selection evidence status is invalid');
|
|
1485
|
+
}
|
|
1486
|
+
const before = parsePhysicalSelectionStreamEvidence(selection.before, 'Native physical selection before');
|
|
1487
|
+
const after = parsePhysicalSelectionStreamEvidence(selection.after, 'Native physical selection after');
|
|
1488
|
+
const hasOverflow = before.overflow || after.overflow;
|
|
1489
|
+
const changed = before.unstable || after.unstable || !samePhysicalSelectionStream(before, after);
|
|
1490
|
+
if (!hasOverflow && !changed) {
|
|
1491
|
+
throw new Error('Native physical selection evidence must describe an exceptional selection');
|
|
1492
|
+
}
|
|
1493
|
+
const expectedStatus = hasOverflow && changed ? 'overflow-and-changed' : hasOverflow ? 'overflow' : 'changed';
|
|
1494
|
+
if (selection.status !== expectedStatus) {
|
|
1495
|
+
throw new Error('Native physical selection evidence status is inconsistent');
|
|
1496
|
+
}
|
|
1497
|
+
return {
|
|
1498
|
+
schema: 'comet.native.physical-selection.v1',
|
|
1499
|
+
status: expectedStatus,
|
|
1500
|
+
before,
|
|
1501
|
+
after,
|
|
1502
|
+
};
|
|
1503
|
+
}
|
|
1504
|
+
export function parseNativeContentSnapshotManifest(value) {
|
|
1505
|
+
const manifest = record(value, 'Native content snapshot manifest');
|
|
1506
|
+
rejectUnknown(manifest, MANIFEST_KEYS, 'Native content snapshot manifest');
|
|
1507
|
+
if (manifest.schema !== 'comet.native.content-snapshot.v1') {
|
|
1508
|
+
throw new Error('Unsupported Native content snapshot schema');
|
|
1509
|
+
}
|
|
1510
|
+
if (!SNAPSHOT_ORIGINS.has(manifest.origin)) {
|
|
1511
|
+
throw new Error('Native content snapshot origin is invalid');
|
|
1512
|
+
}
|
|
1513
|
+
let creation;
|
|
1514
|
+
if (manifest.creation !== undefined) {
|
|
1515
|
+
const value = record(manifest.creation, 'Native change creation binding');
|
|
1516
|
+
rejectUnknown(value, CREATION_KEYS, 'Native change creation binding');
|
|
1517
|
+
if (value.schema !== 'comet.native.change-creation-binding.v1' ||
|
|
1518
|
+
value.protocol !== 'signed-v2' ||
|
|
1519
|
+
typeof value.policyHash !== 'string' ||
|
|
1520
|
+
!HASH_PATTERN.test(value.policyHash) ||
|
|
1521
|
+
typeof value.policySnapshotHash !== 'string' ||
|
|
1522
|
+
!HASH_PATTERN.test(value.policySnapshotHash) ||
|
|
1523
|
+
typeof value.policySnapshotRef !== 'string' ||
|
|
1524
|
+
!/^runtime\/trust\/review-policy-[a-f0-9]{64}\.json$/u.test(value.policySnapshotRef)) {
|
|
1525
|
+
throw new Error('Native change creation binding is invalid');
|
|
1526
|
+
}
|
|
1527
|
+
creation = {
|
|
1528
|
+
schema: 'comet.native.change-creation-binding.v1',
|
|
1529
|
+
protocol: 'signed-v2',
|
|
1530
|
+
policyHash: value.policyHash,
|
|
1531
|
+
policySnapshotRef: value.policySnapshotRef,
|
|
1532
|
+
policySnapshotHash: value.policySnapshotHash,
|
|
1533
|
+
authorization: parseNativeCreationAuthorization(value.authorization),
|
|
1534
|
+
};
|
|
1535
|
+
}
|
|
1536
|
+
if (manifest.origin !== 'change-created' && creation !== undefined) {
|
|
1537
|
+
throw new Error('Native change creation binding does not match snapshot origin');
|
|
1538
|
+
}
|
|
1539
|
+
let capture;
|
|
1540
|
+
if (manifest.capture !== undefined) {
|
|
1541
|
+
const captureValue = record(manifest.capture, 'Native content snapshot capture');
|
|
1542
|
+
rejectUnknown(captureValue, CAPTURE_KEYS, 'Native content snapshot capture');
|
|
1543
|
+
if (captureValue.provider !== 'git' && captureValue.provider !== 'physical-tree') {
|
|
1544
|
+
throw new Error('Native content snapshot capture provider is invalid');
|
|
1545
|
+
}
|
|
1546
|
+
const gitSelection = captureValue.gitSelection === undefined
|
|
1547
|
+
? undefined
|
|
1548
|
+
: parseGitSelectionEvidence(captureValue.gitSelection);
|
|
1549
|
+
const physicalSelection = captureValue.physicalSelection === undefined
|
|
1550
|
+
? undefined
|
|
1551
|
+
: parsePhysicalSelectionEvidence(captureValue.physicalSelection);
|
|
1552
|
+
let projection = null;
|
|
1553
|
+
if (captureValue.projection !== undefined) {
|
|
1554
|
+
const projectionValue = record(captureValue.projection, 'Native content snapshot projection');
|
|
1555
|
+
rejectUnknown(projectionValue, GIT_PROJECTION_KEYS, 'Native content snapshot projection');
|
|
1556
|
+
if (projectionValue.provider !== 'git') {
|
|
1557
|
+
throw new Error('Native content snapshot projection provider is invalid');
|
|
1558
|
+
}
|
|
1559
|
+
projection = {
|
|
1560
|
+
provider: 'git',
|
|
1561
|
+
...(projectionValue.selection === undefined
|
|
1562
|
+
? {}
|
|
1563
|
+
: { selection: parseGitSelectionEvidence(projectionValue.selection) }),
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
if (captureValue.provider === 'git') {
|
|
1567
|
+
if (physicalSelection || projection) {
|
|
1568
|
+
throw new Error('Native Git capture cannot include physical or projection evidence');
|
|
1569
|
+
}
|
|
1570
|
+
capture = {
|
|
1571
|
+
provider: 'git',
|
|
1572
|
+
...(gitSelection ? { gitSelection } : {}),
|
|
1573
|
+
};
|
|
1574
|
+
}
|
|
1575
|
+
else {
|
|
1576
|
+
if (gitSelection) {
|
|
1577
|
+
throw new Error('Native physical-tree capture cannot include direct Git evidence');
|
|
1578
|
+
}
|
|
1579
|
+
if (physicalSelection && projection) {
|
|
1580
|
+
throw new Error('Native physical-tree capture cannot combine selection and projection');
|
|
1581
|
+
}
|
|
1582
|
+
capture = projection
|
|
1583
|
+
? { provider: 'physical-tree', projection }
|
|
1584
|
+
: {
|
|
1585
|
+
provider: 'physical-tree',
|
|
1586
|
+
...(physicalSelection ? { physicalSelection } : {}),
|
|
1587
|
+
};
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
if (typeof manifest.createdAt !== 'string' || Number.isNaN(Date.parse(manifest.createdAt))) {
|
|
1591
|
+
throw new Error('Native content snapshot timestamp is invalid');
|
|
1592
|
+
}
|
|
1593
|
+
if (typeof manifest.complete !== 'boolean') {
|
|
1594
|
+
throw new Error('Native content snapshot complete flag is invalid');
|
|
1595
|
+
}
|
|
1596
|
+
const limitValue = record(manifest.limits, 'Native content snapshot limits');
|
|
1597
|
+
rejectUnknown(limitValue, LIMIT_KEYS, 'Native content snapshot limits');
|
|
1598
|
+
const limits = {
|
|
1599
|
+
maxFiles: positiveInteger(limitValue.maxFiles, 'Native snapshot maxFiles'),
|
|
1600
|
+
maxFileBytes: positiveInteger(limitValue.maxFileBytes, 'Native snapshot maxFileBytes'),
|
|
1601
|
+
maxTotalBytes: positiveInteger(limitValue.maxTotalBytes, 'Native snapshot maxTotalBytes'),
|
|
1602
|
+
maxManifestBytes: positiveInteger(limitValue.maxManifestBytes, 'Native snapshot maxManifestBytes'),
|
|
1603
|
+
...(limitValue.maxDurationMs === undefined
|
|
1604
|
+
? {}
|
|
1605
|
+
: {
|
|
1606
|
+
maxDurationMs: positiveInteger(limitValue.maxDurationMs, 'Native snapshot maxDurationMs'),
|
|
1607
|
+
}),
|
|
1608
|
+
};
|
|
1609
|
+
let policy;
|
|
1610
|
+
if (manifest.policy !== undefined) {
|
|
1611
|
+
const policyValue = record(manifest.policy, 'Native snapshot policy');
|
|
1612
|
+
rejectUnknown(policyValue, POLICY_KEYS, 'Native snapshot policy');
|
|
1613
|
+
if (policyValue.schema !== 'comet.native.snapshot-policy.v1') {
|
|
1614
|
+
throw new Error('Native snapshot policy schema is invalid');
|
|
1615
|
+
}
|
|
1616
|
+
if (!Array.isArray(policyValue.include) || !Array.isArray(policyValue.exclude)) {
|
|
1617
|
+
throw new Error('Native snapshot policy patterns must be arrays');
|
|
1618
|
+
}
|
|
1619
|
+
policy = resolveSnapshotPolicy({
|
|
1620
|
+
include: policyValue.include,
|
|
1621
|
+
exclude: policyValue.exclude,
|
|
1622
|
+
hash: policyValue.hash,
|
|
1623
|
+
schema: 'comet.native.snapshot-policy.v1',
|
|
1624
|
+
}).manifest;
|
|
1625
|
+
}
|
|
1626
|
+
if (!Array.isArray(manifest.entries) || !Array.isArray(manifest.omitted)) {
|
|
1627
|
+
throw new Error('Native content snapshot entries and omissions must be arrays');
|
|
1628
|
+
}
|
|
1629
|
+
const entries = manifest.entries.map(parseEntry);
|
|
1630
|
+
const omitted = manifest.omitted.map(parseOmission);
|
|
1631
|
+
const omittedCount = nonNegativeInteger(manifest.omittedCount, 'Native content snapshot omittedCount');
|
|
1632
|
+
const omissionOverflow = manifest.omissionOverflow === undefined
|
|
1633
|
+
? undefined
|
|
1634
|
+
: parseOmissionOverflow(manifest.omissionOverflow);
|
|
1635
|
+
if (entries.length > limits.maxFiles) {
|
|
1636
|
+
throw new Error('Native content snapshot exceeds its file-count limit');
|
|
1637
|
+
}
|
|
1638
|
+
if (entries.some((entry) => entry.size > limits.maxFileBytes) ||
|
|
1639
|
+
entries.reduce((total, entry) => total + entry.size, 0) > limits.maxTotalBytes) {
|
|
1640
|
+
throw new Error('Native content snapshot exceeds its byte limits');
|
|
1641
|
+
}
|
|
1642
|
+
if (new Set(entries.map((entry) => entry.path)).size !== entries.length) {
|
|
1643
|
+
throw new Error('Native content snapshot contains duplicate paths');
|
|
1644
|
+
}
|
|
1645
|
+
if (omitted.length > MAX_RECORDED_OMISSIONS || omittedCount < omitted.length) {
|
|
1646
|
+
throw new Error('Native content snapshot omission count is invalid');
|
|
1647
|
+
}
|
|
1648
|
+
const overflowCount = omittedCount - omitted.length;
|
|
1649
|
+
if ((overflowCount === 0 && omissionOverflow) ||
|
|
1650
|
+
(overflowCount > 0 && omissionOverflow?.count !== overflowCount)) {
|
|
1651
|
+
throw new Error('Native content snapshot omission overflow is inconsistent');
|
|
1652
|
+
}
|
|
1653
|
+
if (manifest.complete !== (omittedCount === 0)) {
|
|
1654
|
+
throw new Error('Native content snapshot completeness is inconsistent');
|
|
1655
|
+
}
|
|
1656
|
+
const enumerationOmissions = omitted.filter((omission) => omission.reason === 'git-enumeration-limit');
|
|
1657
|
+
const selectionChangedOmissions = omitted.filter((omission) => omission.reason === 'git-selection-changed');
|
|
1658
|
+
for (const omission of [...enumerationOmissions, ...selectionChangedOmissions]) {
|
|
1659
|
+
if (omission.path !== '.' || omission.size !== null || omission.type !== 'directory') {
|
|
1660
|
+
throw new Error('Native Git selection omission must use the project-root sentinel');
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
if (enumerationOmissions.length > 1 || selectionChangedOmissions.length > 1) {
|
|
1664
|
+
throw new Error('Native Git selection omissions must not be duplicated');
|
|
1665
|
+
}
|
|
1666
|
+
const gitSelection = capture?.provider === 'git' ? capture.gitSelection : capture?.projection?.selection;
|
|
1667
|
+
const evidenceHasOverflow = gitSelection?.status === 'overflow' || gitSelection?.status === 'overflow-and-changed';
|
|
1668
|
+
const evidenceHasSelectionChange = gitSelection?.status === 'changed' || gitSelection?.status === 'overflow-and-changed';
|
|
1669
|
+
if (evidenceHasOverflow !== (enumerationOmissions.length === 1)) {
|
|
1670
|
+
throw new Error('Native Git enumeration omission and selection evidence are inconsistent');
|
|
1671
|
+
}
|
|
1672
|
+
if (evidenceHasSelectionChange !== (selectionChangedOmissions.length === 1)) {
|
|
1673
|
+
throw new Error('Native Git selection-change omission and selection evidence are inconsistent');
|
|
1674
|
+
}
|
|
1675
|
+
const physicalEnumerationOmissions = omitted.filter((omission) => omission.reason === 'physical-enumeration-limit');
|
|
1676
|
+
const physicalChangedOmissions = omitted.filter((omission) => omission.reason === 'physical-selection-changed');
|
|
1677
|
+
for (const omission of [...physicalEnumerationOmissions, ...physicalChangedOmissions]) {
|
|
1678
|
+
if (omission.path !== '.' || omission.size !== null || omission.type !== 'directory') {
|
|
1679
|
+
throw new Error('Native physical selection omission must use the project-root sentinel');
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
if (physicalEnumerationOmissions.length > 1 || physicalChangedOmissions.length > 1) {
|
|
1683
|
+
throw new Error('Native physical selection omissions must not be duplicated');
|
|
1684
|
+
}
|
|
1685
|
+
const physicalSelection = capture?.physicalSelection;
|
|
1686
|
+
const physicalEvidenceHasOverflow = physicalSelection?.status === 'overflow' ||
|
|
1687
|
+
physicalSelection?.status === 'overflow-and-changed';
|
|
1688
|
+
const physicalEvidenceHasChange = physicalSelection?.status === 'changed' || physicalSelection?.status === 'overflow-and-changed';
|
|
1689
|
+
if (physicalEvidenceHasOverflow !== (physicalEnumerationOmissions.length === 1)) {
|
|
1690
|
+
throw new Error('Native physical enumeration omission and evidence are inconsistent');
|
|
1691
|
+
}
|
|
1692
|
+
if (physicalEvidenceHasChange !== (physicalChangedOmissions.length === 1)) {
|
|
1693
|
+
throw new Error('Native physical selection-change omission and evidence are inconsistent');
|
|
1694
|
+
}
|
|
1695
|
+
const parsed = {
|
|
1696
|
+
schema: 'comet.native.content-snapshot.v1',
|
|
1697
|
+
origin: manifest.origin,
|
|
1698
|
+
...(creation ? { creation } : {}),
|
|
1699
|
+
...(capture ? { capture } : {}),
|
|
1700
|
+
createdAt: manifest.createdAt,
|
|
1701
|
+
complete: manifest.complete,
|
|
1702
|
+
limits,
|
|
1703
|
+
...(policy ? { policy } : {}),
|
|
1704
|
+
entries,
|
|
1705
|
+
omitted,
|
|
1706
|
+
omittedCount,
|
|
1707
|
+
...(omissionOverflow ? { omissionOverflow } : {}),
|
|
1708
|
+
};
|
|
1709
|
+
if (serializedManifestBytes(parsed) > limits.maxManifestBytes) {
|
|
1710
|
+
throw new Error('Native content snapshot exceeds its manifest byte limit');
|
|
1711
|
+
}
|
|
1712
|
+
return parsed;
|
|
1713
|
+
}
|
|
1714
|
+
/**
|
|
1715
|
+
* Projects a legacy physical-tree snapshot onto the same Git-owned universe used by new
|
|
1716
|
+
* snapshots. This keeps existing v1 baselines usable after ignored directories and nested
|
|
1717
|
+
* repositories stop participating in Native evidence.
|
|
1718
|
+
*/
|
|
1719
|
+
export async function filterNativeContentSnapshotToProjectScope(paths, value, options = {}) {
|
|
1720
|
+
const manifest = parseNativeContentSnapshotManifest(value);
|
|
1721
|
+
if (manifest.capture?.provider === 'git' ||
|
|
1722
|
+
manifest.capture?.projection ||
|
|
1723
|
+
manifest.capture?.physicalSelection) {
|
|
1724
|
+
return manifest;
|
|
1725
|
+
}
|
|
1726
|
+
const projectRoot = path.resolve(paths.projectRoot);
|
|
1727
|
+
const execution = createNativeSnapshotExecution(options);
|
|
1728
|
+
const gitSelectionLimits = resolveNativeGitSelectionLimits(options.gitSelectionLimits);
|
|
1729
|
+
const selection = await nativeGitSnapshotSelection(execution, projectRoot, gitSelectionLimits, options.gitSelectionHooks);
|
|
1730
|
+
if (selection === null)
|
|
1731
|
+
return manifest;
|
|
1732
|
+
const selected = new Set(selectionPaths(selection).filter((relative) => isSnapshotProjectRef(paths, relative)));
|
|
1733
|
+
const gitlinkPaths = [...selection.gitlinks].filter((relative) => selected.has(relative));
|
|
1734
|
+
const nestedRepositoryPaths = [...selection.nestedRepositories].filter((relative) => isSnapshotProjectRef(paths, relative));
|
|
1735
|
+
const atOrBeneath = (relative, boundaries) => boundaries.some((boundary) => relative === boundary || relative.startsWith(`${boundary}/`));
|
|
1736
|
+
const beneathGitlink = (relative) => atOrBeneath(relative, gitlinkPaths);
|
|
1737
|
+
const beneathNestedRepository = (relative) => atOrBeneath(relative, nestedRepositoryPaths);
|
|
1738
|
+
const ignoredCandidates = [
|
|
1739
|
+
...manifest.entries.map((entry) => entry.path),
|
|
1740
|
+
...manifest.omitted.flatMap((omission) => omission.type === 'directory' ? [omission.path, `${omission.path}/`] : [omission.path]),
|
|
1741
|
+
].filter((relative) => !selected.has(relative) && !beneathGitlink(relative) && !beneathNestedRepository(relative));
|
|
1742
|
+
const ignored = await runGitCheckIgnore(execution, projectRoot, ignoredCandidates);
|
|
1743
|
+
const entries = manifest.entries.filter((entry) => !beneathGitlink(entry.path) &&
|
|
1744
|
+
!beneathNestedRepository(entry.path) &&
|
|
1745
|
+
isSnapshotProjectRef(paths, entry.path) &&
|
|
1746
|
+
(selected.has(entry.path) || !ignored.has(entry.path)));
|
|
1747
|
+
await finalizeNativeGitSnapshotSelection(execution, projectRoot, gitSelectionLimits, selection, options.gitSelectionHooks?.outputChunkBytes);
|
|
1748
|
+
const boundaryOmissions = [...selection.omissions];
|
|
1749
|
+
for (const gitlink of gitlinkPaths) {
|
|
1750
|
+
// A physical-tree baseline recorded file contents below the old boundary, not the
|
|
1751
|
+
// submodule commit, and it did not record empty directories. Therefore no current
|
|
1752
|
+
// gitlink can be proven new or unchanged. Injecting today's HEAD would make the
|
|
1753
|
+
// historical baseline lie, so preserve every such boundary as explicit uncertainty.
|
|
1754
|
+
boundaryOmissions.push({
|
|
1755
|
+
path: gitlink,
|
|
1756
|
+
size: null,
|
|
1757
|
+
type: 'directory',
|
|
1758
|
+
reason: 'legacy-gitlink-boundary',
|
|
1759
|
+
});
|
|
1760
|
+
}
|
|
1761
|
+
entries.sort((left, right) => left.path.localeCompare(right.path, 'en'));
|
|
1762
|
+
const omitted = manifest.omitted.filter((omission) => {
|
|
1763
|
+
if (beneathGitlink(omission.path))
|
|
1764
|
+
return false;
|
|
1765
|
+
if (beneathNestedRepository(omission.path))
|
|
1766
|
+
return false;
|
|
1767
|
+
if (!isSnapshotProjectRef(paths, omission.path))
|
|
1768
|
+
return false;
|
|
1769
|
+
if (!ignored.has(omission.path))
|
|
1770
|
+
return true;
|
|
1771
|
+
return (selected.has(omission.path) ||
|
|
1772
|
+
[...selected].some((relative) => relative.startsWith(`${omission.path}/`)));
|
|
1773
|
+
});
|
|
1774
|
+
for (const omission of boundaryOmissions) {
|
|
1775
|
+
if (!omitted.some((current) => current.path === omission.path && current.reason === omission.reason)) {
|
|
1776
|
+
omitted.push(omission);
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
omitted.sort((left, right) => left.path.localeCompare(right.path, 'en'));
|
|
1780
|
+
let overflowCount = manifest.omissionOverflow?.count ?? 0;
|
|
1781
|
+
let overflowHash = manifest.omissionOverflow?.hash ?? sha256Text('comet.native.snapshot-omission-overflow.v1');
|
|
1782
|
+
if (selection.overflow) {
|
|
1783
|
+
overflowCount += selection.overflow.count;
|
|
1784
|
+
overflowHash = foldSnapshotOverflowHash(overflowHash, 'git-selection', {
|
|
1785
|
+
source: 'git-selection',
|
|
1786
|
+
...selection.overflow,
|
|
1787
|
+
});
|
|
1788
|
+
}
|
|
1789
|
+
const foldOverflow = (omission) => {
|
|
1790
|
+
overflowCount += 1;
|
|
1791
|
+
overflowHash = foldSnapshotOverflowHash(overflowHash, 'omission', omission);
|
|
1792
|
+
};
|
|
1793
|
+
while (omitted.length > MAX_RECORDED_OMISSIONS) {
|
|
1794
|
+
const omission = takeLastCompactableOmission(omitted);
|
|
1795
|
+
if (omission === null) {
|
|
1796
|
+
throw new Error('Projected Native snapshot has too many required selection-integrity omissions');
|
|
1797
|
+
}
|
|
1798
|
+
foldOverflow(omission);
|
|
1799
|
+
}
|
|
1800
|
+
const buildProjection = () => ({
|
|
1801
|
+
...manifest,
|
|
1802
|
+
capture: {
|
|
1803
|
+
provider: 'physical-tree',
|
|
1804
|
+
projection: {
|
|
1805
|
+
provider: 'git',
|
|
1806
|
+
...(selection.evidence ? { selection: selection.evidence } : {}),
|
|
1807
|
+
},
|
|
1808
|
+
},
|
|
1809
|
+
complete: omitted.length + overflowCount === 0,
|
|
1810
|
+
entries,
|
|
1811
|
+
omitted,
|
|
1812
|
+
omittedCount: omitted.length + overflowCount,
|
|
1813
|
+
...(overflowCount > 0
|
|
1814
|
+
? {
|
|
1815
|
+
omissionOverflow: {
|
|
1816
|
+
ref: `native-snapshot://omitted-overflow/${overflowHash}`,
|
|
1817
|
+
hash: overflowHash,
|
|
1818
|
+
count: overflowCount,
|
|
1819
|
+
},
|
|
1820
|
+
}
|
|
1821
|
+
: {}),
|
|
1822
|
+
});
|
|
1823
|
+
let projected = buildProjection();
|
|
1824
|
+
while (serializedManifestBytes(projected) > manifest.limits.maxManifestBytes) {
|
|
1825
|
+
const omission = takeLastCompactableOmission(omitted);
|
|
1826
|
+
if (omission === null) {
|
|
1827
|
+
throw new Error('Projected Native snapshot cannot fit its manifest byte limit');
|
|
1828
|
+
}
|
|
1829
|
+
foldOverflow(omission);
|
|
1830
|
+
projected = buildProjection();
|
|
1831
|
+
}
|
|
1832
|
+
return parseNativeContentSnapshotManifest(projected);
|
|
1833
|
+
}
|
|
1834
|
+
export function nativeBaselineManifestFile(paths, name) {
|
|
1835
|
+
if (!CHANGE_NAME_PATTERN.test(name))
|
|
1836
|
+
throw new Error(`Invalid Native change name: ${name}`);
|
|
1837
|
+
const changeDir = path.join(paths.changesDir, name);
|
|
1838
|
+
if (!isInsidePath(paths.changesDir, changeDir))
|
|
1839
|
+
throw new Error('Native change path escaped');
|
|
1840
|
+
return path.join(changeDir, 'runtime', 'baseline-manifest.json');
|
|
1841
|
+
}
|
|
1842
|
+
export async function createNativeContentSnapshot(paths, options = {}) {
|
|
1843
|
+
const limits = {
|
|
1844
|
+
maxFiles: options.limits?.maxFiles ?? DEFAULT_NATIVE_SNAPSHOT_LIMITS.maxFiles,
|
|
1845
|
+
maxFileBytes: options.limits?.maxFileBytes ?? DEFAULT_NATIVE_SNAPSHOT_LIMITS.maxFileBytes,
|
|
1846
|
+
maxTotalBytes: options.limits?.maxTotalBytes ?? DEFAULT_NATIVE_SNAPSHOT_LIMITS.maxTotalBytes,
|
|
1847
|
+
maxManifestBytes: options.limits?.maxManifestBytes ?? DEFAULT_NATIVE_SNAPSHOT_LIMITS.maxManifestBytes,
|
|
1848
|
+
...(options.limits?.maxDurationMs === undefined
|
|
1849
|
+
? {}
|
|
1850
|
+
: { maxDurationMs: options.limits.maxDurationMs }),
|
|
1851
|
+
};
|
|
1852
|
+
const policy = resolveSnapshotPolicy(options.policy);
|
|
1853
|
+
const execution = createNativeSnapshotExecution({
|
|
1854
|
+
...options,
|
|
1855
|
+
deadlineMs: options.deadlineMs ?? limits.maxDurationMs,
|
|
1856
|
+
});
|
|
1857
|
+
const gitSelectionLimits = resolveNativeGitSelectionLimits(options.gitSelectionLimits);
|
|
1858
|
+
const physicalSelectionLimits = resolveNativePhysicalSelectionLimits(options.physicalSelectionLimits);
|
|
1859
|
+
if (limits.maxFiles < 1 ||
|
|
1860
|
+
limits.maxFileBytes < 1 ||
|
|
1861
|
+
limits.maxTotalBytes < 1 ||
|
|
1862
|
+
limits.maxManifestBytes < 1) {
|
|
1863
|
+
throw new Error('Native snapshot limits must be positive');
|
|
1864
|
+
}
|
|
1865
|
+
const projectRoot = path.resolve(paths.projectRoot);
|
|
1866
|
+
const physicalProjectRoot = await fs.realpath(projectRoot);
|
|
1867
|
+
const nativeRoot = path.resolve(paths.nativeRoot);
|
|
1868
|
+
const physicalNativeRoot = await fs.realpath(nativeRoot);
|
|
1869
|
+
const configFile = path.resolve(paths.configFile);
|
|
1870
|
+
const selectionFile = path.join(projectRoot, '.comet', 'current-change.json');
|
|
1871
|
+
const denylist = normalizedDenylist(projectRoot, options.denylist ?? []);
|
|
1872
|
+
const entries = [];
|
|
1873
|
+
const omitted = [];
|
|
1874
|
+
const capturedEntryValidations = new Map();
|
|
1875
|
+
const capturedTrackedAbsences = new Map();
|
|
1876
|
+
let omittedCount = 0;
|
|
1877
|
+
let overflowCount = 0;
|
|
1878
|
+
let overflowHash = sha256Text('comet.native.snapshot-omission-overflow.v1');
|
|
1879
|
+
let totalBytes = 0;
|
|
1880
|
+
let notifiedFirstEntry = false;
|
|
1881
|
+
let physicalSelectionEvidence = null;
|
|
1882
|
+
const foldOverflow = (value) => {
|
|
1883
|
+
overflowCount += 1;
|
|
1884
|
+
overflowHash = foldSnapshotOverflowHash(overflowHash, 'omission', value);
|
|
1885
|
+
};
|
|
1886
|
+
const omit = (value) => {
|
|
1887
|
+
omittedCount += 1;
|
|
1888
|
+
if (omitted.length < MAX_RECORDED_OMISSIONS) {
|
|
1889
|
+
omitted.push(value);
|
|
1890
|
+
return;
|
|
1891
|
+
}
|
|
1892
|
+
if (isSelectionIntegrityOmission(value)) {
|
|
1893
|
+
const displaced = takeLastCompactableOmission(omitted);
|
|
1894
|
+
if (displaced === null) {
|
|
1895
|
+
throw new Error('Native snapshot has too many required selection-integrity omissions');
|
|
1896
|
+
}
|
|
1897
|
+
foldOverflow(displaced);
|
|
1898
|
+
omitted.push(value);
|
|
1899
|
+
return;
|
|
1900
|
+
}
|
|
1901
|
+
foldOverflow(value);
|
|
1902
|
+
};
|
|
1903
|
+
const foldGitSelectionOverflow = (value) => {
|
|
1904
|
+
omittedCount += value.count;
|
|
1905
|
+
overflowCount += value.count;
|
|
1906
|
+
overflowHash = foldSnapshotOverflowHash(overflowHash, 'git-selection', {
|
|
1907
|
+
source: 'git-selection',
|
|
1908
|
+
...value,
|
|
1909
|
+
});
|
|
1910
|
+
};
|
|
1911
|
+
const foldManifestEntryOverflow = (entry) => {
|
|
1912
|
+
overflowCount += 1;
|
|
1913
|
+
overflowHash = foldSnapshotOverflowHash(overflowHash, 'manifest-entry', {
|
|
1914
|
+
reason: 'manifest-size',
|
|
1915
|
+
entry,
|
|
1916
|
+
});
|
|
1917
|
+
};
|
|
1918
|
+
const recordCapturedEntry = async (entry, validation) => {
|
|
1919
|
+
entries.push(entry);
|
|
1920
|
+
totalBytes += entry.size;
|
|
1921
|
+
capturedEntryValidations.set(entry.path, validation);
|
|
1922
|
+
if (!notifiedFirstEntry) {
|
|
1923
|
+
notifiedFirstEntry = true;
|
|
1924
|
+
await options.gitSelectionHooks?.afterFirstEntryCaptured?.(entry.path);
|
|
1925
|
+
}
|
|
1926
|
+
};
|
|
1927
|
+
const invalidateCapturedEntry = (relative, omission) => {
|
|
1928
|
+
const index = entries.findIndex((entry) => entry.path === relative);
|
|
1929
|
+
if (index < 0)
|
|
1930
|
+
return;
|
|
1931
|
+
const [entry] = entries.splice(index, 1);
|
|
1932
|
+
totalBytes -= entry.size;
|
|
1933
|
+
capturedEntryValidations.delete(relative);
|
|
1934
|
+
omit(omission);
|
|
1935
|
+
};
|
|
1936
|
+
const captureFile = async (target, relative, before) => {
|
|
1937
|
+
if (!before.isFile() || before.isSymbolicLink())
|
|
1938
|
+
return;
|
|
1939
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
1940
|
+
return;
|
|
1941
|
+
let realTarget;
|
|
1942
|
+
try {
|
|
1943
|
+
realTarget = await fs.realpath(target);
|
|
1944
|
+
}
|
|
1945
|
+
catch (error) {
|
|
1946
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
1947
|
+
return;
|
|
1948
|
+
if (!isUnreadableError(error) && !isChangedDuringReadError(error))
|
|
1949
|
+
throw error;
|
|
1950
|
+
omit({
|
|
1951
|
+
path: relative,
|
|
1952
|
+
size: before.size,
|
|
1953
|
+
type: 'file',
|
|
1954
|
+
reason: isChangedDuringReadError(error) ? 'changed-during-read' : 'unreadable',
|
|
1955
|
+
});
|
|
1956
|
+
return;
|
|
1957
|
+
}
|
|
1958
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
1959
|
+
return;
|
|
1960
|
+
if (!isInsidePath(physicalProjectRoot, realTarget) ||
|
|
1961
|
+
sameOrInside(physicalNativeRoot, realTarget)) {
|
|
1962
|
+
return;
|
|
1963
|
+
}
|
|
1964
|
+
if (entries.length >= limits.maxFiles) {
|
|
1965
|
+
omit({ path: relative, size: before.size, type: 'file', reason: 'file-count' });
|
|
1966
|
+
return;
|
|
1967
|
+
}
|
|
1968
|
+
if (before.size > limits.maxFileBytes) {
|
|
1969
|
+
omit({ path: relative, size: before.size, type: 'file', reason: 'file-size' });
|
|
1970
|
+
return;
|
|
1971
|
+
}
|
|
1972
|
+
if (totalBytes + before.size > limits.maxTotalBytes) {
|
|
1973
|
+
omit({ path: relative, size: before.size, type: 'file', reason: 'total-size' });
|
|
1974
|
+
return;
|
|
1975
|
+
}
|
|
1976
|
+
let boundedHash;
|
|
1977
|
+
let after;
|
|
1978
|
+
let afterRealTarget;
|
|
1979
|
+
try {
|
|
1980
|
+
boundedHash = await sha256FileBounded(realTarget, before.size, before, execution);
|
|
1981
|
+
if (boundedHash.status === 'budget-exhausted' ||
|
|
1982
|
+
!nativeSnapshotExecutionHasBudget(execution)) {
|
|
1983
|
+
return;
|
|
1984
|
+
}
|
|
1985
|
+
if (boundedHash.status === 'changed') {
|
|
1986
|
+
omit({ path: relative, size: null, type: 'file', reason: 'changed-during-read' });
|
|
1987
|
+
return;
|
|
1988
|
+
}
|
|
1989
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
1990
|
+
return;
|
|
1991
|
+
afterRealTarget = await fs.realpath(target);
|
|
1992
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
1993
|
+
return;
|
|
1994
|
+
after = await fs.lstat(target);
|
|
1995
|
+
}
|
|
1996
|
+
catch (error) {
|
|
1997
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
1998
|
+
return;
|
|
1999
|
+
if (!isUnreadableError(error) && !isChangedDuringReadError(error))
|
|
2000
|
+
throw error;
|
|
2001
|
+
omit({
|
|
2002
|
+
path: relative,
|
|
2003
|
+
size: before.size,
|
|
2004
|
+
type: 'file',
|
|
2005
|
+
reason: isChangedDuringReadError(error) ? 'changed-during-read' : 'unreadable',
|
|
2006
|
+
});
|
|
2007
|
+
return;
|
|
2008
|
+
}
|
|
2009
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2010
|
+
return;
|
|
2011
|
+
if (boundedHash.bytes !== before.size ||
|
|
2012
|
+
afterRealTarget !== realTarget ||
|
|
2013
|
+
!sameFileIdentity(before, boundedHash.finalStat) ||
|
|
2014
|
+
!sameFileIdentity(boundedHash.finalStat, after) ||
|
|
2015
|
+
!after.isFile() ||
|
|
2016
|
+
after.isSymbolicLink() ||
|
|
2017
|
+
after.size !== before.size ||
|
|
2018
|
+
after.mtimeMs !== before.mtimeMs ||
|
|
2019
|
+
after.ctimeMs !== before.ctimeMs) {
|
|
2020
|
+
omit({
|
|
2021
|
+
path: relative,
|
|
2022
|
+
size: after.isFile() ? after.size : null,
|
|
2023
|
+
type: after.isFile() ? 'file' : 'other',
|
|
2024
|
+
reason: 'changed-during-read',
|
|
2025
|
+
});
|
|
2026
|
+
return;
|
|
2027
|
+
}
|
|
2028
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2029
|
+
return;
|
|
2030
|
+
await recordCapturedEntry({ path: relative, hash: boundedHash.hash, size: after.size, type: 'file' }, { kind: 'file', target, realTarget, stat: after });
|
|
2031
|
+
};
|
|
2032
|
+
const captureSymbolicLink = async (target, relative, before) => {
|
|
2033
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2034
|
+
return;
|
|
2035
|
+
let firstTarget;
|
|
2036
|
+
let secondTarget;
|
|
2037
|
+
let after;
|
|
2038
|
+
try {
|
|
2039
|
+
firstTarget = await fs.readlink(target, { encoding: 'buffer' });
|
|
2040
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2041
|
+
return;
|
|
2042
|
+
after = await fs.lstat(target);
|
|
2043
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2044
|
+
return;
|
|
2045
|
+
secondTarget = await fs.readlink(target, { encoding: 'buffer' });
|
|
2046
|
+
}
|
|
2047
|
+
catch (error) {
|
|
2048
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2049
|
+
return;
|
|
2050
|
+
if (!isUnreadableError(error) && !isChangedDuringReadError(error))
|
|
2051
|
+
throw error;
|
|
2052
|
+
omit({
|
|
2053
|
+
path: relative,
|
|
2054
|
+
size: null,
|
|
2055
|
+
type: 'other',
|
|
2056
|
+
reason: isChangedDuringReadError(error) ? 'changed-during-read' : 'unreadable',
|
|
2057
|
+
});
|
|
2058
|
+
return;
|
|
2059
|
+
}
|
|
2060
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2061
|
+
return;
|
|
2062
|
+
if (!after.isSymbolicLink() ||
|
|
2063
|
+
!sameFileIdentity(before, after) ||
|
|
2064
|
+
after.mtimeMs !== before.mtimeMs ||
|
|
2065
|
+
after.ctimeMs !== before.ctimeMs ||
|
|
2066
|
+
!firstTarget.equals(secondTarget)) {
|
|
2067
|
+
omit({ path: relative, size: null, type: 'other', reason: 'changed-during-read' });
|
|
2068
|
+
return;
|
|
2069
|
+
}
|
|
2070
|
+
const size = firstTarget.byteLength;
|
|
2071
|
+
if (entries.length >= limits.maxFiles) {
|
|
2072
|
+
omit({ path: relative, size, type: 'other', reason: 'file-count' });
|
|
2073
|
+
return;
|
|
2074
|
+
}
|
|
2075
|
+
if (size > limits.maxFileBytes) {
|
|
2076
|
+
omit({ path: relative, size, type: 'other', reason: 'file-size' });
|
|
2077
|
+
return;
|
|
2078
|
+
}
|
|
2079
|
+
if (totalBytes + size > limits.maxTotalBytes) {
|
|
2080
|
+
omit({ path: relative, size, type: 'other', reason: 'total-size' });
|
|
2081
|
+
return;
|
|
2082
|
+
}
|
|
2083
|
+
const hash = createHash('sha256').update('symlink\0').update(firstTarget).digest('hex');
|
|
2084
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2085
|
+
return;
|
|
2086
|
+
await recordCapturedEntry({ path: relative, hash, size, type: 'file' }, { kind: 'symlink', target, rawTarget: firstTarget, stat: after });
|
|
2087
|
+
};
|
|
2088
|
+
const captureForcedProtectedRefs = async () => {
|
|
2089
|
+
for (const relative of [NATIVE_REVIEW_TRUST_POLICY_REF]) {
|
|
2090
|
+
if (capturedEntryValidations.has(relative))
|
|
2091
|
+
continue;
|
|
2092
|
+
const target = path.resolve(projectRoot, ...relative.split('/'));
|
|
2093
|
+
let stat;
|
|
2094
|
+
try {
|
|
2095
|
+
stat = await fs.lstat(target);
|
|
2096
|
+
}
|
|
2097
|
+
catch (error) {
|
|
2098
|
+
if (error.code === 'ENOENT')
|
|
2099
|
+
continue;
|
|
2100
|
+
if (!isUnreadableError(error) && !isChangedDuringReadError(error))
|
|
2101
|
+
throw error;
|
|
2102
|
+
omit({
|
|
2103
|
+
path: relative,
|
|
2104
|
+
size: null,
|
|
2105
|
+
type: 'file',
|
|
2106
|
+
reason: isChangedDuringReadError(error) ? 'changed-during-read' : 'unreadable',
|
|
2107
|
+
});
|
|
2108
|
+
continue;
|
|
2109
|
+
}
|
|
2110
|
+
if (stat.isSymbolicLink()) {
|
|
2111
|
+
await captureSymbolicLink(target, relative, stat);
|
|
2112
|
+
}
|
|
2113
|
+
else if (stat.isFile()) {
|
|
2114
|
+
await captureFile(target, relative, stat);
|
|
2115
|
+
}
|
|
2116
|
+
else {
|
|
2117
|
+
omit({
|
|
2118
|
+
path: relative,
|
|
2119
|
+
size: null,
|
|
2120
|
+
type: stat.isDirectory() ? 'directory' : 'other',
|
|
2121
|
+
reason: 'changed-during-read',
|
|
2122
|
+
});
|
|
2123
|
+
}
|
|
2124
|
+
}
|
|
2125
|
+
};
|
|
2126
|
+
const revalidateCapturedEntries = async () => {
|
|
2127
|
+
for (const [relative, validation] of [...capturedEntryValidations]) {
|
|
2128
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2129
|
+
return;
|
|
2130
|
+
if (validation.kind === 'file') {
|
|
2131
|
+
let realTarget;
|
|
2132
|
+
let stat;
|
|
2133
|
+
try {
|
|
2134
|
+
realTarget = await fs.realpath(validation.target);
|
|
2135
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2136
|
+
return;
|
|
2137
|
+
stat = await fs.lstat(validation.target);
|
|
2138
|
+
}
|
|
2139
|
+
catch (error) {
|
|
2140
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2141
|
+
return;
|
|
2142
|
+
if (!isUnreadableError(error) && !isChangedDuringReadError(error))
|
|
2143
|
+
throw error;
|
|
2144
|
+
invalidateCapturedEntry(relative, {
|
|
2145
|
+
path: relative,
|
|
2146
|
+
size: null,
|
|
2147
|
+
type: 'file',
|
|
2148
|
+
reason: isUnreadableError(error) ? 'unreadable' : 'changed-during-read',
|
|
2149
|
+
});
|
|
2150
|
+
continue;
|
|
2151
|
+
}
|
|
2152
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2153
|
+
return;
|
|
2154
|
+
if (realTarget !== validation.realTarget ||
|
|
2155
|
+
!stat.isFile() ||
|
|
2156
|
+
stat.isSymbolicLink() ||
|
|
2157
|
+
!sameFileIdentity(validation.stat, stat) ||
|
|
2158
|
+
stat.size !== validation.stat.size ||
|
|
2159
|
+
stat.mtimeMs !== validation.stat.mtimeMs ||
|
|
2160
|
+
stat.ctimeMs !== validation.stat.ctimeMs) {
|
|
2161
|
+
invalidateCapturedEntry(relative, {
|
|
2162
|
+
path: relative,
|
|
2163
|
+
size: stat.isFile() ? stat.size : null,
|
|
2164
|
+
type: stat.isFile() ? 'file' : 'other',
|
|
2165
|
+
reason: 'changed-during-read',
|
|
2166
|
+
});
|
|
2167
|
+
}
|
|
2168
|
+
continue;
|
|
2169
|
+
}
|
|
2170
|
+
if (validation.kind === 'symlink') {
|
|
2171
|
+
let stat;
|
|
2172
|
+
let rawTarget;
|
|
2173
|
+
try {
|
|
2174
|
+
stat = await fs.lstat(validation.target);
|
|
2175
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2176
|
+
return;
|
|
2177
|
+
rawTarget = await fs.readlink(validation.target, { encoding: 'buffer' });
|
|
2178
|
+
}
|
|
2179
|
+
catch (error) {
|
|
2180
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2181
|
+
return;
|
|
2182
|
+
if (!isUnreadableError(error) && !isChangedDuringReadError(error))
|
|
2183
|
+
throw error;
|
|
2184
|
+
invalidateCapturedEntry(relative, {
|
|
2185
|
+
path: relative,
|
|
2186
|
+
size: null,
|
|
2187
|
+
type: 'other',
|
|
2188
|
+
reason: isUnreadableError(error) ? 'unreadable' : 'changed-during-read',
|
|
2189
|
+
});
|
|
2190
|
+
continue;
|
|
2191
|
+
}
|
|
2192
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2193
|
+
return;
|
|
2194
|
+
if (!stat.isSymbolicLink() ||
|
|
2195
|
+
!sameFileIdentity(validation.stat, stat) ||
|
|
2196
|
+
stat.mtimeMs !== validation.stat.mtimeMs ||
|
|
2197
|
+
stat.ctimeMs !== validation.stat.ctimeMs ||
|
|
2198
|
+
!validation.rawTarget.equals(rawTarget)) {
|
|
2199
|
+
invalidateCapturedEntry(relative, {
|
|
2200
|
+
path: relative,
|
|
2201
|
+
size: null,
|
|
2202
|
+
type: 'other',
|
|
2203
|
+
reason: 'changed-during-read',
|
|
2204
|
+
});
|
|
2205
|
+
}
|
|
2206
|
+
continue;
|
|
2207
|
+
}
|
|
2208
|
+
let realTarget;
|
|
2209
|
+
let stat;
|
|
2210
|
+
try {
|
|
2211
|
+
realTarget = await fs.realpath(validation.target);
|
|
2212
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2213
|
+
return;
|
|
2214
|
+
stat = await fs.lstat(validation.target);
|
|
2215
|
+
}
|
|
2216
|
+
catch {
|
|
2217
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2218
|
+
return;
|
|
2219
|
+
invalidateCapturedEntry(relative, {
|
|
2220
|
+
path: relative,
|
|
2221
|
+
size: null,
|
|
2222
|
+
type: 'directory',
|
|
2223
|
+
reason: 'gitlink-unavailable',
|
|
2224
|
+
});
|
|
2225
|
+
continue;
|
|
2226
|
+
}
|
|
2227
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2228
|
+
return;
|
|
2229
|
+
const validBoundary = realTarget === validation.realTarget &&
|
|
2230
|
+
stat.isDirectory() &&
|
|
2231
|
+
!stat.isSymbolicLink() &&
|
|
2232
|
+
sameFileIdentity(validation.stat, stat) &&
|
|
2233
|
+
isInsidePath(physicalProjectRoot, realTarget) &&
|
|
2234
|
+
!sameOrInside(physicalNativeRoot, realTarget);
|
|
2235
|
+
if (!validBoundary) {
|
|
2236
|
+
invalidateCapturedEntry(relative, {
|
|
2237
|
+
path: relative,
|
|
2238
|
+
size: null,
|
|
2239
|
+
type: 'directory',
|
|
2240
|
+
reason: 'gitlink-changed',
|
|
2241
|
+
});
|
|
2242
|
+
continue;
|
|
2243
|
+
}
|
|
2244
|
+
let workingTree;
|
|
2245
|
+
try {
|
|
2246
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2247
|
+
return;
|
|
2248
|
+
workingTree = await inspectGitlinkWorkingTree(execution, realTarget);
|
|
2249
|
+
}
|
|
2250
|
+
catch (error) {
|
|
2251
|
+
if (isNativeGitSnapshotTimeout(error))
|
|
2252
|
+
throw error;
|
|
2253
|
+
invalidateCapturedEntry(relative, {
|
|
2254
|
+
path: relative,
|
|
2255
|
+
size: null,
|
|
2256
|
+
type: 'directory',
|
|
2257
|
+
reason: 'gitlink-unavailable',
|
|
2258
|
+
});
|
|
2259
|
+
continue;
|
|
2260
|
+
}
|
|
2261
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2262
|
+
return;
|
|
2263
|
+
if (workingTree.dirty) {
|
|
2264
|
+
invalidateCapturedEntry(relative, {
|
|
2265
|
+
path: relative,
|
|
2266
|
+
size: null,
|
|
2267
|
+
type: 'directory',
|
|
2268
|
+
reason: 'gitlink-dirty',
|
|
2269
|
+
});
|
|
2270
|
+
}
|
|
2271
|
+
else if (workingTree.hash !== validation.hash) {
|
|
2272
|
+
invalidateCapturedEntry(relative, {
|
|
2273
|
+
path: relative,
|
|
2274
|
+
size: null,
|
|
2275
|
+
type: 'directory',
|
|
2276
|
+
reason: 'gitlink-changed',
|
|
2277
|
+
});
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
for (const [relative, target] of capturedTrackedAbsences) {
|
|
2281
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2282
|
+
return;
|
|
2283
|
+
try {
|
|
2284
|
+
const stat = await fs.lstat(target);
|
|
2285
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2286
|
+
return;
|
|
2287
|
+
omit({
|
|
2288
|
+
path: relative,
|
|
2289
|
+
size: stat.isFile() ? stat.size : null,
|
|
2290
|
+
type: stat.isFile() ? 'file' : stat.isDirectory() ? 'directory' : 'other',
|
|
2291
|
+
reason: 'changed-during-read',
|
|
2292
|
+
});
|
|
2293
|
+
}
|
|
2294
|
+
catch (error) {
|
|
2295
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2296
|
+
return;
|
|
2297
|
+
if (isChangedDuringReadError(error))
|
|
2298
|
+
continue;
|
|
2299
|
+
if (!isUnreadableError(error))
|
|
2300
|
+
throw error;
|
|
2301
|
+
omit({ path: relative, size: null, type: 'file', reason: 'unreadable' });
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
};
|
|
2305
|
+
await captureForcedProtectedRefs();
|
|
2306
|
+
const gitSelection = await nativeGitSnapshotSelection(execution, projectRoot, gitSelectionLimits, options.gitSelectionHooks);
|
|
2307
|
+
if (gitSelection === null) {
|
|
2308
|
+
const before = await nativePhysicalSnapshotSelection({
|
|
2309
|
+
execution,
|
|
2310
|
+
paths,
|
|
2311
|
+
physicalProjectRoot,
|
|
2312
|
+
physicalNativeRoot,
|
|
2313
|
+
denylist,
|
|
2314
|
+
limits: physicalSelectionLimits,
|
|
2315
|
+
hooks: options.physicalSelectionHooks,
|
|
2316
|
+
});
|
|
2317
|
+
await options.physicalSelectionHooks?.afterInitialSelection?.();
|
|
2318
|
+
for (const record of before.records) {
|
|
2319
|
+
if (record.type !== 'file' && record.type !== 'symlink')
|
|
2320
|
+
continue;
|
|
2321
|
+
if (capturedEntryValidations.has(record.path))
|
|
2322
|
+
continue;
|
|
2323
|
+
if (remainingNativeSnapshotTime(execution) < 1)
|
|
2324
|
+
break;
|
|
2325
|
+
if (!snapshotPolicyIncludes(policy, record.path, execution))
|
|
2326
|
+
continue;
|
|
2327
|
+
if (remainingNativeSnapshotTime(execution) < 1)
|
|
2328
|
+
break;
|
|
2329
|
+
const target = path.resolve(projectRoot, ...record.path.split('/'));
|
|
2330
|
+
let stat;
|
|
2331
|
+
try {
|
|
2332
|
+
stat = await fs.lstat(target);
|
|
2333
|
+
}
|
|
2334
|
+
catch (error) {
|
|
2335
|
+
if (!nativeSnapshotExecutionHasBudget(execution))
|
|
2336
|
+
break;
|
|
2337
|
+
if (!isUnreadableError(error) && !isChangedDuringReadError(error))
|
|
2338
|
+
throw error;
|
|
2339
|
+
omit({
|
|
2340
|
+
path: record.path,
|
|
2341
|
+
size: null,
|
|
2342
|
+
type: 'file',
|
|
2343
|
+
reason: isChangedDuringReadError(error) ? 'changed-during-read' : 'unreadable',
|
|
2344
|
+
});
|
|
2345
|
+
continue;
|
|
2346
|
+
}
|
|
2347
|
+
if (remainingNativeSnapshotTime(execution) < 1)
|
|
2348
|
+
break;
|
|
2349
|
+
if (record.type === 'symlink' && stat.isSymbolicLink()) {
|
|
2350
|
+
await captureSymbolicLink(target, record.path, stat);
|
|
2351
|
+
if (remainingNativeSnapshotTime(execution) < 1)
|
|
2352
|
+
break;
|
|
2353
|
+
continue;
|
|
2354
|
+
}
|
|
2355
|
+
if (record.type !== 'file' || !stat.isFile() || stat.isSymbolicLink()) {
|
|
2356
|
+
omit({
|
|
2357
|
+
path: record.path,
|
|
2358
|
+
size: stat.isFile() ? stat.size : null,
|
|
2359
|
+
type: stat.isDirectory() ? 'directory' : stat.isFile() ? 'file' : 'other',
|
|
2360
|
+
reason: 'changed-during-read',
|
|
2361
|
+
});
|
|
2362
|
+
continue;
|
|
2363
|
+
}
|
|
2364
|
+
await captureFile(target, record.path, stat);
|
|
2365
|
+
if (remainingNativeSnapshotTime(execution) < 1)
|
|
2366
|
+
break;
|
|
2367
|
+
}
|
|
2368
|
+
if (remainingNativeSnapshotTime(execution) >= 1)
|
|
2369
|
+
await revalidateCapturedEntries();
|
|
2370
|
+
const after = await nativePhysicalSnapshotSelection({
|
|
2371
|
+
execution,
|
|
2372
|
+
paths,
|
|
2373
|
+
physicalProjectRoot,
|
|
2374
|
+
physicalNativeRoot,
|
|
2375
|
+
denylist,
|
|
2376
|
+
limits: physicalSelectionLimits,
|
|
2377
|
+
});
|
|
2378
|
+
const finalized = finalizeNativePhysicalSelection(before.evidence, after.evidence);
|
|
2379
|
+
physicalSelectionEvidence = finalized.evidence;
|
|
2380
|
+
for (const omission of [...before.omissions, ...after.omissions, ...finalized.omissions]) {
|
|
2381
|
+
if (omitted.some((current) => current.path === omission.path && current.reason === omission.reason)) {
|
|
2382
|
+
continue;
|
|
2383
|
+
}
|
|
2384
|
+
omit(omission);
|
|
2385
|
+
}
|
|
2386
|
+
}
|
|
2387
|
+
else {
|
|
2388
|
+
await options.gitSelectionHooks?.afterInitialSelection?.();
|
|
2389
|
+
for (const relative of selectionPaths(gitSelection)) {
|
|
2390
|
+
if (capturedEntryValidations.has(relative))
|
|
2391
|
+
continue;
|
|
2392
|
+
if (!isSnapshotProjectRef(paths, relative))
|
|
2393
|
+
continue;
|
|
2394
|
+
if (remainingNativeSnapshotTime(execution) < 1)
|
|
2395
|
+
break;
|
|
2396
|
+
if (!snapshotPolicyIncludes(policy, relative, execution))
|
|
2397
|
+
continue;
|
|
2398
|
+
if (remainingNativeSnapshotTime(execution) < 1)
|
|
2399
|
+
break;
|
|
2400
|
+
const target = path.resolve(projectRoot, ...relative.split('/'));
|
|
2401
|
+
if (target === configFile ||
|
|
2402
|
+
target === selectionFile ||
|
|
2403
|
+
denylist.some((denied) => sameOrInside(denied, target))) {
|
|
2404
|
+
continue;
|
|
2405
|
+
}
|
|
2406
|
+
if (gitSelection.gitlinks.has(relative)) {
|
|
2407
|
+
if (entries.length >= limits.maxFiles) {
|
|
2408
|
+
omit({ path: relative, size: 0, type: 'file', reason: 'file-count' });
|
|
2409
|
+
continue;
|
|
2410
|
+
}
|
|
2411
|
+
let realGitlink;
|
|
2412
|
+
let gitlinkStat;
|
|
2413
|
+
try {
|
|
2414
|
+
[realGitlink, gitlinkStat] = await Promise.all([fs.realpath(target), fs.lstat(target)]);
|
|
2415
|
+
}
|
|
2416
|
+
catch {
|
|
2417
|
+
omit({
|
|
2418
|
+
path: relative,
|
|
2419
|
+
size: null,
|
|
2420
|
+
type: 'directory',
|
|
2421
|
+
reason: 'gitlink-unavailable',
|
|
2422
|
+
});
|
|
2423
|
+
continue;
|
|
2424
|
+
}
|
|
2425
|
+
if (gitlinkStat.isSymbolicLink() ||
|
|
2426
|
+
!gitlinkStat.isDirectory() ||
|
|
2427
|
+
!isInsidePath(physicalProjectRoot, realGitlink) ||
|
|
2428
|
+
sameOrInside(physicalNativeRoot, realGitlink)) {
|
|
2429
|
+
omit({
|
|
2430
|
+
path: relative,
|
|
2431
|
+
size: null,
|
|
2432
|
+
type: 'directory',
|
|
2433
|
+
reason: 'gitlink-unavailable',
|
|
2434
|
+
});
|
|
2435
|
+
continue;
|
|
2436
|
+
}
|
|
2437
|
+
try {
|
|
2438
|
+
const workingTree = await inspectGitlinkWorkingTree(execution, realGitlink);
|
|
2439
|
+
if (workingTree.dirty) {
|
|
2440
|
+
omit({
|
|
2441
|
+
path: relative,
|
|
2442
|
+
size: null,
|
|
2443
|
+
type: 'directory',
|
|
2444
|
+
reason: 'gitlink-dirty',
|
|
2445
|
+
});
|
|
2446
|
+
continue;
|
|
2447
|
+
}
|
|
2448
|
+
await recordCapturedEntry({
|
|
2449
|
+
path: relative,
|
|
2450
|
+
hash: workingTree.hash,
|
|
2451
|
+
size: 0,
|
|
2452
|
+
type: 'file',
|
|
2453
|
+
}, {
|
|
2454
|
+
kind: 'gitlink',
|
|
2455
|
+
target,
|
|
2456
|
+
realTarget: realGitlink,
|
|
2457
|
+
stat: gitlinkStat,
|
|
2458
|
+
hash: workingTree.hash,
|
|
2459
|
+
});
|
|
2460
|
+
}
|
|
2461
|
+
catch (error) {
|
|
2462
|
+
if (isNativeGitSnapshotTimeout(error))
|
|
2463
|
+
throw error;
|
|
2464
|
+
// The index knows this is a gitlink, but an uninitialized, unreadable, or
|
|
2465
|
+
// concurrently changing checkout has no trustworthy working-tree pointer.
|
|
2466
|
+
omit({
|
|
2467
|
+
path: relative,
|
|
2468
|
+
size: null,
|
|
2469
|
+
type: 'directory',
|
|
2470
|
+
reason: 'gitlink-unavailable',
|
|
2471
|
+
});
|
|
2472
|
+
}
|
|
2473
|
+
continue;
|
|
2474
|
+
}
|
|
2475
|
+
let before;
|
|
2476
|
+
try {
|
|
2477
|
+
before = await fs.lstat(target);
|
|
2478
|
+
}
|
|
2479
|
+
catch (error) {
|
|
2480
|
+
if (isChangedDuringReadError(error) && gitSelection.tracked.has(relative)) {
|
|
2481
|
+
capturedTrackedAbsences.set(relative, target);
|
|
2482
|
+
continue;
|
|
2483
|
+
}
|
|
2484
|
+
if (!isUnreadableError(error) && !isChangedDuringReadError(error))
|
|
2485
|
+
throw error;
|
|
2486
|
+
omit({
|
|
2487
|
+
path: relative,
|
|
2488
|
+
size: null,
|
|
2489
|
+
type: 'file',
|
|
2490
|
+
reason: isChangedDuringReadError(error) ? 'changed-during-read' : 'unreadable',
|
|
2491
|
+
});
|
|
2492
|
+
continue;
|
|
2493
|
+
}
|
|
2494
|
+
if (before.isSymbolicLink()) {
|
|
2495
|
+
await captureSymbolicLink(target, relative, before);
|
|
2496
|
+
continue;
|
|
2497
|
+
}
|
|
2498
|
+
if (!before.isFile()) {
|
|
2499
|
+
if (!gitSelection.nestedRepositories.has(relative)) {
|
|
2500
|
+
omit({ path: relative, size: null, type: 'other', reason: 'changed-during-read' });
|
|
2501
|
+
}
|
|
2502
|
+
continue;
|
|
2503
|
+
}
|
|
2504
|
+
await captureFile(target, relative, before);
|
|
2505
|
+
}
|
|
2506
|
+
await revalidateCapturedEntries();
|
|
2507
|
+
await finalizeNativeGitSnapshotSelection(execution, projectRoot, gitSelectionLimits, gitSelection, options.gitSelectionHooks?.outputChunkBytes);
|
|
2508
|
+
for (const omission of gitSelection.omissions)
|
|
2509
|
+
omit(omission);
|
|
2510
|
+
if (gitSelection.overflow)
|
|
2511
|
+
foldGitSelectionOverflow(gitSelection.overflow);
|
|
2512
|
+
}
|
|
2513
|
+
entries.sort((left, right) => left.path.localeCompare(right.path, 'en'));
|
|
2514
|
+
omitted.sort((left, right) => left.path.localeCompare(right.path, 'en'));
|
|
2515
|
+
const capture = gitSelection === null
|
|
2516
|
+
? {
|
|
2517
|
+
provider: 'physical-tree',
|
|
2518
|
+
...(physicalSelectionEvidence ? { physicalSelection: physicalSelectionEvidence } : {}),
|
|
2519
|
+
}
|
|
2520
|
+
: {
|
|
2521
|
+
provider: 'git',
|
|
2522
|
+
...(gitSelection.evidence ? { gitSelection: gitSelection.evidence } : {}),
|
|
2523
|
+
};
|
|
2524
|
+
const buildManifest = () => ({
|
|
2525
|
+
schema: 'comet.native.content-snapshot.v1',
|
|
2526
|
+
origin: options.origin ?? 'explicit',
|
|
2527
|
+
capture,
|
|
2528
|
+
createdAt: (options.now ?? new Date()).toISOString(),
|
|
2529
|
+
complete: omittedCount === 0,
|
|
2530
|
+
limits,
|
|
2531
|
+
...(policy ? { policy: policy.manifest } : {}),
|
|
2532
|
+
entries,
|
|
2533
|
+
omitted,
|
|
2534
|
+
omittedCount,
|
|
2535
|
+
...(overflowCount > 0
|
|
2536
|
+
? {
|
|
2537
|
+
omissionOverflow: {
|
|
2538
|
+
ref: `native-snapshot://omitted-overflow/${overflowHash}`,
|
|
2539
|
+
hash: overflowHash,
|
|
2540
|
+
count: overflowCount,
|
|
2541
|
+
},
|
|
2542
|
+
}
|
|
2543
|
+
: {}),
|
|
2544
|
+
});
|
|
2545
|
+
let manifest = buildManifest();
|
|
2546
|
+
while (serializedManifestBytes(manifest) > limits.maxManifestBytes) {
|
|
2547
|
+
const compactableOmissionCount = omitted.filter((omission) => !isSelectionIntegrityOmission(omission)).length;
|
|
2548
|
+
if (compactableOmissionCount > 0) {
|
|
2549
|
+
const removeCount = Math.max(1, Math.ceil(omitted.length / 4));
|
|
2550
|
+
for (let removed = 0; removed < removeCount; removed += 1) {
|
|
2551
|
+
const omission = takeLastCompactableOmission(omitted);
|
|
2552
|
+
if (omission === null)
|
|
2553
|
+
break;
|
|
2554
|
+
foldOverflow(omission);
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
else if (entries.length > 0) {
|
|
2558
|
+
const removeCount = Math.max(1, Math.ceil(entries.length / 4));
|
|
2559
|
+
for (const entry of entries.splice(-removeCount)) {
|
|
2560
|
+
omittedCount += 1;
|
|
2561
|
+
foldManifestEntryOverflow(entry);
|
|
2562
|
+
}
|
|
2563
|
+
}
|
|
2564
|
+
else {
|
|
2565
|
+
throw new Error('Native snapshot manifest byte limit is too small for its metadata');
|
|
2566
|
+
}
|
|
2567
|
+
manifest = buildManifest();
|
|
2568
|
+
}
|
|
2569
|
+
return manifest;
|
|
2570
|
+
}
|
|
2571
|
+
export async function createNativeCurrentContentSnapshot(paths, baseline, options = {}) {
|
|
2572
|
+
const config = await readProjectConfig(paths.projectRoot);
|
|
2573
|
+
const settings = config?.native.snapshot ?? DEFAULT_NATIVE_SNAPSHOT_CONFIG;
|
|
2574
|
+
return createNativeContentSnapshot(paths, {
|
|
2575
|
+
...options,
|
|
2576
|
+
policy: baseline.policy,
|
|
2577
|
+
limits: {
|
|
2578
|
+
maxFiles: settings.max_files,
|
|
2579
|
+
maxFileBytes: settings.max_total_bytes,
|
|
2580
|
+
maxTotalBytes: settings.max_total_bytes,
|
|
2581
|
+
maxDurationMs: settings.max_duration_ms,
|
|
2582
|
+
},
|
|
2583
|
+
deadlineMs: settings.max_duration_ms,
|
|
2584
|
+
});
|
|
2585
|
+
}
|
|
2586
|
+
export async function writeNativeBaselineManifest(paths, name, manifest) {
|
|
2587
|
+
const file = nativeBaselineManifestFile(paths, name);
|
|
2588
|
+
await resolveContainedNativePath(paths.nativeRoot, file);
|
|
2589
|
+
await atomicWriteJson(file, parseNativeContentSnapshotManifest(manifest));
|
|
2590
|
+
}
|
|
2591
|
+
export async function readNativeBaselineManifest(paths, name) {
|
|
2592
|
+
const file = nativeBaselineManifestFile(paths, name);
|
|
2593
|
+
await resolveContainedNativePath(paths.nativeRoot, file);
|
|
2594
|
+
try {
|
|
2595
|
+
const source = await readNativeProtectedTextFile({
|
|
2596
|
+
root: paths.nativeRoot,
|
|
2597
|
+
file,
|
|
2598
|
+
maxBytes: NATIVE_SNAPSHOT_MANIFEST_HARD_MAX_BYTES,
|
|
2599
|
+
label: 'Native baseline snapshot manifest',
|
|
2600
|
+
});
|
|
2601
|
+
return parseNativeContentSnapshotManifest(JSON.parse(source.text));
|
|
2602
|
+
}
|
|
2603
|
+
catch (error) {
|
|
2604
|
+
if (error.code === 'ENOENT')
|
|
2605
|
+
return null;
|
|
2606
|
+
throw error;
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
//# sourceMappingURL=native-snapshot.js.map
|