b2c-app-builder 0.221.39
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/ACKNOWLEDGMENTS.md +168 -0
- package/LICENSE +21 -0
- package/README.md +252 -0
- package/SKILL.md +59 -0
- package/THIRD_PARTY_NOTICES.md +1091 -0
- package/adapters/app-review/archive.ts +55 -0
- package/adapters/app-review/asc-boundary.ts +85 -0
- package/adapters/app-review/asc-provider.ts +499 -0
- package/adapters/app-review/auth.ts +75 -0
- package/adapters/app-review/capability.ts +240 -0
- package/adapters/app-review/classify.ts +116 -0
- package/adapters/app-review/consume.ts +108 -0
- package/adapters/app-review/envelope.ts +119 -0
- package/adapters/app-review/events.ts +451 -0
- package/adapters/app-review/hmac.ts +106 -0
- package/adapters/app-review/implement.ts +81 -0
- package/adapters/app-review/index.ts +172 -0
- package/adapters/app-review/ingest.ts +108 -0
- package/adapters/app-review/mandate.ts +102 -0
- package/adapters/app-review/normalize.ts +281 -0
- package/adapters/app-review/packet.ts +365 -0
- package/adapters/app-review/persist.ts +93 -0
- package/adapters/app-review/plan.ts +321 -0
- package/adapters/app-review/plist.ts +219 -0
- package/adapters/app-review/poll.ts +310 -0
- package/adapters/app-review/projection.ts +149 -0
- package/adapters/app-review/queue.ts +138 -0
- package/adapters/app-review/receiver.ts +111 -0
- package/adapters/app-review/registration.ts +95 -0
- package/adapters/app-review/remediate.ts +218 -0
- package/adapters/app-review/render.ts +180 -0
- package/adapters/app-review/resubmit.ts +357 -0
- package/adapters/app-review/types.ts +540 -0
- package/adapters/app-review/uncertain-execution.ts +205 -0
- package/adapters/app-review/verification.ts +42 -0
- package/adapters/appkittie-category-revenue.ts +106 -0
- package/adapters/claude.ts +69 -0
- package/adapters/codex.ts +65 -0
- package/adapters/cursor.ts +66 -0
- package/adapters/device-proof.ts +814 -0
- package/adapters/greenfield/boundary.ts +200 -0
- package/adapters/greenfield/fail-safe.ts +204 -0
- package/adapters/greenfield/index.ts +33 -0
- package/adapters/inline.ts +46 -0
- package/adapters/install-control-permissions.ts +331 -0
- package/adapters/install-entrypoints.ts +422 -0
- package/adapters/install-schedule.ts +700 -0
- package/adapters/ios-app-evidence.ts +136 -0
- package/adapters/mobile-operation-host.ts +209 -0
- package/adapters/mobile-operation.ts +131 -0
- package/adapters/operating.ts +8 -0
- package/adapters/probe.ts +48 -0
- package/adapters/profile.ts +272 -0
- package/adapters/providers/capability-delta.ts +84 -0
- package/adapters/providers/contract.ts +89 -0
- package/adapters/providers/evaluate.ts +125 -0
- package/adapters/providers/expo/argv.ts +228 -0
- package/adapters/providers/expo/decode.ts +702 -0
- package/adapters/providers/expo/discovery.ts +145 -0
- package/adapters/providers/expo/doctor.ts +217 -0
- package/adapters/providers/expo/effects.ts +185 -0
- package/adapters/providers/expo/execute.ts +389 -0
- package/adapters/providers/expo/expo-device-bind.ts +176 -0
- package/adapters/providers/expo/expo-mcp-route.ts +394 -0
- package/adapters/providers/expo/hosting-prepare.ts +195 -0
- package/adapters/providers/expo/identity.ts +117 -0
- package/adapters/providers/expo/index.ts +176 -0
- package/adapters/providers/expo/jobs.ts +490 -0
- package/adapters/providers/expo/preflight.ts +319 -0
- package/adapters/providers/expo/process.ts +156 -0
- package/adapters/providers/expo/project-config.ts +184 -0
- package/adapters/providers/expo/sanitize.ts +51 -0
- package/adapters/providers/expo/signing-readiness.ts +157 -0
- package/adapters/providers/expo/store-handoff.ts +74 -0
- package/adapters/providers/expo/update-identity.ts +121 -0
- package/adapters/providers/expo/update-policy.ts +130 -0
- package/adapters/providers/expo/update-prepare.ts +176 -0
- package/adapters/providers/expo/update-recovery.ts +152 -0
- package/adapters/providers/expo/update-rollout.ts +114 -0
- package/adapters/providers/expo/update-signing.ts +100 -0
- package/adapters/providers/expo/web-api-contract.ts +185 -0
- package/adapters/providers/growth-agent/boundary.ts +178 -0
- package/adapters/providers/growth-agent/fail-safe.ts +306 -0
- package/adapters/providers/growth-agent/index.ts +36 -0
- package/adapters/providers/layers/effects.ts +94 -0
- package/adapters/providers/layers/index.ts +91 -0
- package/adapters/providers/layers/jobs.ts +269 -0
- package/adapters/providers/layers/onboarding.ts +144 -0
- package/adapters/providers/layers/route.ts +308 -0
- package/adapters/providers/layers/transport.ts +251 -0
- package/adapters/providers/load.ts +293 -0
- package/adapters/providers/mobile-ops/boundary.ts +137 -0
- package/adapters/providers/mobile-ops/fail-safe.ts +273 -0
- package/adapters/providers/mobile-ops/index.ts +27 -0
- package/adapters/providers/monetization-validation.ts +80 -0
- package/adapters/providers/revenuecat/cli-catalog-observe.ts +254 -0
- package/adapters/providers/revenuecat/cli-catalog.ts +1146 -0
- package/adapters/providers/revenuecat/cli-command-schema.ts +369 -0
- package/adapters/providers/revenuecat/cli-decode.ts +908 -0
- package/adapters/providers/revenuecat/cli-discovery.ts +248 -0
- package/adapters/providers/revenuecat/cli-doctor.ts +279 -0
- package/adapters/providers/revenuecat/cli-execute.ts +456 -0
- package/adapters/providers/revenuecat/cli-ledger.ts +488 -0
- package/adapters/providers/revenuecat/cli-operations.ts +927 -0
- package/adapters/providers/revenuecat/cli-preflight.ts +245 -0
- package/adapters/providers/revenuecat/cli-process.ts +195 -0
- package/adapters/providers/revenuecat/cli-proof.ts +159 -0
- package/adapters/providers/revenuecat/cli-reconcile-plan.ts +1144 -0
- package/adapters/providers/revenuecat/provisioning.ts +54 -0
- package/adapters/providers/revenuecat/revenue-validation.ts +1224 -0
- package/adapters/providers/runtime-pin.ts +112 -0
- package/adapters/providers/superwall/boundary.ts +107 -0
- package/adapters/providers/superwall/fail-safe.ts +231 -0
- package/adapters/providers/superwall/measurement.ts +62 -0
- package/adapters/providers/typesafe/assess.ts +264 -0
- package/adapters/providers/typesafe/binding.ts +47 -0
- package/adapters/providers/typesafe/connection.ts +89 -0
- package/adapters/providers/typesafe/decode.ts +348 -0
- package/adapters/providers/typesafe/effects.ts +101 -0
- package/adapters/providers/typesafe/encode.ts +97 -0
- package/adapters/providers/typesafe/index.ts +71 -0
- package/adapters/providers/typesafe/support.ts +109 -0
- package/adapters/providers/typesafe/transport.ts +395 -0
- package/adapters/provisioning/capability-gaps.ts +110 -0
- package/adapters/provisioning/capability-readiness.ts +60 -0
- package/adapters/provisioning/cli.ts +274 -0
- package/adapters/provisioning/requirements.ts +525 -0
- package/adapters/provisioning/resolve.ts +356 -0
- package/adapters/registry.ts +225 -0
- package/agents/skills/b2c-app-builder/references/business-lifecycle.md +75 -0
- package/agents/skills/b2c-app-builder/references/composition.md +7 -0
- package/agents/skills/b2c-app-builder/references/mobile-operation.md +5 -0
- package/agents/skills/b2c-app-builder/references/setup.md +18 -0
- package/agents/skills/b2c-define-product/SKILL.md +49 -0
- package/agents/skills/b2c-define-product/references/task.md +42 -0
- package/agents/skills/b2c-design-onboarding/SKILL.md +51 -0
- package/agents/skills/b2c-design-onboarding/references/stages.md +31 -0
- package/agents/skills/b2c-design-onboarding/references/task.md +31 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-conversion.md +43 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-01-current-state-trace.md +35 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-02-evidence-plan.md +35 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-03-current-guidance.md +35 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-04-competitor-reviews.md +35 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-05-onbo-hub-atlas.md +35 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-06-internal-guidance-audit.md +35 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-07-provider-policy-landscape.md +37 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-08-motion-research.md +35 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-09-evidence-join.md +37 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-10-first-value-activation.md +35 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-11-effort-question-audit.md +35 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-12-state-identity-contract.md +38 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-13-analytics-experiments.md +38 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-14-trust-lifecycle-policy.md +35 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-15-architecture-decision.md +35 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-16-journey-graph.md +37 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-17-screen-control-paywall-contract.md +40 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-18-visual-design-prototype.md +40 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-19-implementation-cutover-contract.md +37 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-20-adversarial-qa.md +38 -0
- package/agents/skills/b2c-design-onboarding/references/workflow.experience.onboarding-system.onb-21-compound-engineering-plan.md +35 -0
- package/agents/skills/b2c-plan-implementation/SKILL.md +66 -0
- package/agents/skills/b2c-plan-implementation/references/task.md +41 -0
- package/agents/skills/b2c-plan-launch/SKILL.md +50 -0
- package/agents/skills/b2c-plan-launch/references/task.md +37 -0
- package/agents/skills/b2c-research-opportunity/SKILL.md +63 -0
- package/agents/skills/b2c-research-opportunity/references/task.md +42 -0
- package/agents/skills/b2c-review-business-performance/SKILL.md +50 -0
- package/agents/skills/b2c-review-business-performance/references/task.md +37 -0
- package/agents/skills/b2c-review-experience/SKILL.md +48 -0
- package/agents/skills/b2c-review-experience/references/task.md +36 -0
- package/agents/skills/b2c-review-monetization/SKILL.md +50 -0
- package/agents/skills/b2c-review-monetization/references/task.md +40 -0
- package/agents/skills/b2c-verify-release-readiness/SKILL.md +47 -0
- package/agents/skills/b2c-verify-release-readiness/references/task.md +36 -0
- package/catalog/agent-graph/load.ts +110 -0
- package/catalog/agent-graph/types.ts +53 -0
- package/catalog/agent-graph/validate.ts +121 -0
- package/catalog/agent-graph/work.schema.json +65 -0
- package/catalog/agent-graph/work.yaml +173 -0
- package/catalog/areas.ts +95 -0
- package/catalog/artifacts.ts +40 -0
- package/catalog/authoring.ts +46 -0
- package/catalog/bridge.ts +220 -0
- package/catalog/business-primitives.ts +82 -0
- package/catalog/business-units.ts +18 -0
- package/catalog/capabilities/paid-generative-ai/capability.yaml +27 -0
- package/catalog/capabilities/paid-generative-ai/controls.md +37 -0
- package/catalog/capabilities/types.ts +25 -0
- package/catalog/capabilities/web-presence/capability.yaml +37 -0
- package/catalog/capabilities/web-presence/shared.md +5 -0
- package/catalog/context-packs.ts +78 -0
- package/catalog/domain-authority.ts +38 -0
- package/catalog/domains.ts +178 -0
- package/catalog/firstparty-declarations.ts +652 -0
- package/catalog/firstparty-recipes.ts +283 -0
- package/catalog/gates.ts +99 -0
- package/catalog/generated/catalog.json +18892 -0
- package/catalog/generated/contracts.md +1565 -0
- package/catalog/generated/firstparty/catalog/render-routing.ts +410 -0
- package/catalog/generated/firstparty/catalog/upstreams/notices/amir-brand-system.txt +395 -0
- package/catalog/generated/firstparty/catalog/upstreams/notices/amir-cinematic-scroll.txt +21 -0
- package/catalog/generated/firstparty/catalog/upstreams/notices/appllama-skills.txt +21 -0
- package/catalog/generated/firstparty/catalog/upstreams/notices/eronred-aso-skills.txt +21 -0
- package/catalog/generated/firstparty/catalog/upstreams/notices/evanbacon-serve-sim.txt +202 -0
- package/catalog/generated/firstparty/catalog/upstreams/notices/parth-app-store-screenshots.txt +21 -0
- package/catalog/generated/firstparty/catalog/upstreams/notices/posthog-wizard.txt +21 -0
- package/catalog/generated/firstparty/catalog/upstreams/notices/revenuecat-ai-toolkit.txt +21 -0
- package/catalog/generated/firstparty/catalog/upstreams/notices/revenuecat-cli.txt +21 -0
- package/catalog/generated/firstparty/catalog/upstreams/notices/rork-app-store-connect-cli-skills.txt +21 -0
- package/catalog/generated/firstparty/catalog/upstreams/notices/rork-app-store-connect-cli.txt +21 -0
- package/catalog/generated/firstparty/catalog/upstreams/notices/sentry-snapshotpreviews.txt +22 -0
- package/catalog/generated/firstparty/catalog/upstreams/notices/sentry-xcodebuildmcp.txt +21 -0
- package/catalog/generated/firstparty/catalog-pack.yaml +12960 -0
- package/catalog/generated/firstparty/checks/validation/business/data/check-analytics-catalog.ts +166 -0
- package/catalog/generated/firstparty/checks/validation/business/data/check-attribution-contract.ts +731 -0
- package/catalog/generated/firstparty/checks/validation/business/design/check-audience-identity.ts +260 -0
- package/catalog/generated/firstparty/checks/validation/business/design/check-browser-runtime-proof.ts +269 -0
- package/catalog/generated/firstparty/checks/validation/business/design/check-component-contracts.ts +365 -0
- package/catalog/generated/firstparty/checks/validation/business/design/check-content-assets.ts +600 -0
- package/catalog/generated/firstparty/checks/validation/business/design/check-design-acceptance.ts +6 -0
- package/catalog/generated/firstparty/checks/validation/business/design/check-design-md.ts +19 -0
- package/catalog/generated/firstparty/checks/validation/business/design/check-design-room-contract.ts +200 -0
- package/catalog/generated/firstparty/checks/validation/business/design/check-design-worthiness.ts +710 -0
- package/catalog/generated/firstparty/checks/validation/business/design/check-motion-contract.ts +1374 -0
- package/catalog/generated/firstparty/checks/validation/business/design/check-scrollytelling-contract.ts +1486 -0
- package/catalog/generated/firstparty/checks/validation/business/design/check-token-promotion.ts +75 -0
- package/catalog/generated/firstparty/checks/validation/business/design/check-vibecoded-tells.ts +396 -0
- package/catalog/generated/firstparty/checks/validation/business/design/validate-state.ts +15 -0
- package/catalog/generated/firstparty/checks/validation/business/engineering/check-archetype-starter.ts +457 -0
- package/catalog/generated/firstparty/checks/validation/business/engineering/check-backend-data-contract.ts +151 -0
- package/catalog/generated/firstparty/checks/validation/business/engineering/check-compound-engineering-routing.ts +153 -0
- package/catalog/generated/firstparty/checks/validation/business/engineering/check-mobai-proof.ts +486 -0
- package/catalog/generated/firstparty/checks/validation/business/engineering/check-native-android-proof.ts +486 -0
- package/catalog/generated/firstparty/checks/validation/business/engineering/check-native-ios-proof.ts +465 -0
- package/catalog/generated/firstparty/checks/validation/business/engineering/check-readiness-coverage.ts +242 -0
- package/catalog/generated/firstparty/checks/validation/business/engineering/check-roster-headless-safety.ts +70 -0
- package/catalog/generated/firstparty/checks/validation/business/engineering/check-roster-overlap.ts +159 -0
- package/catalog/generated/firstparty/checks/validation/business/engineering/check-source-checkpoint.ts +123 -0
- package/catalog/generated/firstparty/checks/validation/business/engineering/check-technical-docs-ste100.ts +319 -0
- package/catalog/generated/firstparty/checks/validation/business/engineering/check-template-safety.ts +75 -0
- package/catalog/generated/firstparty/checks/validation/business/experience/check-emotional-design.ts +1246 -0
- package/catalog/generated/firstparty/checks/validation/business/experience/check-onboarding-cutover-repository.ts +157 -0
- package/catalog/generated/firstparty/checks/validation/business/experience/check-onboarding-evidence-packet.ts +263 -0
- package/catalog/generated/firstparty/checks/validation/business/experience/check-onboarding-foundations.ts +16 -0
- package/catalog/generated/firstparty/checks/validation/business/experience/check-onboarding-graph.ts +795 -0
- package/catalog/generated/firstparty/checks/validation/business/growth/check-landing-funnel.ts +593 -0
- package/catalog/generated/firstparty/checks/validation/business/growth/check-paid-user-acquisition.ts +601 -0
- package/catalog/generated/firstparty/checks/validation/business/money/check-price-derivation.ts +127 -0
- package/catalog/generated/firstparty/checks/validation/business/money/check-revenue.ts +72 -0
- package/catalog/generated/firstparty/checks/validation/business/operations/check-agent-operations.ts +709 -0
- package/catalog/generated/firstparty/checks/validation/business/operations/check-email.ts +356 -0
- package/catalog/generated/firstparty/checks/validation/business/operations/check-founder-operator-bootstrap.ts +759 -0
- package/catalog/generated/firstparty/checks/validation/business/operations/check-paid-tool-intake.ts +71 -0
- package/catalog/generated/firstparty/checks/validation/business/operations/check-portfolio-registry.ts +99 -0
- package/catalog/generated/firstparty/checks/validation/business/operations/check-post-launch-ops.ts +834 -0
- package/catalog/generated/firstparty/checks/validation/business/orchestration/check-continuity-contract.ts +266 -0
- package/catalog/generated/firstparty/checks/validation/business/orchestration/check-parallel-orchestration.ts +218 -0
- package/catalog/generated/firstparty/checks/validation/business/orchestration/validate-project-state.ts +357 -0
- package/catalog/generated/firstparty/checks/validation/business/process/check-artifact-templates.ts +103 -0
- package/catalog/generated/firstparty/checks/validation/business/process/check-change-cascade.ts +318 -0
- package/catalog/generated/firstparty/checks/validation/business/process/check-generated-pages.ts +153 -0
- package/catalog/generated/firstparty/checks/validation/business/process/check-lane-coverage.ts +377 -0
- package/catalog/generated/firstparty/checks/validation/business/process/check-live-provider-proof.ts +284 -0
- package/catalog/generated/firstparty/checks/validation/business/process/check-repository-profile.ts +43 -0
- package/catalog/generated/firstparty/checks/validation/business/product/check-app-archetype.ts +266 -0
- package/catalog/generated/firstparty/checks/validation/business/product/check-product-md.ts +67 -0
- package/catalog/generated/firstparty/checks/validation/business/research/check-evidence-schema-drift.ts +50 -0
- package/catalog/generated/firstparty/checks/validation/business/research/check-localization-research.ts +144 -0
- package/catalog/generated/firstparty/checks/validation/business/research/check-research-evidence.ts +1324 -0
- package/catalog/generated/firstparty/checks/validation/business/store/check-app-review-contract.ts +433 -0
- package/catalog/generated/firstparty/checks/validation/business/store/check-app-store-portfolio.ts +279 -0
- package/catalog/generated/firstparty/checks/validation/business/store/check-apple-app-store-requirements.ts +735 -0
- package/catalog/generated/firstparty/checks/validation/business/store/check-asc-command-contract.ts +175 -0
- package/catalog/generated/firstparty/checks/validation/business/store/check-aso-evidence.ts +162 -0
- package/catalog/generated/firstparty/checks/validation/business/store/check-store-console-packet.ts +480 -0
- package/catalog/generated/firstparty/checks/validation/business/store/check-store-screenshots.ts +1113 -0
- package/catalog/generated/firstparty/checks/validation/business/trust/check-ai-provider-controls.ts +127 -0
- package/catalog/generated/firstparty/checks/validation/business/trust/check-privacy-terms.ts +238 -0
- package/catalog/generated/firstparty/checks/validation/business/trust/check-secret-routing.ts +233 -0
- package/catalog/generated/firstparty/checks/validation/business/trust/check-security-release.ts +199 -0
- package/catalog/generated/firstparty/checks/validation/business/words/check-app-copy.ts +1019 -0
- package/catalog/generated/firstparty/checks/validation/business/words/check-founder-copy.ts +471 -0
- package/catalog/generated/firstparty/checks/validation/business/words/check-no-slop.ts +148 -0
- package/catalog/generated/firstparty/checks/validation/repository/audit-skill-links.ts +176 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-agent-entrypoints.ts +259 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-architecture.ts +393 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-autopilot-contract.ts +277 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-capability-delta.ts +30 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-catalog.ts +88 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-engine-e2e.ts +609 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-gates-layout.ts +109 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-graph-foundations.ts +158 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-hub-spoke.ts +144 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-learning-grounding.ts +323 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-operating-graph.ts +205 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-pack-composition.ts +94 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-package-parity.ts +632 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-provider-contracts.ts +24 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-reference-size.ts +354 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-repository-boundary.ts +2385 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-skill-supply-chain.ts +290 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-skill-version.ts +363 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-source-freshness.ts +627 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-task-skills.ts +40 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-upstreams.ts +189 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-validator-docs.ts +84 -0
- package/catalog/generated/firstparty/checks/validation/repository/check-version-discipline.ts +314 -0
- package/catalog/generated/firstparty/checks/validation/repository/run-agent-evals.ts +117 -0
- package/catalog/generated/firstparty/checks/validation/repository/run-behavioral-evals.ts +612 -0
- package/catalog/generated/firstparty/checks/validation/repository/run-launchbench.ts +246 -0
- package/catalog/generated/firstparty/checks/validation/repository/run-validator-fixtures.ts +173 -0
- package/catalog/generated/firstparty/examples/workspace/business/analytics/ANALYTICS.md +186 -0
- package/catalog/generated/firstparty/examples/workspace/business/analytics/analytics-plan.html +14 -0
- package/catalog/generated/firstparty/examples/workspace/business/design/motion-catalog/README.md +74 -0
- package/catalog/generated/firstparty/examples/workspace/business/design/system/PremiumCraft.swift +352 -0
- package/catalog/generated/firstparty/examples/workspace/business/growth/LAUNCH_NARRATIVE.md +241 -0
- package/catalog/generated/firstparty/examples/workspace/business/growth/PAID_UA.md +142 -0
- package/catalog/generated/firstparty/examples/workspace/business/growth/VIRAL_GROWTH.md +130 -0
- package/catalog/generated/firstparty/examples/workspace/business/growth/content-assets/CONTENT_ASSETS.md +127 -0
- package/catalog/generated/firstparty/examples/workspace/business/growth/landing/scrollytelling.portable.example.html +156 -0
- package/catalog/generated/firstparty/examples/workspace/business/product/copy/COPY_BRIEF.md +64 -0
- package/catalog/generated/firstparty/examples/workspace/business/product/copy/COPY_DECK.md +84 -0
- package/catalog/generated/firstparty/examples/workspace/business/product/experience/11-star-experience/11_STAR_EXPERIENCE.md +93 -0
- package/catalog/generated/firstparty/examples/workspace/business/product/experience/emotional-design/EMOTIONAL_DESIGN.md +355 -0
- package/catalog/generated/firstparty/examples/workspace/business/product/experience/ux-patterns/UX_PATTERNS.md +144 -0
- package/catalog/generated/firstparty/examples/workspace/business/state/LAUNCH_TRACE.md +29 -0
- package/catalog/generated/firstparty/examples/workspace/business/store/app-store-listing/APP_STORE_LISTING.md +160 -0
- package/catalog/generated/firstparty/examples/workspace/business/store/app-store-listing/SCREENSHOT_RUBRIC.md +202 -0
- package/catalog/generated/firstparty/extension.yaml +12344 -0
- package/catalog/generated/firstparty/kernel/schema/evidence-schema-version.ts +82 -0
- package/catalog/generated/firstparty/knowledge/data/analytics-attribution.md +317 -0
- package/catalog/generated/firstparty/knowledge/data/posthog-agent-tooling.md +101 -0
- package/catalog/generated/firstparty/knowledge/design/audience-derived-identity.md +55 -0
- package/catalog/generated/firstparty/knowledge/design/consumer-craft-benchmarks.md +72 -0
- package/catalog/generated/firstparty/knowledge/design/design-acceptance.md +199 -0
- package/catalog/generated/firstparty/knowledge/design/design-evidence-stack.md +130 -0
- package/catalog/generated/firstparty/knowledge/design/design-room.md +83 -0
- package/catalog/generated/firstparty/knowledge/design/design-visual-system.md +247 -0
- package/catalog/generated/firstparty/knowledge/design/design-worthiness.md +188 -0
- package/catalog/generated/firstparty/knowledge/design/editorial-scrollytelling.md +239 -0
- package/catalog/generated/firstparty/knowledge/design/landing-motion-craft.md +67 -0
- package/catalog/generated/firstparty/knowledge/design/mobile-flow-craft.md +177 -0
- package/catalog/generated/firstparty/knowledge/design/motion-craft-benchmarks.md +340 -0
- package/catalog/generated/firstparty/knowledge/design/premium-mobile-craft.md +137 -0
- package/catalog/generated/firstparty/knowledge/design/quality-lens.md +100 -0
- package/catalog/generated/firstparty/knowledge/design/refero-ux-patterns.md +131 -0
- package/catalog/generated/firstparty/knowledge/design/remotion-content-assets.md +370 -0
- package/catalog/generated/firstparty/knowledge/design/surfaces-b2c.md +84 -0
- package/catalog/generated/firstparty/knowledge/design/vibecoded-tells.md +129 -0
- package/catalog/generated/firstparty/knowledge/engineering/accessibility-readiness.md +24 -0
- package/catalog/generated/firstparty/knowledge/engineering/app-agent-roster.md +120 -0
- package/catalog/generated/firstparty/knowledge/engineering/app-quality.md +19 -0
- package/catalog/generated/firstparty/knowledge/engineering/backend-data-contract.md +187 -0
- package/catalog/generated/firstparty/knowledge/engineering/engineering-orchestration.md +365 -0
- package/catalog/generated/firstparty/knowledge/engineering/expo-compatibility.md +74 -0
- package/catalog/generated/firstparty/knowledge/engineering/expo-operations-map.md +84 -0
- package/catalog/generated/firstparty/knowledge/engineering/expo-stack-selection.md +75 -0
- package/catalog/generated/firstparty/knowledge/engineering/external-skill-packs.md +47 -0
- package/catalog/generated/firstparty/knowledge/engineering/mobai-toolbelt.md +389 -0
- package/catalog/generated/firstparty/knowledge/engineering/recommended-agent-skills.md +109 -0
- package/catalog/generated/firstparty/knowledge/engineering/technical-documentation-ste100.md +89 -0
- package/catalog/generated/firstparty/knowledge/engineering/xcodebuildmcp-testing.md +502 -0
- package/catalog/generated/firstparty/knowledge/experience/commitment-funnel.md +90 -0
- package/catalog/generated/firstparty/knowledge/experience/consumer-product-design-agency.md +268 -0
- package/catalog/generated/firstparty/knowledge/experience/eleven-star-experience.md +194 -0
- package/catalog/generated/firstparty/knowledge/experience/emotional-design-system.md +412 -0
- package/catalog/generated/firstparty/knowledge/experience/emotional-experience-design.md +359 -0
- package/catalog/generated/firstparty/knowledge/experience/emotional-experience-measurement.md +433 -0
- package/catalog/generated/firstparty/knowledge/experience/ethics-guardrail.md +460 -0
- package/catalog/generated/firstparty/knowledge/experience/experience-cards/commitment-card.md +36 -0
- package/catalog/generated/firstparty/knowledge/experience/experience-cards/endowed-progress-card.md +34 -0
- package/catalog/generated/firstparty/knowledge/experience/experience-cards/fresh-start-card.md +34 -0
- package/catalog/generated/firstparty/knowledge/experience/experience-cards/identity-and-self-expression-card.md +35 -0
- package/catalog/generated/firstparty/knowledge/experience/experience-cards/intent-mirroring-card.md +36 -0
- package/catalog/generated/firstparty/knowledge/experience/experience-cards/mastery-and-status-card.md +43 -0
- package/catalog/generated/firstparty/knowledge/experience/experience-cards/peak-end-card.md +44 -0
- package/catalog/generated/firstparty/knowledge/experience/experience-cards/perceived-effort-delay-card.md +37 -0
- package/catalog/generated/firstparty/knowledge/experience/experience-cards/reciprocity-card.md +38 -0
- package/catalog/generated/firstparty/knowledge/experience/experience-cards/recovery-and-trust-repair-card.md +40 -0
- package/catalog/generated/firstparty/knowledge/experience/experience-cards/streak-and-loss-aversion-card.md +37 -0
- package/catalog/generated/firstparty/knowledge/experience/experience-cards/variable-reward-card.md +42 -0
- package/catalog/generated/firstparty/knowledge/experience/experience-cards.md +172 -0
- package/catalog/generated/firstparty/knowledge/experience/onboarding-conversion.md +422 -0
- package/catalog/generated/firstparty/knowledge/experience/onboarding-foundations.md +264 -0
- package/catalog/generated/firstparty/knowledge/experience/paywall-goal-headline.md +99 -0
- package/catalog/generated/firstparty/knowledge/experience/push-notification-lifecycle.md +79 -0
- package/catalog/generated/firstparty/knowledge/growth/appsflyer-mmp.md +99 -0
- package/catalog/generated/firstparty/knowledge/growth/cro-landing.md +86 -0
- package/catalog/generated/firstparty/knowledge/growth/fastlane-growth-ops.md +321 -0
- package/catalog/generated/firstparty/knowledge/growth/geo-seo.md +163 -0
- package/catalog/generated/firstparty/knowledge/growth/hdyhau-blended-roas.md +75 -0
- package/catalog/generated/firstparty/knowledge/growth/influencer-sponsorship-engine.md +224 -0
- package/catalog/generated/firstparty/knowledge/growth/ios-consumer-playbook-intake.md +65 -0
- package/catalog/generated/firstparty/knowledge/growth/launch-narrative-cadence.md +340 -0
- package/catalog/generated/firstparty/knowledge/growth/non-competitor-angle-discovery.md +80 -0
- package/catalog/generated/firstparty/knowledge/growth/paid-user-acquisition.md +283 -0
- package/catalog/generated/firstparty/knowledge/growth/ugc-creator-engine.md +259 -0
- package/catalog/generated/firstparty/knowledge/growth/viral-growth-loops.md +174 -0
- package/catalog/generated/firstparty/knowledge/money/billing-health-and-reactivation.md +54 -0
- package/catalog/generated/firstparty/knowledge/money/offer-and-pricing-decisions.md +33 -0
- package/catalog/generated/firstparty/knowledge/money/paywall-pricing-and-experiments.md +97 -0
- package/catalog/generated/firstparty/knowledge/money/revenue-monetization.md +107 -0
- package/catalog/generated/firstparty/knowledge/money/revenuecat-agent-tooling.md +174 -0
- package/catalog/generated/firstparty/knowledge/money/revenuecat-and-store-products.md +115 -0
- package/catalog/generated/firstparty/knowledge/money/stripe-and-web-billing.md +83 -0
- package/catalog/generated/firstparty/knowledge/money/subscription-price-derivation.md +105 -0
- package/catalog/generated/firstparty/knowledge/operations/autonomy-onboarding.md +269 -0
- package/catalog/generated/firstparty/knowledge/operations/doppler-organization.md +73 -0
- package/catalog/generated/firstparty/knowledge/operations/founder-zero-operator.md +184 -0
- package/catalog/generated/firstparty/knowledge/operations/frontier-agent-operations.md +189 -0
- package/catalog/generated/firstparty/knowledge/operations/paid-tool-routing.md +172 -0
- package/catalog/generated/firstparty/knowledge/operations/post-launch-operations.md +261 -0
- package/catalog/generated/firstparty/knowledge/operations/provider-state-recipes.md +80 -0
- package/catalog/generated/firstparty/knowledge/operations/resend-email-ops.md +339 -0
- package/catalog/generated/firstparty/knowledge/operations/secrets-management.md +215 -0
- package/catalog/generated/firstparty/knowledge/orchestration/compound-engineering-routing.md +101 -0
- package/catalog/generated/firstparty/knowledge/orchestration/dynamic-workflows.md +198 -0
- package/catalog/generated/firstparty/knowledge/orchestration/full-launch-program.md +179 -0
- package/catalog/generated/firstparty/knowledge/orchestration/isolated-review.md +144 -0
- package/catalog/generated/firstparty/knowledge/orchestration/parallel-agent-orchestration.md +335 -0
- package/catalog/generated/firstparty/knowledge/orchestration/project-state.md +96 -0
- package/catalog/generated/firstparty/knowledge/process/artifact-contracts.md +1527 -0
- package/catalog/generated/firstparty/knowledge/process/cascade-edges.yaml +217 -0
- package/catalog/generated/firstparty/knowledge/process/change-cascade.md +102 -0
- package/catalog/generated/firstparty/knowledge/process/current-truth.md +45 -0
- package/catalog/generated/firstparty/knowledge/process/failure-cards.md +114 -0
- package/catalog/generated/firstparty/knowledge/process/flow-traceability.md +189 -0
- package/catalog/generated/firstparty/knowledge/process/launch-coverage.md +298 -0
- package/catalog/generated/firstparty/knowledge/process/launch-phases.md +838 -0
- package/catalog/generated/firstparty/knowledge/process/learning-capture.md +77 -0
- package/catalog/generated/firstparty/knowledge/process/learnings/audit-runs-from-repo-root.md +22 -0
- package/catalog/generated/firstparty/knowledge/process/provider-contracts.md +49 -0
- package/catalog/generated/firstparty/knowledge/process/provider-proof.md +37 -0
- package/catalog/generated/firstparty/knowledge/process/repository-profiles.md +60 -0
- package/catalog/generated/firstparty/knowledge/process/tool-recipes/device-capture-and-proof.md +100 -0
- package/catalog/generated/firstparty/knowledge/process/tool-recipes/engineering-and-agent-orchestration.md +89 -0
- package/catalog/generated/firstparty/knowledge/process/tool-recipes/funnel-domain-and-privacy.md +142 -0
- package/catalog/generated/firstparty/knowledge/process/tool-recipes/growth-and-store-routing.md +192 -0
- package/catalog/generated/firstparty/knowledge/process/tool-recipes/research-intelligence.md +258 -0
- package/catalog/generated/firstparty/knowledge/process/tool-recipes/revenue-email-analytics.md +101 -0
- package/catalog/generated/firstparty/knowledge/process/tool-recipes/secrets-and-environment.md +35 -0
- package/catalog/generated/firstparty/knowledge/process/tool-recipes/visual-and-motion-production.md +457 -0
- package/catalog/generated/firstparty/knowledge/process/tool-recipes.md +67 -0
- package/catalog/generated/firstparty/knowledge/product/ai-chat-companion.md +96 -0
- package/catalog/generated/firstparty/knowledge/product/core-loop-and-complete-scope.md +82 -0
- package/catalog/generated/firstparty/knowledge/product/core-loop-and-v1-scope.md +137 -0
- package/catalog/generated/firstparty/knowledge/product/habit-tracker.md +89 -0
- package/catalog/generated/firstparty/knowledge/product/photo-ai-media.md +96 -0
- package/catalog/generated/firstparty/knowledge/product/product-moat.md +64 -0
- package/catalog/generated/firstparty/knowledge/product/social-network.md +117 -0
- package/catalog/generated/firstparty/knowledge/research/distribution-first-niche.md +70 -0
- package/catalog/generated/firstparty/knowledge/research/distribution-offer-signal.md +190 -0
- package/catalog/generated/firstparty/knowledge/research/go-pivot-or-kill.md +120 -0
- package/catalog/generated/firstparty/knowledge/research/localization-market-research.md +145 -0
- package/catalog/generated/firstparty/knowledge/research/transformation-demo.md +70 -0
- package/catalog/generated/firstparty/knowledge/store/age-rating-questionnaire.md +75 -0
- package/catalog/generated/firstparty/knowledge/store/app-review-observe.md +314 -0
- package/catalog/generated/firstparty/knowledge/store/app-review-remediate.md +125 -0
- package/catalog/generated/firstparty/knowledge/store/app-review-resubmit.md +128 -0
- package/catalog/generated/firstparty/knowledge/store/app-store-connect-cli.md +347 -0
- package/catalog/generated/firstparty/knowledge/store/app-store-listing-prep.md +277 -0
- package/catalog/generated/firstparty/knowledge/store/apple-signing-release.md +551 -0
- package/catalog/generated/firstparty/knowledge/store/aso-apple-keyword-evidence.md +112 -0
- package/catalog/generated/firstparty/knowledge/store/aso-store-ops.md +316 -0
- package/catalog/generated/firstparty/knowledge/store/google-play-release.md +200 -0
- package/catalog/generated/firstparty/knowledge/store/marketplace-regional-compliance.md +21 -0
- package/catalog/generated/firstparty/knowledge/store/screenshot-toolchain.md +130 -0
- package/catalog/generated/firstparty/knowledge/store/store-console-workflow.md +760 -0
- package/catalog/generated/firstparty/knowledge/trust/community-safety.md +18 -0
- package/catalog/generated/firstparty/knowledge/trust/generative-ai-safety.md +27 -0
- package/catalog/generated/firstparty/knowledge/trust/paid-generative-ai-controls.md +85 -0
- package/catalog/generated/firstparty/knowledge/trust/privacy-terms.md +192 -0
- package/catalog/generated/firstparty/knowledge/trust/security-release-hardening.md +169 -0
- package/catalog/generated/firstparty/knowledge/words/consumer-copy-benchmarks.md +111 -0
- package/catalog/generated/firstparty/knowledge/words/conversion-copy.md +181 -0
- package/catalog/generated/firstparty/knowledge/words/no-slop-writing.md +173 -0
- package/catalog/generated/firstparty/package.json +290 -0
- package/catalog/generated/firstparty/schemas/mobile-evidence.json +177 -0
- package/catalog/generated/firstparty/schemas/mobile-input.json +191 -0
- package/catalog/generated/firstparty/schemas/mobile-output.json +228 -0
- package/catalog/generated/firstparty/schemas/monetization-unavailable.json +4 -0
- package/catalog/generated/firstparty/schemas/worker-evidence.json +21 -0
- package/catalog/generated/firstparty/schemas/worker-input.json +29 -0
- package/catalog/generated/firstparty/schemas/worker-output.json +41 -0
- package/catalog/generated/firstparty/snapshot.json +16229 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/README.md +41 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/prompts/00-positioning-strategy.md +45 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/prompts/01-database-schema.md +44 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/prompts/02-auth-system.md +38 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/prompts/03-chat-core-loop.md +42 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/prompts/04-model-integration.md +45 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/prompts/05-memory-personalization.md +38 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/prompts/06-usage-limits-metering.md +36 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/prompts/07-stripe-monetization.md +34 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/prompts/08-safety-and-moderation.md +39 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/prompts/variants/companion-character.md +40 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/prompts/variants/voice-first.md +37 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/.env.example +18 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/.github/workflows/ci.yml +30 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/.gitignore.template +9 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/README.md +48 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/app/api/chat/route.ts +70 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/app/api/revenuecat/webhook/route.ts +21 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/app/api/stripe/checkout/route.ts +28 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/app/api/stripe/webhook/route.ts +34 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/app/auth/confirm/route.ts +22 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/app/chat/page.tsx +78 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/app/layout.tsx +20 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/app/login/page.tsx +47 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/app/page.tsx +17 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/components/analytics-provider.tsx +14 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/lib/analytics/events.ts +32 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/lib/analytics/posthog-client.ts +28 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/lib/billing/revenuecat.ts +27 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/lib/billing/stripe.ts +15 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/lib/strings.ts +32 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/lib/supabase/client.ts +7 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/lib/supabase/proxy.ts +29 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/lib/supabase/server.ts +23 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/next.config.ts +5 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/package-lock.json +1294 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/package.json +29 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/proxy.ts +12 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/supabase/migrations/0001_init.sql +78 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/supabase/tests/0001_rls.test.sql +75 -0
- package/catalog/generated/firstparty/surfaces/starters/ai-chat-companion/starter/tsconfig.json +41 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/README.md +43 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/prompts/00-positioning-strategy.md +47 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/prompts/01-database-schema.md +54 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/prompts/02-auth-system.md +42 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/prompts/03-habit-core-loop.md +50 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/prompts/04-reminders-and-streaks.md +58 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/prompts/05-stats-and-insights.md +44 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/prompts/06-paywall-and-monetization.md +50 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/prompts/07-social-accountability.md +49 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/prompts/variants/simple-counter-utility.md +43 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/prompts/variants/wellness-coach.md +44 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/.env.example +14 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/.github/workflows/ci.yml +30 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/.gitignore.template +9 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/README.md +48 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/app/api/revenuecat/webhook/route.ts +21 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/app/api/stripe/checkout/route.ts +28 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/app/api/stripe/webhook/route.ts +34 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/app/auth/confirm/route.ts +22 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/app/layout.tsx +20 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/app/login/page.tsx +47 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/app/page.tsx +17 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/app/today/page.tsx +27 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/components/analytics-provider.tsx +14 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/lib/analytics/events.ts +29 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/lib/analytics/posthog-client.ts +28 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/lib/billing/revenuecat.ts +27 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/lib/billing/stripe.ts +15 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/lib/strings.ts +27 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/lib/supabase/client.ts +7 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/lib/supabase/proxy.ts +29 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/lib/supabase/server.ts +23 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/next.config.ts +5 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/package-lock.json +1222 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/package.json +28 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/proxy.ts +12 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/supabase/migrations/0001_init.sql +84 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/supabase/tests/0001_rls.test.sql +75 -0
- package/catalog/generated/firstparty/surfaces/starters/habit-tracker/starter/tsconfig.json +41 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/README.md +40 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/prompts/00-positioning-strategy.md +51 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/prompts/01-database-schema.md +55 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/prompts/02-auth-system.md +39 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/prompts/03-capture-and-library.md +42 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/prompts/04-ai-generation-pipeline.md +46 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/prompts/05-editing-and-presets.md +40 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/prompts/06-credits-and-monetization.md +47 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/prompts/07-sharing-and-virality.md +39 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/prompts/08-content-safety-and-rights.md +49 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/prompts/variants/avatar-headshot-studio.md +43 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/prompts/variants/photo-restoration.md +39 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/.env.example +16 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/.github/workflows/ci.yml +30 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/.gitignore.template +9 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/README.md +50 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/app/api/generate/route.ts +47 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/app/api/revenuecat/webhook/route.ts +21 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/app/api/stripe/checkout/route.ts +28 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/app/api/stripe/webhook/route.ts +34 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/app/auth/confirm/route.ts +22 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/app/layout.tsx +20 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/app/library/page.tsx +29 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/app/login/page.tsx +47 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/app/page.tsx +17 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/components/analytics-provider.tsx +14 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/lib/analytics/events.ts +32 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/lib/analytics/posthog-client.ts +28 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/lib/billing/revenuecat.ts +27 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/lib/billing/stripe.ts +15 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/lib/strings.ts +27 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/lib/supabase/client.ts +7 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/lib/supabase/proxy.ts +29 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/lib/supabase/server.ts +23 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/next.config.ts +5 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/package-lock.json +1222 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/package.json +28 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/proxy.ts +12 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/supabase/migrations/0001_init.sql +74 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/supabase/tests/0001_rls.test.sql +72 -0
- package/catalog/generated/firstparty/surfaces/starters/photo-ai-media/starter/tsconfig.json +41 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/README.md +41 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/prompts/00-niche-strategy.md +44 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/prompts/01-database-schema.md +37 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/prompts/02-auth-system.md +40 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/prompts/03-feed-and-posts.md +43 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/prompts/04-profiles-and-follow.md +41 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/prompts/05-search-and-discovery.md +36 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/prompts/06-direct-messages.md +32 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/prompts/07-stripe-monetization.md +41 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/prompts/08-invite-system.md +37 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/prompts/variants/image-first-instagram.md +34 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/prompts/variants/video-first-tiktok.md +40 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/.env.example +14 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/.github/workflows/ci.yml +30 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/.gitignore.template +9 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/README.md +47 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/app/api/revenuecat/webhook/route.ts +21 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/app/api/stripe/checkout/route.ts +28 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/app/api/stripe/webhook/route.ts +34 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/app/auth/confirm/route.ts +22 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/app/feed/page.tsx +30 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/app/layout.tsx +20 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/app/login/page.tsx +47 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/app/page.tsx +17 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/components/analytics-provider.tsx +14 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/lib/analytics/events.ts +31 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/lib/analytics/posthog-client.ts +28 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/lib/billing/revenuecat.ts +27 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/lib/billing/stripe.ts +15 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/lib/strings.ts +27 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/lib/supabase/client.ts +7 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/lib/supabase/proxy.ts +29 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/lib/supabase/server.ts +23 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/next.config.ts +5 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/package-lock.json +1222 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/package.json +28 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/proxy.ts +12 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/supabase/migrations/0001_init.sql +81 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/supabase/tests/0001_rls.test.sql +70 -0
- package/catalog/generated/firstparty/surfaces/starters/social-network/starter/tsconfig.json +41 -0
- package/catalog/generated/firstparty/surfaces/ui-library/components/feedback.empty-state.md +22 -0
- package/catalog/generated/firstparty/surfaces/ui-library/components/feedback.haptics.md +21 -0
- package/catalog/generated/firstparty/surfaces/ui-library/components/feedback.skeleton.md +21 -0
- package/catalog/generated/firstparty/surfaces/ui-library/components/input.keyboard-behavior.md +22 -0
- package/catalog/generated/firstparty/surfaces/ui-library/components/interaction.press-feedback.md +22 -0
- package/catalog/generated/firstparty/tooling/catalog-scaffold.ts +181 -0
- package/catalog/generated/firstparty/tooling/render-artifact-pages.ts +93 -0
- package/catalog/generated/firstparty/tooling/render-credits.ts +301 -0
- package/catalog/generated/firstparty/tooling/render-design-room.ts +518 -0
- package/catalog/generated/firstparty/tooling/render-hosted-bundle.ts +201 -0
- package/catalog/generated/firstparty/tooling/render-product.ts +103 -0
- package/catalog/generated/firstparty/tooling/render-public-api.ts +91 -0
- package/catalog/generated/firstparty/tooling/render-task-skills.ts +69 -0
- package/catalog/generated/firstparty-pin.json +4 -0
- package/catalog/generated/hosted-knowledge.json +1 -0
- package/catalog/generated/knowledge-freshness.json +5 -0
- package/catalog/generated/packs.json +50 -0
- package/catalog/generated/repository-profiles.md +15 -0
- package/catalog/generated/routing.md +256 -0
- package/catalog/generated/spine.md +58 -0
- package/catalog/ids.ts +27 -0
- package/catalog/index.ts +40 -0
- package/catalog/knowledge/data/data-analytics-attribution.yaml +177 -0
- package/catalog/knowledge/data/data-posthog-agent-tooling.yaml +70 -0
- package/catalog/knowledge/design/design-audience-derived-identity.yaml +119 -0
- package/catalog/knowledge/design/design-consumer-craft-benchmarks.yaml +129 -0
- package/catalog/knowledge/design/design-design-acceptance.yaml +21 -0
- package/catalog/knowledge/design/design-design-evidence-stack.yaml +86 -0
- package/catalog/knowledge/design/design-design-room.yaml +18 -0
- package/catalog/knowledge/design/design-design-visual-system.yaml +215 -0
- package/catalog/knowledge/design/design-design-worthiness.yaml +40 -0
- package/catalog/knowledge/design/design-editorial-scrollytelling.yaml +56 -0
- package/catalog/knowledge/design/design-landing-motion-craft.yaml +34 -0
- package/catalog/knowledge/design/design-mobile-flow-craft.yaml +93 -0
- package/catalog/knowledge/design/design-motion-craft-benchmarks.yaml +84 -0
- package/catalog/knowledge/design/design-premium-mobile-craft.yaml +51 -0
- package/catalog/knowledge/design/design-quality-lens.yaml +29 -0
- package/catalog/knowledge/design/design-refero-ux-patterns.yaml +69 -0
- package/catalog/knowledge/design/design-remotion-content-assets.yaml +81 -0
- package/catalog/knowledge/design/design-surfaces-b2c.yaml +56 -0
- package/catalog/knowledge/design/design-vibecoded-tells.yaml +39 -0
- package/catalog/knowledge/engineering/engineering-accessibility-readiness.yaml +28 -0
- package/catalog/knowledge/engineering/engineering-app-agent-roster.yaml +14 -0
- package/catalog/knowledge/engineering/engineering-app-quality.yaml +20 -0
- package/catalog/knowledge/engineering/engineering-backend-data-contract.yaml +15 -0
- package/catalog/knowledge/engineering/engineering-engineering-orchestration.yaml +79 -0
- package/catalog/knowledge/engineering/engineering-expo-compatibility.yaml +44 -0
- package/catalog/knowledge/engineering/engineering-expo-operations-map.yaml +61 -0
- package/catalog/knowledge/engineering/engineering-expo-stack-selection.yaml +46 -0
- package/catalog/knowledge/engineering/engineering-external-skill-packs.yaml +112 -0
- package/catalog/knowledge/engineering/engineering-mobai-toolbelt.yaml +134 -0
- package/catalog/knowledge/engineering/engineering-recommended-agent-skills.yaml +66 -0
- package/catalog/knowledge/engineering/engineering-technical-documentation-ste100.yaml +16 -0
- package/catalog/knowledge/engineering/engineering-xcodebuildmcp-testing.yaml +344 -0
- package/catalog/knowledge/experience/experience-cards-commitment-card.yaml +14 -0
- package/catalog/knowledge/experience/experience-cards-endowed-progress-card.yaml +14 -0
- package/catalog/knowledge/experience/experience-cards-fresh-start-card.yaml +14 -0
- package/catalog/knowledge/experience/experience-cards-identity-and-self-expression-card.yaml +14 -0
- package/catalog/knowledge/experience/experience-cards-intent-mirroring-card.yaml +13 -0
- package/catalog/knowledge/experience/experience-cards-mastery-and-status-card.yaml +14 -0
- package/catalog/knowledge/experience/experience-cards-peak-end-card.yaml +14 -0
- package/catalog/knowledge/experience/experience-cards-perceived-effort-delay-card.yaml +13 -0
- package/catalog/knowledge/experience/experience-cards-reciprocity-card.yaml +13 -0
- package/catalog/knowledge/experience/experience-cards-recovery-and-trust-repair-card.yaml +13 -0
- package/catalog/knowledge/experience/experience-cards-streak-and-loss-aversion-card.yaml +14 -0
- package/catalog/knowledge/experience/experience-cards-variable-reward-card.yaml +14 -0
- package/catalog/knowledge/experience/experience-cards.yaml +26 -0
- package/catalog/knowledge/experience/experience-commitment-funnel.yaml +22 -0
- package/catalog/knowledge/experience/experience-consumer-product-design-agency.yaml +14 -0
- package/catalog/knowledge/experience/experience-eleven-star-experience.yaml +26 -0
- package/catalog/knowledge/experience/experience-emotional-design-system.yaml +27 -0
- package/catalog/knowledge/experience/experience-emotional-experience-design.yaml +15 -0
- package/catalog/knowledge/experience/experience-emotional-experience-measurement.yaml +15 -0
- package/catalog/knowledge/experience/experience-ethics-guardrail.yaml +20 -0
- package/catalog/knowledge/experience/experience-onboarding-conversion.yaml +87 -0
- package/catalog/knowledge/experience/experience-onboarding-foundations.yaml +32 -0
- package/catalog/knowledge/experience/experience-paywall-goal-headline.yaml +40 -0
- package/catalog/knowledge/experience/experience-push-notification-lifecycle.yaml +14 -0
- package/catalog/knowledge/growth/growth-appsflyer-mmp.yaml +33 -0
- package/catalog/knowledge/growth/growth-cro-landing.yaml +38 -0
- package/catalog/knowledge/growth/growth-fastlane-growth-ops.yaml +37 -0
- package/catalog/knowledge/growth/growth-geo-seo.yaml +26 -0
- package/catalog/knowledge/growth/growth-hdyhau-blended-roas.yaml +18 -0
- package/catalog/knowledge/growth/growth-influencer-sponsorship-engine.yaml +15 -0
- package/catalog/knowledge/growth/growth-ios-consumer-playbook-intake.yaml +19 -0
- package/catalog/knowledge/growth/growth-launch-narrative-cadence.yaml +77 -0
- package/catalog/knowledge/growth/growth-non-competitor-angle-discovery.yaml +18 -0
- package/catalog/knowledge/growth/growth-paid-user-acquisition.yaml +25 -0
- package/catalog/knowledge/growth/growth-ugc-creator-engine.yaml +17 -0
- package/catalog/knowledge/growth/growth-viral-growth-loops.yaml +17 -0
- package/catalog/knowledge/money/money-billing-health-and-reactivation.yaml +16 -0
- package/catalog/knowledge/money/money-offer-and-pricing-decisions.yaml +15 -0
- package/catalog/knowledge/money/money-paywall-pricing-and-experiments.yaml +27 -0
- package/catalog/knowledge/money/money-revenue-monetization.yaml +148 -0
- package/catalog/knowledge/money/money-revenuecat-agent-tooling.yaml +108 -0
- package/catalog/knowledge/money/money-revenuecat-and-store-products.yaml +16 -0
- package/catalog/knowledge/money/money-stripe-and-web-billing.yaml +15 -0
- package/catalog/knowledge/money/money-subscription-price-derivation.yaml +41 -0
- package/catalog/knowledge/operations/operations-autonomy-onboarding.yaml +16 -0
- package/catalog/knowledge/operations/operations-doppler-organization.yaml +16 -0
- package/catalog/knowledge/operations/operations-founder-zero-operator.yaml +64 -0
- package/catalog/knowledge/operations/operations-frontier-agent-operations.yaml +15 -0
- package/catalog/knowledge/operations/operations-paid-tool-routing.yaml +29 -0
- package/catalog/knowledge/operations/operations-post-launch-operations.yaml +19 -0
- package/catalog/knowledge/operations/operations-provider-state-recipes.yaml +15 -0
- package/catalog/knowledge/operations/operations-resend-email-ops.yaml +205 -0
- package/catalog/knowledge/operations/operations-secrets-management.yaml +70 -0
- package/catalog/knowledge/orchestration/orchestration-compound-engineering-routing.yaml +30 -0
- package/catalog/knowledge/orchestration/orchestration-dynamic-workflows.yaml +89 -0
- package/catalog/knowledge/orchestration/orchestration-full-launch-program.yaml +24 -0
- package/catalog/knowledge/orchestration/orchestration-isolated-review.yaml +54 -0
- package/catalog/knowledge/orchestration/orchestration-parallel-agent-orchestration.yaml +145 -0
- package/catalog/knowledge/orchestration/orchestration-project-state.yaml +25 -0
- package/catalog/knowledge/process/learning-audit-runs-from-repo-root.yaml +16 -0
- package/catalog/knowledge/process/process-artifact-contracts.yaml +33 -0
- package/catalog/knowledge/process/process-cascade-edges.yaml +15 -0
- package/catalog/knowledge/process/process-change-cascade.yaml +17 -0
- package/catalog/knowledge/process/process-current-truth.yaml +15 -0
- package/catalog/knowledge/process/process-failure-cards.yaml +34 -0
- package/catalog/knowledge/process/process-flow-traceability.yaml +18 -0
- package/catalog/knowledge/process/process-launch-coverage.yaml +18 -0
- package/catalog/knowledge/process/process-launch-phases.yaml +21 -0
- package/catalog/knowledge/process/process-learning-capture.yaml +34 -0
- package/catalog/knowledge/process/process-provider-contracts.yaml +16 -0
- package/catalog/knowledge/process/process-provider-proof.yaml +18 -0
- package/catalog/knowledge/process/process-repository-profiles.yaml +15 -0
- package/catalog/knowledge/process/process-tool-recipes-device-capture-and-proof.yaml +155 -0
- package/catalog/knowledge/process/process-tool-recipes-engineering-and-agent-orchestration.yaml +32 -0
- package/catalog/knowledge/process/process-tool-recipes-funnel-domain-and-privacy.yaml +23 -0
- package/catalog/knowledge/process/process-tool-recipes-growth-and-store-routing.yaml +57 -0
- package/catalog/knowledge/process/process-tool-recipes-research-intelligence.yaml +52 -0
- package/catalog/knowledge/process/process-tool-recipes-revenue-email-analytics.yaml +14 -0
- package/catalog/knowledge/process/process-tool-recipes-secrets-and-environment.yaml +30 -0
- package/catalog/knowledge/process/process-tool-recipes-visual-and-motion-production.yaml +15 -0
- package/catalog/knowledge/process/process-tool-recipes.yaml +16 -0
- package/catalog/knowledge/product/product-ai-chat-companion.yaml +22 -0
- package/catalog/knowledge/product/product-core-loop-and-complete-scope.yaml +18 -0
- package/catalog/knowledge/product/product-habit-tracker.yaml +14 -0
- package/catalog/knowledge/product/product-photo-ai-media.yaml +14 -0
- package/catalog/knowledge/product/product-product-moat.yaml +15 -0
- package/catalog/knowledge/product/product-social-network.yaml +14 -0
- package/catalog/knowledge/research/research-distribution-first-niche.yaml +20 -0
- package/catalog/knowledge/research/research-distribution-offer-signal.yaml +31 -0
- package/catalog/knowledge/research/research-go-pivot-or-kill.yaml +16 -0
- package/catalog/knowledge/research/research-localization-market-research.yaml +18 -0
- package/catalog/knowledge/research/research-transformation-demo.yaml +17 -0
- package/catalog/knowledge/store/store-age-rating-questionnaire.yaml +44 -0
- package/catalog/knowledge/store/store-app-review-observe.yaml +87 -0
- package/catalog/knowledge/store/store-app-review-remediate.yaml +59 -0
- package/catalog/knowledge/store/store-app-review-resubmit.yaml +42 -0
- package/catalog/knowledge/store/store-app-store-connect-cli.yaml +90 -0
- package/catalog/knowledge/store/store-app-store-listing-prep.yaml +309 -0
- package/catalog/knowledge/store/store-apple-signing-release.yaml +234 -0
- package/catalog/knowledge/store/store-aso-apple-keyword-evidence.yaml +44 -0
- package/catalog/knowledge/store/store-aso-store-ops.yaml +24 -0
- package/catalog/knowledge/store/store-google-play-release.yaml +45 -0
- package/catalog/knowledge/store/store-marketplace-regional-compliance.yaml +20 -0
- package/catalog/knowledge/store/store-screenshot-toolchain.yaml +100 -0
- package/catalog/knowledge/store/store-store-console-workflow.yaml +431 -0
- package/catalog/knowledge/trust/trust-community-safety.yaml +28 -0
- package/catalog/knowledge/trust/trust-generative-ai-safety.yaml +29 -0
- package/catalog/knowledge/trust/trust-paid-generative-ai-controls.yaml +34 -0
- package/catalog/knowledge/trust/trust-privacy-terms.yaml +26 -0
- package/catalog/knowledge/trust/trust-security-release-hardening.yaml +43 -0
- package/catalog/knowledge/words/words-consumer-copy-benchmarks.yaml +169 -0
- package/catalog/knowledge/words/words-conversion-copy.yaml +95 -0
- package/catalog/knowledge/words/words-no-slop-writing.yaml +35 -0
- package/catalog/knowledge-packages.ts +210 -0
- package/catalog/knowledge-validation.ts +168 -0
- package/catalog/lane-graph.ts +37 -0
- package/catalog/lanes.ts +61 -0
- package/catalog/ontology/design-surface-applicability.ts +447 -0
- package/catalog/ontology/instance-load.ts +96 -0
- package/catalog/ontology/instance-types.ts +66 -0
- package/catalog/ontology/instance-validate.ts +104 -0
- package/catalog/ontology/instance.schema.json +171 -0
- package/catalog/ontology/load.ts +191 -0
- package/catalog/ontology/onboarding-applicability.ts +191 -0
- package/catalog/ontology/product-workspace.ts +58 -0
- package/catalog/ontology/query.ts +64 -0
- package/catalog/ontology/render-product.ts +30 -0
- package/catalog/ontology/types.ts +116 -0
- package/catalog/ontology/validate.ts +205 -0
- package/catalog/ontology/world.schema.json +191 -0
- package/catalog/ontology/world.yaml +458 -0
- package/catalog/operators.ts +276 -0
- package/catalog/overlays.ts +28 -0
- package/catalog/packs/compose.ts +424 -0
- package/catalog/packs/consumer-app/acquisition.md +4 -0
- package/catalog/packs/consumer-app/activation.md +4 -0
- package/catalog/packs/consumer-app/pack.yaml +66 -0
- package/catalog/packs/consumer-app/referral.md +4 -0
- package/catalog/packs/consumer-app/retention.md +4 -0
- package/catalog/packs/consumer-app/revenue.md +4 -0
- package/catalog/packs/firstparty-assets.ts +62 -0
- package/catalog/packs/firstparty-notices.ts +61 -0
- package/catalog/packs/firstparty.ts +146 -0
- package/catalog/packs/food-product-contrast/conversion.md +4 -0
- package/catalog/packs/food-product-contrast/manufacturing.md +4 -0
- package/catalog/packs/food-product-contrast/pack.yaml +108 -0
- package/catalog/packs/food-product-contrast/promise.md +4 -0
- package/catalog/packs/food-product-contrast/regulatory.md +4 -0
- package/catalog/packs/food-product-contrast/retailer.md +4 -0
- package/catalog/packs/food-product-contrast/sku.md +4 -0
- package/catalog/packs/installed-firstparty.ts +17 -0
- package/catalog/packs/isolation.ts +99 -0
- package/catalog/packs/load.ts +547 -0
- package/catalog/packs/paid-generative-ai/pack.yaml +73 -0
- package/catalog/packs/snapshots.ts +115 -0
- package/catalog/packs/types.ts +71 -0
- package/catalog/packs/web-presence/pack.yaml +54 -0
- package/catalog/phases.ts +139 -0
- package/catalog/principles/guards.ts +113 -0
- package/catalog/principles/load.ts +202 -0
- package/catalog/principles/principles.yaml +796 -0
- package/catalog/principles/types.ts +87 -0
- package/catalog/principles/vocabulary.yaml +68 -0
- package/catalog/profiles.ts +47 -0
- package/catalog/providers/agent-runtime-claude.yaml +17 -0
- package/catalog/providers/apple-asc-canonical-map.ts +499 -0
- package/catalog/providers/apple-asc.yaml +30 -0
- package/catalog/providers/capability-delta.yaml +41 -0
- package/catalog/providers/conformance.ts +64 -0
- package/catalog/providers/greenfield-70-applicability-closeout-map.ts +243 -0
- package/catalog/providers/greenfield-71-handoff-closeout-map.ts +376 -0
- package/catalog/providers/greenfield-72-benchmark-closeout-map.ts +502 -0
- package/catalog/providers/greenfield-73-overhead-closeout-map.ts +318 -0
- package/catalog/providers/greenfield-75-retrieval-closeout-map.ts +328 -0
- package/catalog/providers/greenfield-76-change-impact-closeout-map.ts +336 -0
- package/catalog/providers/greenfield-delivery-audit-map.ts +382 -0
- package/catalog/providers/growth-agent-canonical-map.ts +669 -0
- package/catalog/providers/mobile-ops-canonical-map.ts +581 -0
- package/catalog/providers/revenuecat.yaml +25 -0
- package/catalog/providers/semantic-batch-map.ts +70 -0
- package/catalog/providers/semantic-eval-baselines-map.ts +897 -0
- package/catalog/providers/semantic-graph-views-map.ts +74 -0
- package/catalog/providers/semantic-plan-lower-map.ts +62 -0
- package/catalog/providers/semantic-source-projection-map.ts +96 -0
- package/catalog/providers/superwall-canonical-map.ts +379 -0
- package/catalog/providers/typesafe-qualify-map.ts +250 -0
- package/catalog/recipes/default-monetization.ts +9 -0
- package/catalog/render-routing.ts +410 -0
- package/catalog/repository-profiles/compile.ts +435 -0
- package/catalog/repository-profiles/index.ts +19 -0
- package/catalog/repository-profiles/paid-generation-applicability.ts +106 -0
- package/catalog/repository-profiles/registry.ts +83 -0
- package/catalog/repository-profiles/types.ts +98 -0
- package/catalog/repository-profiles/workspace.ts +127 -0
- package/catalog/roles.ts +435 -0
- package/catalog/stacks/expo-agent-privacy.ts +140 -0
- package/catalog/stacks/expo-agent-tools.ts +337 -0
- package/catalog/stacks/expo-capability-matrix.ts +260 -0
- package/catalog/stacks/expo-capability-protocol.ts +775 -0
- package/catalog/stacks/expo-custom-module.ts +465 -0
- package/catalog/stacks/expo-eas-commands.ts +779 -0
- package/catalog/stacks/expo-eas-hosting.ts +224 -0
- package/catalog/stacks/expo-eas-operation-matrix.ts +243 -0
- package/catalog/stacks/expo-local-boot.ts +354 -0
- package/catalog/stacks/expo-local-capabilities.ts +328 -0
- package/catalog/stacks/expo-native-ownership.ts +469 -0
- package/catalog/stacks/expo-observability.ts +142 -0
- package/catalog/stacks/expo-proof-collection.ts +286 -0
- package/catalog/stacks/expo-quality-evidence.ts +212 -0
- package/catalog/stacks/expo-revenuecat-wiring.ts +168 -0
- package/catalog/stacks/expo-router-contract.ts +399 -0
- package/catalog/stacks/expo-sdk-upgrade.ts +186 -0
- package/catalog/stacks/expo-selection.ts +736 -0
- package/catalog/stacks/expo-starter-fixture/README.md +13 -0
- package/catalog/stacks/expo-starter-fixture/app/(tabs)/_layout.tsx +11 -0
- package/catalog/stacks/expo-starter-fixture/app/(tabs)/index.tsx +1 -0
- package/catalog/stacks/expo-starter-fixture/app/(tabs)/settings.tsx +1 -0
- package/catalog/stacks/expo-starter-fixture/app/+not-found.tsx +1 -0
- package/catalog/stacks/expo-starter-fixture/app/README.md +1 -0
- package/catalog/stacks/expo-starter-fixture/app/_layout.tsx +16 -0
- package/catalog/stacks/expo-starter-fixture/app/detail/[id].tsx +7 -0
- package/catalog/stacks/expo-starter-fixture/app/modal.tsx +1 -0
- package/catalog/stacks/expo-starter-fixture/app/sign-in.tsx +1 -0
- package/catalog/stacks/expo-starter-fixture/app.json +26 -0
- package/catalog/stacks/expo-starter-fixture/babel.config.js +4 -0
- package/catalog/stacks/expo-starter-fixture/gitignore.template +14 -0
- package/catalog/stacks/expo-starter-fixture/metro.config.js +3 -0
- package/catalog/stacks/expo-starter-fixture/modules/b2c-native-capability/NOTICE +1 -0
- package/catalog/stacks/expo-starter-fixture/modules/b2c-native-capability/README.md +1 -0
- package/catalog/stacks/expo-starter-fixture/modules/b2c-native-capability/android/build.gradle +15 -0
- package/catalog/stacks/expo-starter-fixture/modules/b2c-native-capability/android/src/main/AndroidManifest.xml +1 -0
- package/catalog/stacks/expo-starter-fixture/modules/b2c-native-capability/android/src/main/java/app/example/b2cnativecapability/B2cNativeCapabilityModule.kt +19 -0
- package/catalog/stacks/expo-starter-fixture/modules/b2c-native-capability/expo-module.config.json +9 -0
- package/catalog/stacks/expo-starter-fixture/modules/b2c-native-capability/ios/B2cNativeCapability.podspec +22 -0
- package/catalog/stacks/expo-starter-fixture/modules/b2c-native-capability/ios/B2cNativeCapabilityModule.swift +16 -0
- package/catalog/stacks/expo-starter-fixture/modules/b2c-native-capability/package.json +15 -0
- package/catalog/stacks/expo-starter-fixture/modules/b2c-native-capability/src/capability.ts +48 -0
- package/catalog/stacks/expo-starter-fixture/modules/b2c-native-capability/src/index.ts +3 -0
- package/catalog/stacks/expo-starter-fixture/modules/b2c-native-capability/src/index.web.ts +9 -0
- package/catalog/stacks/expo-starter-fixture/modules/b2c-native-capability/src/invoke.ts +13 -0
- package/catalog/stacks/expo-starter-fixture/package.json +38 -0
- package/catalog/stacks/expo-starter-fixture/src/capabilities/reducers.ts +146 -0
- package/catalog/stacks/expo-starter-fixture/src/native/capability-status.tsx +37 -0
- package/catalog/stacks/expo-starter-fixture/src/native/capability-status.web.tsx +13 -0
- package/catalog/stacks/expo-starter-fixture/src/navigation/deep-link.ts +12 -0
- package/catalog/stacks/expo-starter-fixture/src/navigation/journeys.ts +115 -0
- package/catalog/stacks/expo-starter-fixture/src/navigation/route-graph.ts +45 -0
- package/catalog/stacks/expo-starter-fixture/src/notifications/handoff.ts +13 -0
- package/catalog/stacks/expo-starter-fixture/src/offline/local-cache.ts +72 -0
- package/catalog/stacks/expo-starter-fixture/src/permissions/safe-state.ts +11 -0
- package/catalog/stacks/expo-starter-fixture/src/persistence/seam.ts +28 -0
- package/catalog/stacks/expo-starter-fixture/src/screens/detail.tsx +20 -0
- package/catalog/stacks/expo-starter-fixture/src/screens/home.tsx +84 -0
- package/catalog/stacks/expo-starter-fixture/src/screens/modal.tsx +18 -0
- package/catalog/stacks/expo-starter-fixture/src/screens/not-found.tsx +18 -0
- package/catalog/stacks/expo-starter-fixture/src/screens/settings.tsx +40 -0
- package/catalog/stacks/expo-starter-fixture/src/screens/sign-in.tsx +34 -0
- package/catalog/stacks/expo-starter-fixture/src/session/local-session.ts +22 -0
- package/catalog/stacks/expo-starter-fixture/src/states/surface-state.ts +16 -0
- package/catalog/stacks/expo-starter-fixture/src/ui/contract-binding.ts +9 -0
- package/catalog/stacks/expo-starter-fixture/src/ui/empty-state.tsx +22 -0
- package/catalog/stacks/expo-starter-fixture/src/ui/haptics.tsx +33 -0
- package/catalog/stacks/expo-starter-fixture/src/ui/keyboard-behavior.tsx +18 -0
- package/catalog/stacks/expo-starter-fixture/src/ui/press-feedback.tsx +37 -0
- package/catalog/stacks/expo-starter-fixture/src/ui/skeleton.tsx +53 -0
- package/catalog/stacks/expo-starter-fixture/src/ui/tokens.ts +5 -0
- package/catalog/stacks/expo-starter-fixture/tsconfig.json +8 -0
- package/catalog/stacks/expo-starter.ts +400 -0
- package/catalog/stacks/expo-web-api-routes.ts +237 -0
- package/catalog/stacks/expo-web-static.ts +560 -0
- package/catalog/stacks/expo-web-surface-table.ts +228 -0
- package/catalog/task-skills.ts +369 -0
- package/catalog/taxonomy/concept-scheme.schema.json +92 -0
- package/catalog/taxonomy/concept-scheme.yaml +978 -0
- package/catalog/taxonomy/load.ts +115 -0
- package/catalog/taxonomy/types.ts +79 -0
- package/catalog/taxonomy/validate.ts +234 -0
- package/catalog/types.ts +452 -0
- package/catalog/upstreams/README.md +23 -0
- package/catalog/upstreams/amir-brand-system.yaml +78 -0
- package/catalog/upstreams/amir-cinematic-scroll.yaml +84 -0
- package/catalog/upstreams/appllama-skills.yaml +129 -0
- package/catalog/upstreams/eronred-aso-skills.yaml +107 -0
- package/catalog/upstreams/evanbacon-serve-sim.yaml +102 -0
- package/catalog/upstreams/last30days-skill.yaml +128 -0
- package/catalog/upstreams/layers-growth-mcp.yaml +128 -0
- package/catalog/upstreams/notices/amir-brand-system.txt +395 -0
- package/catalog/upstreams/notices/amir-cinematic-scroll.txt +21 -0
- package/catalog/upstreams/notices/appllama-skills.txt +21 -0
- package/catalog/upstreams/notices/eronred-aso-skills.txt +21 -0
- package/catalog/upstreams/notices/evanbacon-serve-sim.txt +202 -0
- package/catalog/upstreams/notices/last30days-skill.txt +21 -0
- package/catalog/upstreams/notices/layers-growth-mcp.txt +21 -0
- package/catalog/upstreams/notices/parth-app-store-screenshots.txt +21 -0
- package/catalog/upstreams/notices/posthog-wizard.txt +21 -0
- package/catalog/upstreams/notices/revenuecat-ai-toolkit.txt +21 -0
- package/catalog/upstreams/notices/revenuecat-cli.txt +21 -0
- package/catalog/upstreams/notices/rork-app-store-connect-cli-skills.txt +21 -0
- package/catalog/upstreams/notices/rork-app-store-connect-cli.txt +21 -0
- package/catalog/upstreams/notices/sentry-snapshotpreviews.txt +22 -0
- package/catalog/upstreams/notices/sentry-xcodebuildmcp.txt +21 -0
- package/catalog/upstreams/notices/typesafe-ai.txt +21 -0
- package/catalog/upstreams/observations/eronred-aso-skills.json +20 -0
- package/catalog/upstreams/observations/evanbacon-serve-sim.json +20 -0
- package/catalog/upstreams/observations/parth-app-store-screenshots.json +20 -0
- package/catalog/upstreams/observations/posthog-context-mill.json +28 -0
- package/catalog/upstreams/observations/posthog-wizard.json +27 -0
- package/catalog/upstreams/observations/revenuecat-ai-toolkit.json +27 -0
- package/catalog/upstreams/observations/revenuecat-cli.json +27 -0
- package/catalog/upstreams/observations/rork-app-store-connect-cli.json +78 -0
- package/catalog/upstreams/observations/sentry-snapshotpreviews.json +23 -0
- package/catalog/upstreams/observations/sentry-xcodebuildmcp.json +23 -0
- package/catalog/upstreams/observations/typesafe-ai.json +30 -0
- package/catalog/upstreams/parth-app-store-screenshots.yaml +105 -0
- package/catalog/upstreams/posthog-context-mill.yaml +62 -0
- package/catalog/upstreams/posthog-wizard.yaml +74 -0
- package/catalog/upstreams/revenuecat-ai-toolkit.yaml +98 -0
- package/catalog/upstreams/revenuecat-cli.yaml +166 -0
- package/catalog/upstreams/rork-app-store-connect-cli-skills.yaml +100 -0
- package/catalog/upstreams/rork-app-store-connect-cli.yaml +211 -0
- package/catalog/upstreams/sentry-snapshotpreviews.yaml +103 -0
- package/catalog/upstreams/sentry-xcodebuildmcp.yaml +101 -0
- package/catalog/upstreams/typesafe-ai.yaml +144 -0
- package/catalog/validate.ts +898 -0
- package/catalog/workflows/build-release.ts +735 -0
- package/catalog/workflows/growth-revenue.ts +338 -0
- package/catalog/workflows/helpers.ts +103 -0
- package/catalog/workflows/index.ts +9 -0
- package/catalog/workflows/maintenance.ts +283 -0
- package/catalog/workflows/operating-system.ts +261 -0
- package/catalog/workflows/operations-trust.ts +425 -0
- package/catalog/workflows/product-experience.ts +1263 -0
- package/checks/validation/README.md +6 -0
- package/checks/validation/business/data/check-analytics-catalog.ts +166 -0
- package/checks/validation/business/data/check-attribution-contract.ts +731 -0
- package/checks/validation/business/design/check-audience-identity.ts +260 -0
- package/checks/validation/business/design/check-browser-runtime-proof.ts +269 -0
- package/checks/validation/business/design/check-component-contracts.ts +365 -0
- package/checks/validation/business/design/check-content-assets.ts +600 -0
- package/checks/validation/business/design/check-design-acceptance.ts +6 -0
- package/checks/validation/business/design/check-design-md.ts +19 -0
- package/checks/validation/business/design/check-design-room-contract.ts +200 -0
- package/checks/validation/business/design/check-design-worthiness.ts +710 -0
- package/checks/validation/business/design/check-motion-contract.ts +1374 -0
- package/checks/validation/business/design/check-scrollytelling-contract.ts +1486 -0
- package/checks/validation/business/design/check-token-promotion.ts +75 -0
- package/checks/validation/business/design/check-vibecoded-tells.ts +396 -0
- package/checks/validation/business/design/color-contrast.ts +45 -0
- package/checks/validation/business/design/design-acceptance.ts +1861 -0
- package/checks/validation/business/design/lib/legal-navigation.ts +1766 -0
- package/checks/validation/business/design/lib/vibecode-tells.ts +112 -0
- package/checks/validation/business/design/lib/worthiness-mechanical.ts +196 -0
- package/checks/validation/business/design/runtime-reviewer-inputs.ts +59 -0
- package/checks/validation/business/design/surface-page-gates.ts +191 -0
- package/checks/validation/business/design/validate-state.ts +15 -0
- package/checks/validation/business/engineering/check-archetype-starter.ts +457 -0
- package/checks/validation/business/engineering/check-backend-data-contract.ts +151 -0
- package/checks/validation/business/engineering/check-compound-engineering-routing.ts +153 -0
- package/checks/validation/business/engineering/check-mobai-proof.ts +486 -0
- package/checks/validation/business/engineering/check-native-android-proof.ts +486 -0
- package/checks/validation/business/engineering/check-native-ios-proof.ts +465 -0
- package/checks/validation/business/engineering/check-readiness-coverage.ts +242 -0
- package/checks/validation/business/engineering/check-roster-headless-safety.ts +70 -0
- package/checks/validation/business/engineering/check-roster-overlap.ts +159 -0
- package/checks/validation/business/engineering/check-source-checkpoint.ts +123 -0
- package/checks/validation/business/engineering/check-technical-docs-ste100.ts +319 -0
- package/checks/validation/business/engineering/check-template-safety.ts +75 -0
- package/checks/validation/business/engineering/native-ios-retained-proof.ts +128 -0
- package/checks/validation/business/engineering/strict-ios-receipt.ts +387 -0
- package/checks/validation/business/experience/check-emotional-design.ts +1246 -0
- package/checks/validation/business/experience/check-onboarding-cutover-repository.ts +157 -0
- package/checks/validation/business/experience/check-onboarding-evidence-packet.ts +263 -0
- package/checks/validation/business/experience/check-onboarding-foundations.ts +16 -0
- package/checks/validation/business/experience/check-onboarding-graph.ts +795 -0
- package/checks/validation/business/experience/onboarding-foundations.ts +372 -0
- package/checks/validation/business/growth/check-landing-funnel.ts +593 -0
- package/checks/validation/business/growth/check-paid-user-acquisition.ts +601 -0
- package/checks/validation/business/money/check-price-derivation.ts +127 -0
- package/checks/validation/business/money/check-revenue.ts +72 -0
- package/checks/validation/business/money/price-evidence.ts +37 -0
- package/checks/validation/business/operations/check-agent-operations.ts +709 -0
- package/checks/validation/business/operations/check-email.ts +356 -0
- package/checks/validation/business/operations/check-founder-operator-bootstrap.ts +759 -0
- package/checks/validation/business/operations/check-metric-contracts.ts +114 -0
- package/checks/validation/business/operations/check-paid-tool-intake.ts +71 -0
- package/checks/validation/business/operations/check-portfolio-registry.ts +99 -0
- package/checks/validation/business/operations/check-post-launch-ops.ts +834 -0
- package/checks/validation/business/orchestration/check-continuity-contract.ts +266 -0
- package/checks/validation/business/orchestration/check-parallel-orchestration.ts +218 -0
- package/checks/validation/business/orchestration/validate-project-state.ts +357 -0
- package/checks/validation/business/process/check-artifact-templates.ts +103 -0
- package/checks/validation/business/process/check-change-cascade.ts +318 -0
- package/checks/validation/business/process/check-generated-pages.ts +153 -0
- package/checks/validation/business/process/check-lane-coverage.ts +377 -0
- package/checks/validation/business/process/check-live-provider-proof.ts +284 -0
- package/checks/validation/business/process/check-repository-profile.ts +43 -0
- package/checks/validation/business/product/check-app-archetype.ts +266 -0
- package/checks/validation/business/product/check-product-md.ts +67 -0
- package/checks/validation/business/research/check-evidence-schema-drift.ts +50 -0
- package/checks/validation/business/research/check-localization-research.ts +144 -0
- package/checks/validation/business/research/check-research-evidence.ts +1324 -0
- package/checks/validation/business/research/offer-evidence.ts +360 -0
- package/checks/validation/business/research/render-evidence-markdown.ts +378 -0
- package/checks/validation/business/research/research-evidence-helpers.ts +21 -0
- package/checks/validation/business/store/check-app-review-contract.ts +433 -0
- package/checks/validation/business/store/check-app-store-portfolio.ts +279 -0
- package/checks/validation/business/store/check-apple-app-store-requirements.ts +735 -0
- package/checks/validation/business/store/check-asc-command-contract.ts +175 -0
- package/checks/validation/business/store/check-aso-evidence.ts +162 -0
- package/checks/validation/business/store/check-store-console-packet.ts +480 -0
- package/checks/validation/business/store/check-store-screenshots.ts +1113 -0
- package/checks/validation/business/trust/check-ai-provider-controls.ts +127 -0
- package/checks/validation/business/trust/check-privacy-terms.ts +238 -0
- package/checks/validation/business/trust/check-secret-routing.ts +233 -0
- package/checks/validation/business/trust/check-security-release.ts +199 -0
- package/checks/validation/business/words/check-app-copy.ts +1019 -0
- package/checks/validation/business/words/check-founder-copy.ts +471 -0
- package/checks/validation/business/words/check-no-slop.ts +148 -0
- package/checks/validation/repository/README.md +31 -0
- package/checks/validation/repository/agent-guidance-contract.ts +283 -0
- package/checks/validation/repository/audit-skill-links.ts +176 -0
- package/checks/validation/repository/check-agent-entrypoints.ts +259 -0
- package/checks/validation/repository/check-architecture.ts +393 -0
- package/checks/validation/repository/check-autopilot-contract.ts +277 -0
- package/checks/validation/repository/check-capability-delta.ts +30 -0
- package/checks/validation/repository/check-catalog.ts +88 -0
- package/checks/validation/repository/check-engine-e2e.ts +609 -0
- package/checks/validation/repository/check-gates-layout.ts +109 -0
- package/checks/validation/repository/check-graph-foundations.ts +158 -0
- package/checks/validation/repository/check-hub-spoke.ts +144 -0
- package/checks/validation/repository/check-learning-grounding.ts +323 -0
- package/checks/validation/repository/check-operating-graph.ts +205 -0
- package/checks/validation/repository/check-pack-composition.ts +94 -0
- package/checks/validation/repository/check-package-parity.ts +632 -0
- package/checks/validation/repository/check-provider-boundary.ts +154 -0
- package/checks/validation/repository/check-provider-contracts.ts +24 -0
- package/checks/validation/repository/check-reference-size.ts +354 -0
- package/checks/validation/repository/check-repository-boundary.ts +2385 -0
- package/checks/validation/repository/check-skill-supply-chain.ts +290 -0
- package/checks/validation/repository/check-skill-version.ts +363 -0
- package/checks/validation/repository/check-source-freshness.ts +627 -0
- package/checks/validation/repository/check-task-skills.ts +40 -0
- package/checks/validation/repository/check-upstreams.ts +189 -0
- package/checks/validation/repository/check-validator-docs.ts +84 -0
- package/checks/validation/repository/check-version-discipline.ts +314 -0
- package/checks/validation/repository/evals/agent-behavior/ai-chat-companion-archetype-prompt-pack.yaml +21 -0
- package/checks/validation/repository/evals/agent-behavior/appllama-provider-boundary.yaml +18 -0
- package/checks/validation/repository/evals/agent-behavior/compound-engineering-core-work.yaml +16 -0
- package/checks/validation/repository/evals/agent-behavior/design-room-state-render.yaml +15 -0
- package/checks/validation/repository/evals/agent-behavior/first-run-asc-command-contract.yaml +22 -0
- package/checks/validation/repository/evals/agent-behavior/first-run-doctor-asc-winner.yaml +27 -0
- package/checks/validation/repository/evals/agent-behavior/first-run-phase0-apple-honesty.yaml +28 -0
- package/checks/validation/repository/evals/agent-behavior/first-run-portfolio-hold.yaml +29 -0
- package/checks/validation/repository/evals/agent-behavior/first-run-tool-intake-fallback.yaml +32 -0
- package/checks/validation/repository/evals/agent-behavior/founder-zero-business-operator.yaml +28 -0
- package/checks/validation/repository/evals/agent-behavior/frontier-agent-operations.yaml +25 -0
- package/checks/validation/repository/evals/agent-behavior/habit-tracker-archetype-prompt-pack.yaml +22 -0
- package/checks/validation/repository/evals/agent-behavior/last30days-research-boundary.yaml +22 -0
- package/checks/validation/repository/evals/agent-behavior/mobile-flow-craft.yaml +23 -0
- package/checks/validation/repository/evals/agent-behavior/onboarding-review-after-engaged-normal-use.yaml +21 -0
- package/checks/validation/repository/evals/agent-behavior/onboarding-system-graph-rebuild.yaml +26 -0
- package/checks/validation/repository/evals/agent-behavior/photo-ai-media-archetype-prompt-pack.yaml +26 -0
- package/checks/validation/repository/evals/agent-behavior/post-launch-ops-live-app.yaml +27 -0
- package/checks/validation/repository/evals/agent-behavior/provider-proof-before-ready.yaml +15 -0
- package/checks/validation/repository/evals/agent-behavior/session-continuity-resume.yaml +19 -0
- package/checks/validation/repository/evals/agent-behavior/social-network-archetype-prompt-pack.yaml +21 -0
- package/checks/validation/repository/evals/agent-behavior/stale-skill-upgrade.yaml +14 -0
- package/checks/validation/repository/evals/agent-behavior/task-skill-alternate-provider.yaml +17 -0
- package/checks/validation/repository/evals/agent-behavior/task-skill-focused-onboarding.yaml +17 -0
- package/checks/validation/repository/evals/agent-behavior/task-skill-managed-continuation.yaml +17 -0
- package/checks/validation/repository/evals/agent-behavior/task-skill-missing-runtime.yaml +17 -0
- package/checks/validation/repository/evals/launchbench/age-rating-questionnaire-missing.yaml +21 -0
- package/checks/validation/repository/evals/launchbench/agent-behavior-evals-missing.yaml +11 -0
- package/checks/validation/repository/evals/launchbench/app-archetype-pack-incomplete.yaml +15 -0
- package/checks/validation/repository/evals/launchbench/app-preview-video-hook-missing.yaml +14 -0
- package/checks/validation/repository/evals/launchbench/app-price-vs-iap-confusion.yaml +29 -0
- package/checks/validation/repository/evals/launchbench/app-review-accepted-webhook-not-consumed.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/app-review-agreements-status-blocks-poll.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/app-review-binary-old-archive.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/app-review-consume-fixture-as-truth.yaml +17 -0
- package/checks/validation/repository/evals/launchbench/app-review-consumed-envelope-left-in-queue.yaml +21 -0
- package/checks/validation/repository/evals/launchbench/app-review-invalid-state.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/app-review-live-poll-created-date.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/app-review-missing-49-capability.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/app-review-missing-state.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/app-review-pending-agreement.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/app-review-protected-policy.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/app-review-resubmit-cycle-cap.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/app-review-resubmit-timeout-readback.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/app-review-resubmit-unauthorized.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/app-review-reviewer-injection.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/app-review-unknown-state.yaml +17 -0
- package/checks/validation/repository/evals/launchbench/app-review-unobserved-shape.yaml +17 -0
- package/checks/validation/repository/evals/launchbench/app-review-unsigned-webhook.yaml +17 -0
- package/checks/validation/repository/evals/launchbench/app-review-verifier-self.yaml +19 -0
- package/checks/validation/repository/evals/launchbench/app-review-web-session-missing.yaml +19 -0
- package/checks/validation/repository/evals/launchbench/app-review-webhook-payload-as-truth.yaml +19 -0
- package/checks/validation/repository/evals/launchbench/app-review-webhooks-serve.yaml +17 -0
- package/checks/validation/repository/evals/launchbench/app-store-screenshots-unvalidated.yaml +26 -0
- package/checks/validation/repository/evals/launchbench/app-strings-hardcoded-not-localization-ready.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/app-ui-copy-reads-like-spec.yaml +15 -0
- package/checks/validation/repository/evals/launchbench/apple-requirements-thin.yaml +15 -0
- package/checks/validation/repository/evals/launchbench/apple-signing-pre-upload-checklist.yaml +57 -0
- package/checks/validation/repository/evals/launchbench/apple-simulator-only.yaml +13 -0
- package/checks/validation/repository/evals/launchbench/archetype-starter-ignored.yaml +17 -0
- package/checks/validation/repository/evals/launchbench/artifact-template-coverage-gap.yaml +11 -0
- package/checks/validation/repository/evals/launchbench/asc-auth-recovery-not-attempted.yaml +23 -0
- package/checks/validation/repository/evals/launchbench/asc-auth-unverifiable-on-knowledge-surface.yaml +38 -0
- package/checks/validation/repository/evals/launchbench/asc-cli-app-create-screenshot-orchestration-missed.yaml +29 -0
- package/checks/validation/repository/evals/launchbench/asc-flag-drift-runtime.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/asc-listing-thin.yaml +21 -0
- package/checks/validation/repository/evals/launchbench/asc-name-fallback.yaml +12 -0
- package/checks/validation/repository/evals/launchbench/asc-promoted-iap-image-duplicate.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/asc-review-information-missing.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/asc-stale-command-guidance.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/aso-discover-without-ads.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/aso-metadata-appkittie-skipped.yaml +29 -0
- package/checks/validation/repository/evals/launchbench/aso-metadata-stale-log-source.yaml +25 -0
- package/checks/validation/repository/evals/launchbench/aso-unavailable-fabricated.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/attribution-event-only.yaml +15 -0
- package/checks/validation/repository/evals/launchbench/authenticated-browser-mutation-unapproved.yaml +19 -0
- package/checks/validation/repository/evals/launchbench/backend-data-contract-missing.yaml +35 -0
- package/checks/validation/repository/evals/launchbench/behavioral-eval-split-misclaimed.yaml +15 -0
- package/checks/validation/repository/evals/launchbench/broad-request-narrated-not-routed.yaml +32 -0
- package/checks/validation/repository/evals/launchbench/browser-action-state-not-reconciled.yaml +17 -0
- package/checks/validation/repository/evals/launchbench/browser-capability-skipped.yaml +21 -0
- package/checks/validation/repository/evals/launchbench/browser-prompt-injection-followed.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/browser-research-untraceable.yaml +19 -0
- package/checks/validation/repository/evals/launchbench/ce-unavailable-standalone-loop-missing.yaml +33 -0
- package/checks/validation/repository/evals/launchbench/change-cascade-incomplete.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/commitment-funnel-missing.yaml +22 -0
- package/checks/validation/repository/evals/launchbench/compound-freshness-not-checked.yaml +22 -0
- package/checks/validation/repository/evals/launchbench/compound-routing-skipped.yaml +22 -0
- package/checks/validation/repository/evals/launchbench/context-budget-exceeded.yaml +14 -0
- package/checks/validation/repository/evals/launchbench/continuity-drift-between-sessions.yaml +23 -0
- package/checks/validation/repository/evals/launchbench/copy-deck-skipped-during-build.yaml +15 -0
- package/checks/validation/repository/evals/launchbench/copy-ip-sweep-altered-brand-vocabulary.yaml +15 -0
- package/checks/validation/repository/evals/launchbench/design-evidence-pass-skipped.yaml +32 -0
- package/checks/validation/repository/evals/launchbench/design-lock-landing-fanout-skipped.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/design-room-freeform-proposal.yaml +25 -0
- package/checks/validation/repository/evals/launchbench/design-token-promotion-missing.yaml +11 -0
- package/checks/validation/repository/evals/launchbench/design-worthiness-contrast-fail.yaml +15 -0
- package/checks/validation/repository/evals/launchbench/design-worthiness-taste-missing.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/distribution-first-compliments.yaml +17 -0
- package/checks/validation/repository/evals/launchbench/doppler-config-name-and-credential-routing.yaml +29 -0
- package/checks/validation/repository/evals/launchbench/doppler-raw-token-requested.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/email-lane-deep-proof-missing.yaml +13 -0
- package/checks/validation/repository/evals/launchbench/emotional-audit-prose-without-card-mapping.yaml +14 -0
- package/checks/validation/repository/evals/launchbench/emotional-claim-without-research-grounding.yaml +14 -0
- package/checks/validation/repository/evals/launchbench/emotional-design-system-missing.yaml +14 -0
- package/checks/validation/repository/evals/launchbench/evidence-bar-overengineered.yaml +34 -0
- package/checks/validation/repository/evals/launchbench/founder-gate-deferred-forever.yaml +33 -0
- package/checks/validation/repository/evals/launchbench/founder-gate-jargon-without-choice.yaml +27 -0
- package/checks/validation/repository/evals/launchbench/founder-zero-operator-skipped.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/geo-seo-landing-copy-skipped.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/graph-foundations-unenforceable-principle.yaml +22 -0
- package/checks/validation/repository/evals/launchbench/hdyhau-survey-missing.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/higgsfield-design-brief-missing.yaml +25 -0
- package/checks/validation/repository/evals/launchbench/higgsfield-remotion-fallback-unapproved.yaml +21 -0
- package/checks/validation/repository/evals/launchbench/higgsfield-soul-identity-retrained-duplicate.yaml +26 -0
- package/checks/validation/repository/evals/launchbench/house-style-adr-api-example.yaml +21 -0
- package/checks/validation/repository/evals/launchbench/house-style-customer-voice.yaml +23 -0
- package/checks/validation/repository/evals/launchbench/house-style-entrypoints.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/house-style-fixture-as-provider-ready.yaml +22 -0
- package/checks/validation/repository/evals/launchbench/house-style-handoff.yaml +19 -0
- package/checks/validation/repository/evals/launchbench/house-style-inspect-read-only-claim.yaml +26 -0
- package/checks/validation/repository/evals/launchbench/house-style-literal-controls.yaml +21 -0
- package/checks/validation/repository/evals/launchbench/house-style-mixed-readme.yaml +23 -0
- package/checks/validation/repository/evals/launchbench/house-style-packaged-ethos-path.yaml +22 -0
- package/checks/validation/repository/evals/launchbench/house-style-partial-pr.yaml +22 -0
- package/checks/validation/repository/evals/launchbench/house-style-readme-kitchen.yaml +21 -0
- package/checks/validation/repository/evals/launchbench/house-style-timeout-uncertain-mutation.yaml +21 -0
- package/checks/validation/repository/evals/launchbench/in-app-simulator-route-mishandled.yaml +26 -0
- package/checks/validation/repository/evals/launchbench/influencer-sponsorship-shortcuts.yaml +15 -0
- package/checks/validation/repository/evals/launchbench/landing-funnel-deploy-gates.yaml +31 -0
- package/checks/validation/repository/evals/launchbench/landing-motion-progressive-enhancement-missing.yaml +15 -0
- package/checks/validation/repository/evals/launchbench/launch-tier-overproduction.yaml +41 -0
- package/checks/validation/repository/evals/launchbench/live-effect-false-progress.yaml +28 -0
- package/checks/validation/repository/evals/launchbench/live-provider-proof-missing.yaml +12 -0
- package/checks/validation/repository/evals/launchbench/localization-malformed-seasonal-dates.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/localization-same-day-peak.yaml +17 -0
- package/checks/validation/repository/evals/launchbench/missed-provider-deprecation-unmigrated.yaml +21 -0
- package/checks/validation/repository/evals/launchbench/mobai-fallback-unapproved.yaml +13 -0
- package/checks/validation/repository/evals/launchbench/mobai-onboarding-chain-unverified.yaml +23 -0
- package/checks/validation/repository/evals/launchbench/mobai-v25-proof-conflated-or-unsafe.yaml +14 -0
- package/checks/validation/repository/evals/launchbench/monetization-cozy-default-stack-unexamined.yaml +17 -0
- package/checks/validation/repository/evals/launchbench/motion-craft-prose-never-applied.yaml +41 -0
- package/checks/validation/repository/evals/launchbench/multi-runtime-skill-pin-drift.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/native-ios-proof-route-skipped.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/non-competitor-angle-hunt-missing.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/onboarding-event-invented-without-catalog.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/onboarding-research-auth-analytics-skipped.yaml +33 -0
- package/checks/validation/repository/evals/launchbench/operating-graph-pack-leakage.yaml +24 -0
- package/checks/validation/repository/evals/launchbench/operator-stops-after-access-instructions.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/orchestration-preflight-missing.yaml +23 -0
- package/checks/validation/repository/evals/launchbench/pack-composition-weakens-base.yaml +24 -0
- package/checks/validation/repository/evals/launchbench/paid-ai-anonymous-generation.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/paid-ai-controls-file-missing.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/paid-ai-kill-switch-disables-free.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/paid-ai-not-applicable-with-product-evidence.yaml +23 -0
- package/checks/validation/repository/evals/launchbench/paid-ai-pack-omitted-while-spend-active.yaml +21 -0
- package/checks/validation/repository/evals/launchbench/paid-ua-pending-mmp-waiver.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/paid-ua-spend-discipline-missing.yaml +19 -0
- package/checks/validation/repository/evals/launchbench/paid-ua-spend-ready-without-appsflyer.yaml +19 -0
- package/checks/validation/repository/evals/launchbench/paid-user-acquisition-system-missing.yaml +15 -0
- package/checks/validation/repository/evals/launchbench/parallel-file-overlap-unsafe.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/paywall-engine-mismatch.yaml +19 -0
- package/checks/validation/repository/evals/launchbench/paywall-experiment-program-unowned.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/paywall-experimentation-never-starts.yaml +35 -0
- package/checks/validation/repository/evals/launchbench/paywall-goal-headline-missing.yaml +21 -0
- package/checks/validation/repository/evals/launchbench/post-launch-metrics-never-operated.yaml +33 -0
- package/checks/validation/repository/evals/launchbench/post-launch-ops-runbook-missing.yaml +34 -0
- package/checks/validation/repository/evals/launchbench/post-launch-zombie-app-no-kill-decision.yaml +35 -0
- package/checks/validation/repository/evals/launchbench/pre-build-kill-gate-skipped.yaml +43 -0
- package/checks/validation/repository/evals/launchbench/price-derivation-apply-without-dry-run.yaml +19 -0
- package/checks/validation/repository/evals/launchbench/price-derivation-multiplier-as-approval.yaml +19 -0
- package/checks/validation/repository/evals/launchbench/project-state-stale-after-upload.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/remotion-assets-thin.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/remotion-license-unchecked.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/repository-profile-acceptance-incomplete.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/repository-profile-overlay-invalid-yaml.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/repository-profile-public-community-on-private.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/repository-profile-suppresses-privacy.yaml +19 -0
- package/checks/validation/repository/evals/launchbench/resend-template-unbranded.yaml +13 -0
- package/checks/validation/repository/evals/launchbench/revenuecat-entitlement-unproven.yaml +13 -0
- package/checks/validation/repository/evals/launchbench/revenuecat-experiments-capability-unclassified.yaml +22 -0
- package/checks/validation/repository/evals/launchbench/revenuecat-subscription-preflight-missing.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/review-prompt-teardown-race.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/scrollytelling-copy-visual-disconnect.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/scrollytelling-mobile-short-height-failure.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/scrollytelling-reduced-motion-no-js-failure.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/scrollytelling-scroll-sync-drift.yaml +16 -0
- package/checks/validation/repository/evals/launchbench/secret-routing-missing.yaml +13 -0
- package/checks/validation/repository/evals/launchbench/secrets-baseline-skipped.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/security-release-lane-missing.yaml +15 -0
- package/checks/validation/repository/evals/launchbench/social-shared-password-instead-of-delegation.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/source-checkpoint-missing.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/source-registry-url-untracked.yaml +18 -0
- package/checks/validation/repository/evals/launchbench/stale-blocker-after-authoritative-readback.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/stale-installed-skill-runtime.yaml +25 -0
- package/checks/validation/repository/evals/launchbench/standing-approval-reprompt-and-late-tool-preflight.yaml +23 -0
- package/checks/validation/repository/evals/launchbench/state-updated-but-never-narrated.yaml +30 -0
- package/checks/validation/repository/evals/launchbench/store-screenshots-raw-only.yaml +24 -0
- package/checks/validation/repository/evals/launchbench/subagent-dispatch-skipped.yaml +22 -0
- package/checks/validation/repository/evals/launchbench/subagent-findings-unintegrated.yaml +21 -0
- package/checks/validation/repository/evals/launchbench/subagent-forbidden-actions.yaml +19 -0
- package/checks/validation/repository/evals/launchbench/transformation-demo-vitamin.yaml +19 -0
- package/checks/validation/repository/evals/launchbench/typed-skill-graph-drift.yaml +17 -0
- package/checks/validation/repository/evals/launchbench/variable-reward-without-ethics-guardrail.yaml +14 -0
- package/checks/validation/repository/evals/launchbench/virality-predictor-skipped-before-spend.yaml +24 -0
- package/checks/validation/repository/evals/launchbench/weekly-source-refresh-unreviewed.yaml +20 -0
- package/checks/validation/repository/evals/launchbench/xctest-signal-kill-loop.yaml +17 -0
- package/checks/validation/repository/evals/triggering/autopilot-triggering.yaml +140 -0
- package/checks/validation/repository/fixtures/_builders-ops.ts +358 -0
- package/checks/validation/repository/fixtures/_builders-store.ts +380 -0
- package/checks/validation/repository/fixtures/_evidence-header-constants.ts +37 -0
- package/checks/validation/repository/fixtures/_harness.ts +213 -0
- package/checks/validation/repository/fixtures/_source-http-checks.ts +258 -0
- package/checks/validation/repository/fixtures/_source-http-preload.mjs +71 -0
- package/checks/validation/repository/fixtures/_state.ts +29 -0
- package/checks/validation/repository/fixtures/_table-edit.ts +18 -0
- package/checks/validation/repository/fixtures/agent-entrypoints.fixtures.ts +277 -0
- package/checks/validation/repository/fixtures/agent-operations.fixtures.ts +614 -0
- package/checks/validation/repository/fixtures/appkittie-adapter.fixtures.ts +143 -0
- package/checks/validation/repository/fixtures/archetype.fixtures.ts +137 -0
- package/checks/validation/repository/fixtures/architecture.fixtures.ts +127 -0
- package/checks/validation/repository/fixtures/behavioral.fixtures.ts +19 -0
- package/checks/validation/repository/fixtures/check-json.fixtures.ts +145 -0
- package/checks/validation/repository/fixtures/continuity-length-budget.fixtures.ts +35 -0
- package/checks/validation/repository/fixtures/copy.fixtures.ts +1486 -0
- package/checks/validation/repository/fixtures/core-artifacts.fixtures.ts +3208 -0
- package/checks/validation/repository/fixtures/design-taste-grading.fixtures.ts +358 -0
- package/checks/validation/repository/fixtures/design-taste-rubric.fixtures.ts +136 -0
- package/checks/validation/repository/fixtures/design.fixtures.ts +5771 -0
- package/checks/validation/repository/fixtures/engineering.fixtures.ts +764 -0
- package/checks/validation/repository/fixtures/evidence-schema.fixtures.ts +448 -0
- package/checks/validation/repository/fixtures/founder-operator.fixtures.ts +897 -0
- package/checks/validation/repository/fixtures/graph-foundations.fixtures.ts +107 -0
- package/checks/validation/repository/fixtures/growth.fixtures.ts +908 -0
- package/checks/validation/repository/fixtures/learning.fixtures.ts +243 -0
- package/checks/validation/repository/fixtures/lifecycle.fixtures.ts +1958 -0
- package/checks/validation/repository/fixtures/mobai.fixtures.ts +277 -0
- package/checks/validation/repository/fixtures/onboarding.fixtures.ts +2447 -0
- package/checks/validation/repository/fixtures/operating-graph.fixtures.ts +24 -0
- package/checks/validation/repository/fixtures/pack-composition.fixtures.ts +117 -0
- package/checks/validation/repository/fixtures/probes-and-grading.fixtures.ts +122 -0
- package/checks/validation/repository/fixtures/provider-contracts.fixtures.ts +378 -0
- package/checks/validation/repository/fixtures/providers-and-secrets.fixtures.ts +1266 -0
- package/checks/validation/repository/fixtures/repo-gates.fixtures.ts +2451 -0
- package/checks/validation/repository/fixtures/repository-boundary.fixtures.ts +2281 -0
- package/checks/validation/repository/fixtures/repository-profile.fixtures.ts +244 -0
- package/checks/validation/repository/fixtures/roster.fixtures.ts +62 -0
- package/checks/validation/repository/fixtures/runtime-sync.fixtures.ts +286 -0
- package/checks/validation/repository/fixtures/skill-supply-chain.fixtures.ts +114 -0
- package/checks/validation/repository/fixtures/source-access.fixtures.ts +523 -0
- package/checks/validation/repository/fixtures/state-and-meta.fixtures.ts +1518 -0
- package/checks/validation/repository/fixtures/store.fixtures.ts +1573 -0
- package/checks/validation/repository/fixtures/upstreams.fixtures.ts +222 -0
- package/checks/validation/repository/launchbench-evals.md +150 -0
- package/checks/validation/repository/message-batches.ts +75 -0
- package/checks/validation/repository/refresh-source-freshness.ts +341 -0
- package/checks/validation/repository/run-agent-evals.ts +117 -0
- package/checks/validation/repository/run-behavioral-evals.ts +612 -0
- package/checks/validation/repository/run-launchbench.ts +246 -0
- package/checks/validation/repository/run-validator-fixtures.ts +173 -0
- package/checks/validation/repository/skill-versioning.md +91 -0
- package/checks/validation/repository/source-freshness-maintenance.md +129 -0
- package/checks/validation/repository/source-registry.yaml +2976 -0
- package/contracts/contribution/contract.ts +571 -0
- package/contracts/extensions/contract.ts +307 -0
- package/contracts/extensions/schemas/extension.schema.json +756 -0
- package/contracts/mobile-operation.ts +148 -0
- package/contracts/onboarding/foundations.ts +286 -0
- package/contracts/public-api/REFERENCE.md +206 -0
- package/contracts/public-api/connection-receipt.ts +645 -0
- package/contracts/public-api/contract.ts +786 -0
- package/contracts/public-api/examples/mobile-app-capture.json +5 -0
- package/contracts/public-api/examples/subscription-app.json +19 -0
- package/contracts/public-api/research-contract.ts +125 -0
- package/contracts/public-api/schemas/business.create.input.schema.json +38 -0
- package/contracts/public-api/schemas/business.create.result.schema.json +177 -0
- package/contracts/public-api/schemas/business.evidence.input.schema.json +19 -0
- package/contracts/public-api/schemas/business.evidence.result.schema.json +206 -0
- package/contracts/public-api/schemas/business.initialize.input.schema.json +20 -0
- package/contracts/public-api/schemas/business.initialize.result.schema.json +140 -0
- package/contracts/public-api/schemas/business.plan.input.schema.json +21 -0
- package/contracts/public-api/schemas/business.plan.result.schema.json +1007 -0
- package/contracts/public-api/schemas/business.recover.input.schema.json +25 -0
- package/contracts/public-api/schemas/business.recover.result.schema.json +179 -0
- package/contracts/public-api/schemas/business.research.decision.input.schema.json +53 -0
- package/contracts/public-api/schemas/business.research.decision.result.schema.json +184 -0
- package/contracts/public-api/schemas/business.research.lookup.input.schema.json +87 -0
- package/contracts/public-api/schemas/business.research.lookup.result.schema.json +281 -0
- package/contracts/public-api/schemas/business.research.record.input.schema.json +136 -0
- package/contracts/public-api/schemas/business.research.record.result.schema.json +149 -0
- package/contracts/public-api/schemas/business.run.input.schema.json +53 -0
- package/contracts/public-api/schemas/business.run.result.schema.json +218 -0
- package/contracts/public-api/schemas/business.status.input.schema.json +15 -0
- package/contracts/public-api/schemas/business.status.result.schema.json +319 -0
- package/contracts/public-api/schemas/catalog.list.input.schema.json +20 -0
- package/contracts/public-api/schemas/catalog.list.result.schema.json +208 -0
- package/contracts/public-api/schemas/composition.activate.input.schema.json +30 -0
- package/contracts/public-api/schemas/composition.activate.result.schema.json +161 -0
- package/contracts/public-api/schemas/composition.plan.input.schema.json +25 -0
- package/contracts/public-api/schemas/composition.plan.result.schema.json +253 -0
- package/contracts/public-api/schemas/composition.preview.input.schema.json +118 -0
- package/contracts/public-api/schemas/composition.preview.result.schema.json +284 -0
- package/contracts/public-api/schemas/composition.recover.input.schema.json +23 -0
- package/contracts/public-api/schemas/composition.recover.result.schema.json +161 -0
- package/contracts/public-api/schemas/composition.schema.json +101 -0
- package/contracts/public-api/schemas/market.report.input.schema.json +21 -0
- package/contracts/public-api/schemas/market.report.result.schema.json +377 -0
- package/contracts/public-api/schemas/packages.import.input.schema.json +29 -0
- package/contracts/public-api/schemas/packages.import.result.schema.json +177 -0
- package/contracts/public-api/schemas/packages.list.input.schema.json +15 -0
- package/contracts/public-api/schemas/packages.list.result.schema.json +189 -0
- package/contracts/research/observation.ts +27 -0
- package/contracts/semantic/canonicalize.ts +25 -0
- package/contracts/semantic/index.ts +116 -0
- package/contracts/semantic/package-resource.ts +53 -0
- package/contracts/semantic/query-ir.ts +215 -0
- package/contracts/semantic/question-pack.ts +176 -0
- package/contracts/semantic/questions.ts +149 -0
- package/contracts/semantic/receipts.ts +179 -0
- package/contracts/shared-resources.ts +18 -0
- package/contracts/source-access.ts +44 -0
- package/contracts/worker-artifact.ts +14 -0
- package/dist/adapters/app-review/archive.js +46 -0
- package/dist/adapters/app-review/asc-boundary.js +71 -0
- package/dist/adapters/app-review/asc-provider.js +474 -0
- package/dist/adapters/app-review/auth.js +53 -0
- package/dist/adapters/app-review/capability.js +195 -0
- package/dist/adapters/app-review/classify.js +107 -0
- package/dist/adapters/app-review/consume.js +77 -0
- package/dist/adapters/app-review/envelope.js +89 -0
- package/dist/adapters/app-review/events.js +381 -0
- package/dist/adapters/app-review/hmac.js +72 -0
- package/dist/adapters/app-review/implement.js +76 -0
- package/dist/adapters/app-review/index.js +29 -0
- package/dist/adapters/app-review/ingest.js +106 -0
- package/dist/adapters/app-review/mandate.js +76 -0
- package/dist/adapters/app-review/normalize.js +245 -0
- package/dist/adapters/app-review/packet.js +236 -0
- package/dist/adapters/app-review/persist.js +83 -0
- package/dist/adapters/app-review/plan.js +268 -0
- package/dist/adapters/app-review/plist.js +218 -0
- package/dist/adapters/app-review/poll.js +224 -0
- package/dist/adapters/app-review/projection.js +143 -0
- package/dist/adapters/app-review/queue.js +115 -0
- package/dist/adapters/app-review/receiver.js +78 -0
- package/dist/adapters/app-review/registration.js +52 -0
- package/dist/adapters/app-review/remediate.js +185 -0
- package/dist/adapters/app-review/render.js +175 -0
- package/dist/adapters/app-review/resubmit.js +322 -0
- package/dist/adapters/app-review/types.js +52 -0
- package/dist/adapters/app-review/uncertain-execution.js +151 -0
- package/dist/adapters/app-review/verification.js +35 -0
- package/dist/adapters/appkittie-category-revenue.js +69 -0
- package/dist/adapters/claude.js +51 -0
- package/dist/adapters/codex.js +47 -0
- package/dist/adapters/cursor.js +48 -0
- package/dist/adapters/device-proof.js +649 -0
- package/dist/adapters/greenfield/boundary.js +126 -0
- package/dist/adapters/greenfield/fail-safe.js +120 -0
- package/dist/adapters/greenfield/index.js +2 -0
- package/dist/adapters/inline.js +35 -0
- package/dist/adapters/install-control-permissions.js +264 -0
- package/dist/adapters/install-entrypoints.js +344 -0
- package/dist/adapters/install-schedule.js +571 -0
- package/dist/adapters/ios-app-evidence.js +111 -0
- package/dist/adapters/mobile-operation-host.js +206 -0
- package/dist/adapters/mobile-operation.js +93 -0
- package/dist/adapters/operating.js +7 -0
- package/dist/adapters/probe.js +40 -0
- package/dist/adapters/profile.js +134 -0
- package/dist/adapters/providers/capability-delta.js +59 -0
- package/dist/adapters/providers/contract.js +41 -0
- package/dist/adapters/providers/evaluate.js +116 -0
- package/dist/adapters/providers/expo/argv.js +222 -0
- package/dist/adapters/providers/expo/decode.js +593 -0
- package/dist/adapters/providers/expo/discovery.js +94 -0
- package/dist/adapters/providers/expo/doctor.js +145 -0
- package/dist/adapters/providers/expo/effects.js +142 -0
- package/dist/adapters/providers/expo/execute.js +299 -0
- package/dist/adapters/providers/expo/expo-device-bind.js +91 -0
- package/dist/adapters/providers/expo/expo-mcp-route.js +282 -0
- package/dist/adapters/providers/expo/hosting-prepare.js +116 -0
- package/dist/adapters/providers/expo/identity.js +99 -0
- package/dist/adapters/providers/expo/index.js +26 -0
- package/dist/adapters/providers/expo/jobs.js +424 -0
- package/dist/adapters/providers/expo/preflight.js +215 -0
- package/dist/adapters/providers/expo/process.js +117 -0
- package/dist/adapters/providers/expo/project-config.js +147 -0
- package/dist/adapters/providers/expo/sanitize.js +46 -0
- package/dist/adapters/providers/expo/signing-readiness.js +108 -0
- package/dist/adapters/providers/expo/store-handoff.js +52 -0
- package/dist/adapters/providers/expo/update-identity.js +70 -0
- package/dist/adapters/providers/expo/update-policy.js +93 -0
- package/dist/adapters/providers/expo/update-prepare.js +104 -0
- package/dist/adapters/providers/expo/update-recovery.js +96 -0
- package/dist/adapters/providers/expo/update-rollout.js +69 -0
- package/dist/adapters/providers/expo/update-signing.js +69 -0
- package/dist/adapters/providers/expo/web-api-contract.js +112 -0
- package/dist/adapters/providers/growth-agent/boundary.js +143 -0
- package/dist/adapters/providers/growth-agent/fail-safe.js +220 -0
- package/dist/adapters/providers/growth-agent/index.js +2 -0
- package/dist/adapters/providers/layers/effects.js +72 -0
- package/dist/adapters/providers/layers/index.js +9 -0
- package/dist/adapters/providers/layers/jobs.js +207 -0
- package/dist/adapters/providers/layers/onboarding.js +114 -0
- package/dist/adapters/providers/layers/route.js +242 -0
- package/dist/adapters/providers/layers/transport.js +144 -0
- package/dist/adapters/providers/load.js +300 -0
- package/dist/adapters/providers/mobile-ops/boundary.js +114 -0
- package/dist/adapters/providers/mobile-ops/fail-safe.js +190 -0
- package/dist/adapters/providers/mobile-ops/index.js +2 -0
- package/dist/adapters/providers/monetization-validation.js +72 -0
- package/dist/adapters/providers/revenuecat/cli-catalog-observe.js +230 -0
- package/dist/adapters/providers/revenuecat/cli-catalog.js +941 -0
- package/dist/adapters/providers/revenuecat/cli-command-schema.js +319 -0
- package/dist/adapters/providers/revenuecat/cli-decode.js +740 -0
- package/dist/adapters/providers/revenuecat/cli-discovery.js +205 -0
- package/dist/adapters/providers/revenuecat/cli-doctor.js +199 -0
- package/dist/adapters/providers/revenuecat/cli-execute.js +345 -0
- package/dist/adapters/providers/revenuecat/cli-ledger.js +371 -0
- package/dist/adapters/providers/revenuecat/cli-operations.js +875 -0
- package/dist/adapters/providers/revenuecat/cli-preflight.js +175 -0
- package/dist/adapters/providers/revenuecat/cli-process.js +149 -0
- package/dist/adapters/providers/revenuecat/cli-proof.js +121 -0
- package/dist/adapters/providers/revenuecat/cli-reconcile-plan.js +901 -0
- package/dist/adapters/providers/revenuecat/provisioning.js +52 -0
- package/dist/adapters/providers/revenuecat/revenue-validation.js +772 -0
- package/dist/adapters/providers/runtime-pin.js +92 -0
- package/dist/adapters/providers/superwall/boundary.js +86 -0
- package/dist/adapters/providers/superwall/fail-safe.js +171 -0
- package/dist/adapters/providers/superwall/measurement.js +49 -0
- package/dist/adapters/providers/typesafe/assess.js +160 -0
- package/dist/adapters/providers/typesafe/binding.js +35 -0
- package/dist/adapters/providers/typesafe/connection.js +58 -0
- package/dist/adapters/providers/typesafe/decode.js +255 -0
- package/dist/adapters/providers/typesafe/effects.js +67 -0
- package/dist/adapters/providers/typesafe/encode.js +61 -0
- package/dist/adapters/providers/typesafe/index.js +12 -0
- package/dist/adapters/providers/typesafe/support.js +65 -0
- package/dist/adapters/providers/typesafe/transport.js +318 -0
- package/dist/adapters/provisioning/capability-gaps.js +66 -0
- package/dist/adapters/provisioning/capability-readiness.js +39 -0
- package/dist/adapters/provisioning/cli.js +259 -0
- package/dist/adapters/provisioning/requirements.js +458 -0
- package/dist/adapters/provisioning/resolve.js +217 -0
- package/dist/adapters/registry.js +180 -0
- package/dist/catalog/agent-graph/load.js +102 -0
- package/dist/catalog/agent-graph/types.js +15 -0
- package/dist/catalog/agent-graph/validate.js +110 -0
- package/dist/catalog/areas.js +83 -0
- package/dist/catalog/artifacts.js +38 -0
- package/dist/catalog/authoring.js +43 -0
- package/dist/catalog/bridge.js +221 -0
- package/dist/catalog/business-primitives.js +80 -0
- package/dist/catalog/business-units.js +13 -0
- package/dist/catalog/capabilities/types.js +3 -0
- package/dist/catalog/context-packs.js +76 -0
- package/dist/catalog/domain-authority.js +32 -0
- package/dist/catalog/domains.js +170 -0
- package/dist/catalog/firstparty-declarations.js +625 -0
- package/dist/catalog/firstparty-recipes.js +273 -0
- package/dist/catalog/gates.js +93 -0
- package/dist/catalog/ids.js +18 -0
- package/dist/catalog/index.js +36 -0
- package/dist/catalog/knowledge-packages.js +210 -0
- package/dist/catalog/knowledge-validation.js +160 -0
- package/dist/catalog/lane-graph.js +30 -0
- package/dist/catalog/lanes.js +59 -0
- package/dist/catalog/ontology/design-surface-applicability.js +383 -0
- package/dist/catalog/ontology/instance-load.js +97 -0
- package/dist/catalog/ontology/instance-types.js +25 -0
- package/dist/catalog/ontology/instance-validate.js +86 -0
- package/dist/catalog/ontology/load.js +174 -0
- package/dist/catalog/ontology/onboarding-applicability.js +166 -0
- package/dist/catalog/ontology/product-workspace.js +36 -0
- package/dist/catalog/ontology/query.js +62 -0
- package/dist/catalog/ontology/render-product.js +26 -0
- package/dist/catalog/ontology/types.js +24 -0
- package/dist/catalog/ontology/validate.js +173 -0
- package/dist/catalog/operators.js +246 -0
- package/dist/catalog/overlays.js +28 -0
- package/dist/catalog/packs/compose.js +386 -0
- package/dist/catalog/packs/firstparty-assets.js +68 -0
- package/dist/catalog/packs/firstparty-notices.js +52 -0
- package/dist/catalog/packs/firstparty.js +134 -0
- package/dist/catalog/packs/installed-firstparty.js +20 -0
- package/dist/catalog/packs/isolation.js +77 -0
- package/dist/catalog/packs/load.js +543 -0
- package/dist/catalog/packs/snapshots.js +122 -0
- package/dist/catalog/packs/types.js +11 -0
- package/dist/catalog/phases.js +137 -0
- package/dist/catalog/principles/guards.js +101 -0
- package/dist/catalog/principles/load.js +176 -0
- package/dist/catalog/principles/types.js +26 -0
- package/dist/catalog/profiles.js +40 -0
- package/dist/catalog/providers/apple-asc-canonical-map.js +449 -0
- package/dist/catalog/providers/conformance.js +41 -0
- package/dist/catalog/providers/greenfield-70-applicability-closeout-map.js +210 -0
- package/dist/catalog/providers/greenfield-71-handoff-closeout-map.js +331 -0
- package/dist/catalog/providers/greenfield-72-benchmark-closeout-map.js +449 -0
- package/dist/catalog/providers/greenfield-73-overhead-closeout-map.js +276 -0
- package/dist/catalog/providers/greenfield-75-retrieval-closeout-map.js +283 -0
- package/dist/catalog/providers/greenfield-76-change-impact-closeout-map.js +287 -0
- package/dist/catalog/providers/greenfield-delivery-audit-map.js +319 -0
- package/dist/catalog/providers/growth-agent-canonical-map.js +599 -0
- package/dist/catalog/providers/mobile-ops-canonical-map.js +513 -0
- package/dist/catalog/providers/semantic-batch-map.js +62 -0
- package/dist/catalog/providers/semantic-eval-baselines-map.js +735 -0
- package/dist/catalog/providers/semantic-graph-views-map.js +66 -0
- package/dist/catalog/providers/semantic-plan-lower-map.js +54 -0
- package/dist/catalog/providers/semantic-source-projection-map.js +78 -0
- package/dist/catalog/providers/superwall-canonical-map.js +325 -0
- package/dist/catalog/providers/typesafe-qualify-map.js +224 -0
- package/dist/catalog/recipes/default-monetization.js +9 -0
- package/dist/catalog/render-routing.js +394 -0
- package/dist/catalog/repository-profiles/compile.js +381 -0
- package/dist/catalog/repository-profiles/index.js +4 -0
- package/dist/catalog/repository-profiles/paid-generation-applicability.js +111 -0
- package/dist/catalog/repository-profiles/registry.js +75 -0
- package/dist/catalog/repository-profiles/types.js +17 -0
- package/dist/catalog/repository-profiles/workspace.js +128 -0
- package/dist/catalog/roles.js +266 -0
- package/dist/catalog/stacks/expo-agent-privacy.js +101 -0
- package/dist/catalog/stacks/expo-agent-tools.js +264 -0
- package/dist/catalog/stacks/expo-capability-matrix.js +209 -0
- package/dist/catalog/stacks/expo-capability-protocol.js +521 -0
- package/dist/catalog/stacks/expo-custom-module.js +367 -0
- package/dist/catalog/stacks/expo-eas-commands.js +677 -0
- package/dist/catalog/stacks/expo-eas-hosting.js +160 -0
- package/dist/catalog/stacks/expo-eas-operation-matrix.js +194 -0
- package/dist/catalog/stacks/expo-local-boot.js +301 -0
- package/dist/catalog/stacks/expo-local-capabilities.js +240 -0
- package/dist/catalog/stacks/expo-native-ownership.js +362 -0
- package/dist/catalog/stacks/expo-observability.js +101 -0
- package/dist/catalog/stacks/expo-proof-collection.js +231 -0
- package/dist/catalog/stacks/expo-quality-evidence.js +148 -0
- package/dist/catalog/stacks/expo-revenuecat-wiring.js +103 -0
- package/dist/catalog/stacks/expo-router-contract.js +340 -0
- package/dist/catalog/stacks/expo-sdk-upgrade.js +126 -0
- package/dist/catalog/stacks/expo-selection.js +572 -0
- package/dist/catalog/stacks/expo-starter-fixture/modules/b2c-native-capability/src/capability.js +36 -0
- package/dist/catalog/stacks/expo-starter-fixture/modules/b2c-native-capability/src/index.web.js +11 -0
- package/dist/catalog/stacks/expo-starter-fixture/modules/b2c-native-capability/src/invoke.js +17 -0
- package/dist/catalog/stacks/expo-starter-fixture/src/capabilities/reducers.js +116 -0
- package/dist/catalog/stacks/expo-starter-fixture/src/navigation/deep-link.js +14 -0
- package/dist/catalog/stacks/expo-starter-fixture/src/navigation/journeys.js +94 -0
- package/dist/catalog/stacks/expo-starter-fixture/src/navigation/route-graph.js +36 -0
- package/dist/catalog/stacks/expo-starter-fixture/src/notifications/handoff.js +15 -0
- package/dist/catalog/stacks/expo-starter-fixture/src/offline/local-cache.js +62 -0
- package/dist/catalog/stacks/expo-starter-fixture/src/permissions/safe-state.js +10 -0
- package/dist/catalog/stacks/expo-starter-fixture/src/persistence/seam.js +25 -0
- package/dist/catalog/stacks/expo-starter-fixture/src/session/local-session.js +24 -0
- package/dist/catalog/stacks/expo-starter-fixture/src/states/surface-state.js +12 -0
- package/dist/catalog/stacks/expo-starter-fixture/src/ui/contract-binding.js +11 -0
- package/dist/catalog/stacks/expo-starter-fixture/src/ui/tokens.js +8 -0
- package/dist/catalog/stacks/expo-starter.js +292 -0
- package/dist/catalog/stacks/expo-web-api-routes.js +145 -0
- package/dist/catalog/stacks/expo-web-static.js +407 -0
- package/dist/catalog/stacks/expo-web-surface-table.js +162 -0
- package/dist/catalog/task-skills.js +345 -0
- package/dist/catalog/taxonomy/load.js +109 -0
- package/dist/catalog/taxonomy/types.js +30 -0
- package/dist/catalog/taxonomy/validate.js +199 -0
- package/dist/catalog/types.js +6 -0
- package/dist/catalog/validate.js +745 -0
- package/dist/catalog/workflows/build-release.js +704 -0
- package/dist/catalog/workflows/growth-revenue.js +322 -0
- package/dist/catalog/workflows/helpers.js +61 -0
- package/dist/catalog/workflows/index.js +8 -0
- package/dist/catalog/workflows/maintenance.js +269 -0
- package/dist/catalog/workflows/operating-system.js +250 -0
- package/dist/catalog/workflows/operations-trust.js +407 -0
- package/dist/catalog/workflows/product-experience.js +1214 -0
- package/dist/checks/validation/business/design/color-contrast.js +41 -0
- package/dist/checks/validation/business/design/design-acceptance.js +1716 -0
- package/dist/checks/validation/business/design/lib/vibecode-tells.js +78 -0
- package/dist/checks/validation/business/design/lib/worthiness-mechanical.js +157 -0
- package/dist/checks/validation/business/design/runtime-reviewer-inputs.js +51 -0
- package/dist/checks/validation/business/design/surface-page-gates.js +140 -0
- package/dist/checks/validation/repository/agent-guidance-contract.js +257 -0
- package/dist/checks/validation/repository/check-agent-entrypoints.js +210 -0
- package/dist/checks/validation/repository/check-architecture.js +327 -0
- package/dist/checks/validation/repository/check-autopilot-contract.js +198 -0
- package/dist/checks/validation/repository/check-capability-delta.js +28 -0
- package/dist/checks/validation/repository/check-catalog.js +80 -0
- package/dist/checks/validation/repository/check-gates-layout.js +76 -0
- package/dist/checks/validation/repository/check-graph-foundations.js +130 -0
- package/dist/checks/validation/repository/check-hub-spoke.js +110 -0
- package/dist/checks/validation/repository/check-learning-grounding.js +259 -0
- package/dist/checks/validation/repository/check-operating-graph.js +171 -0
- package/dist/checks/validation/repository/check-pack-composition.js +87 -0
- package/dist/checks/validation/repository/check-package-parity.js +410 -0
- package/dist/checks/validation/repository/check-provider-boundary.js +116 -0
- package/dist/checks/validation/repository/check-provider-contracts.js +21 -0
- package/dist/checks/validation/repository/check-upstreams.js +123 -0
- package/dist/checks/validation/repository/check-validator-docs.js +57 -0
- package/dist/contracts/contribution/contract.js +496 -0
- package/dist/contracts/extensions/contract.js +317 -0
- package/dist/contracts/mobile-operation.js +137 -0
- package/dist/contracts/onboarding/foundations.js +268 -0
- package/dist/contracts/public-api/connection-receipt.js +468 -0
- package/dist/contracts/public-api/contract.js +682 -0
- package/dist/contracts/public-api/research-contract.js +119 -0
- package/dist/contracts/research/observation.js +26 -0
- package/dist/contracts/semantic/canonicalize.js +24 -0
- package/dist/contracts/semantic/index.js +12 -0
- package/dist/contracts/semantic/package-resource.js +42 -0
- package/dist/contracts/semantic/query-ir.js +185 -0
- package/dist/contracts/semantic/question-pack.js +155 -0
- package/dist/contracts/semantic/questions.js +124 -0
- package/dist/contracts/semantic/receipts.js +152 -0
- package/dist/contracts/shared-resources.js +11 -0
- package/dist/contracts/source-access.js +36 -0
- package/dist/contracts/worker-artifact.js +13 -0
- package/dist/entrypoints/cli/business.js +245 -0
- package/dist/entrypoints/cli/contribute.js +256 -0
- package/dist/entrypoints/mcp/business.js +17 -0
- package/dist/entrypoints/mcp/contribute.js +36 -0
- package/dist/entrypoints/mcp/run-process.js +58 -0
- package/dist/entrypoints/mcp/server.js +664 -0
- package/dist/kernel/autonomy/budget.js +110 -0
- package/dist/kernel/autonomy/evaluator.js +81 -0
- package/dist/kernel/autonomy/grants.js +88 -0
- package/dist/kernel/autonomy/killswitch.js +16 -0
- package/dist/kernel/autonomy/prerequisites.js +71 -0
- package/dist/kernel/autonomy/probes/budget.js +50 -0
- package/dist/kernel/autonomy/probes/doppler.js +34 -0
- package/dist/kernel/autonomy/standing-approvals.js +272 -0
- package/dist/kernel/autonomy/waivers.js +97 -0
- package/dist/kernel/composition/activation.js +474 -0
- package/dist/kernel/composition/compile-bindings.js +241 -0
- package/dist/kernel/composition/notices.js +179 -0
- package/dist/kernel/composition/onboarding-selection.js +172 -0
- package/dist/kernel/composition/providers.js +29 -0
- package/dist/kernel/composition/resolve.js +201 -0
- package/dist/kernel/composition/resources.js +284 -0
- package/dist/kernel/composition/semantic-plan-lower.js +659 -0
- package/dist/kernel/composition/worker-context.js +54 -0
- package/dist/kernel/context/budget.js +12 -0
- package/dist/kernel/context/compile.js +54 -0
- package/dist/kernel/context/receipt.js +7 -0
- package/dist/kernel/context/selectors.js +25 -0
- package/dist/kernel/contribution/accepted-upstreams.js +71 -0
- package/dist/kernel/contribution/adoption-map.js +103 -0
- package/dist/kernel/contribution/check.js +157 -0
- package/dist/kernel/contribution/evaluate.js +251 -0
- package/dist/kernel/contribution/existing-owners.js +89 -0
- package/dist/kernel/contribution/github-metadata.js +178 -0
- package/dist/kernel/contribution/host-observe.js +117 -0
- package/dist/kernel/contribution/intake.js +559 -0
- package/dist/kernel/contribution/manifest-io.js +238 -0
- package/dist/kernel/contribution/plan.js +358 -0
- package/dist/kernel/contribution/preview.js +198 -0
- package/dist/kernel/contribution/provider-capability-delta.js +142 -0
- package/dist/kernel/contribution/service.js +208 -0
- package/dist/kernel/contribution/types.js +1 -0
- package/dist/kernel/contribution/untrusted.js +164 -0
- package/dist/kernel/contribution/upstream-coverage.js +99 -0
- package/dist/kernel/contribution/upstreams-load.js +157 -0
- package/dist/kernel/contribution/upstreams.js +1134 -0
- package/dist/kernel/engine/artifact-fingerprint.js +29 -0
- package/dist/kernel/engine/compile.js +201 -0
- package/dist/kernel/engine/design-taste-authority.js +191 -0
- package/dist/kernel/engine/dispatch.js +60 -0
- package/dist/kernel/engine/founder-decision-receipt.js +474 -0
- package/dist/kernel/engine/founder-trust-store.js +645 -0
- package/dist/kernel/engine/frontier.js +123 -0
- package/dist/kernel/engine/node-brief.js +199 -0
- package/dist/kernel/engine/proof-rung.js +47 -0
- package/dist/kernel/engine/review-evidence.js +292 -0
- package/dist/kernel/engine/review-facet.js +6 -0
- package/dist/kernel/engine/runstate.js +1032 -0
- package/dist/kernel/engine/source-fingerprint.js +89 -0
- package/dist/kernel/engine/verification-policy.js +4 -0
- package/dist/kernel/engine/verification.js +130 -0
- package/dist/kernel/knowledge-service/journey.js +46 -0
- package/dist/kernel/knowledge-service/projection-helpers.js +196 -0
- package/dist/kernel/knowledge-service/sections.js +58 -0
- package/dist/kernel/knowledge-service/semantic-graph-views.js +514 -0
- package/dist/kernel/knowledge-service/service.js +767 -0
- package/dist/kernel/knowledge-service/tools.js +101 -0
- package/dist/kernel/knowledge-service/types.js +27 -0
- package/dist/kernel/lib/atomic-file.js +39 -0
- package/dist/kernel/lib/bounded-file.js +29 -0
- package/dist/kernel/lib/cli.js +42 -0
- package/dist/kernel/lib/empty-equivalent-evidence.js +33 -0
- package/dist/kernel/lib/later-guidance.js +101 -0
- package/dist/kernel/lib/required-table-section.js +535 -0
- package/dist/kernel/operating-model/agreements.js +17 -0
- package/dist/kernel/operating-model/authorize.js +65 -0
- package/dist/kernel/operating-model/erasure-metadata.js +6 -0
- package/dist/kernel/operating-model/events.js +123 -0
- package/dist/kernel/operating-model/mandates.js +64 -0
- package/dist/kernel/operating-model/market-experiment.js +290 -0
- package/dist/kernel/operating-model/measurement.js +400 -0
- package/dist/kernel/operating-model/parties.js +12 -0
- package/dist/kernel/operating-model/projections.js +109 -0
- package/dist/kernel/operating-model/types.js +41 -0
- package/dist/kernel/operating-model/validate.js +316 -0
- package/dist/kernel/reducer/audit.js +103 -0
- package/dist/kernel/reducer/cli.js +489 -0
- package/dist/kernel/reducer/current-truth.js +383 -0
- package/dist/kernel/reducer/erasure-guard.js +16 -0
- package/dist/kernel/reducer/erasure.js +683 -0
- package/dist/kernel/reducer/lock.js +137 -0
- package/dist/kernel/reducer/patch.js +320 -0
- package/dist/kernel/reducer/semantic-batch-ownership.js +27 -0
- package/dist/kernel/reducer/semantic-graph-ownership.js +41 -0
- package/dist/kernel/reducer/shared-claims.js +124 -0
- package/dist/kernel/routing/eligibility.js +63 -0
- package/dist/kernel/routing/rank.js +14 -0
- package/dist/kernel/routing/resolve.js +89 -0
- package/dist/kernel/routing/signals.js +27 -0
- package/dist/kernel/routing/types.js +3 -0
- package/dist/kernel/schema/domain-authority.js +3 -0
- package/dist/kernel/schema/evidence-grammar.js +104 -0
- package/dist/kernel/schema/evidence-schema-version.js +64 -0
- package/dist/kernel/schema/index.js +283 -0
- package/dist/kernel/schema/types.js +91 -0
- package/dist/kernel/services/business.js +307 -0
- package/dist/kernel/services/installed-composition.js +148 -0
- package/dist/kernel/services/lifecycle.js +242 -0
- package/dist/kernel/services/plan-projection.js +211 -0
- package/dist/kernel/services/research-decision.js +209 -0
- package/dist/kernel/services/research.js +99 -0
- package/dist/kernel/services/source-projection.js +364 -0
- package/dist/kernel/session/app-review-ingress.js +230 -0
- package/dist/kernel/session/approve.js +364 -0
- package/dist/kernel/session/attempt-failure.js +108 -0
- package/dist/kernel/session/bootstrap.js +480 -0
- package/dist/kernel/session/brief.js +69 -0
- package/dist/kernel/session/catalog-contract.js +262 -0
- package/dist/kernel/session/check.js +184 -0
- package/dist/kernel/session/deterministic-gates.js +60 -0
- package/dist/kernel/session/digest.js +280 -0
- package/dist/kernel/session/doctor-host.js +187 -0
- package/dist/kernel/session/doctor.js +275 -0
- package/dist/kernel/session/executor.js +803 -0
- package/dist/kernel/session/firstparty-worker-host.js +30 -0
- package/dist/kernel/session/founder-brief.js +106 -0
- package/dist/kernel/session/founder-gate.js +133 -0
- package/dist/kernel/session/founder-key.js +118 -0
- package/dist/kernel/session/initialization-guard.js +16 -0
- package/dist/kernel/session/initialize.js +205 -0
- package/dist/kernel/session/input-inventory.js +207 -0
- package/dist/kernel/session/inspect.js +237 -0
- package/dist/kernel/session/ios-proof-receipt.js +232 -0
- package/dist/kernel/session/market-experiment.js +77 -0
- package/dist/kernel/session/new.js +177 -0
- package/dist/kernel/session/onboard.js +448 -0
- package/dist/kernel/session/operate-bind.js +52 -0
- package/dist/kernel/session/operate.js +211 -0
- package/dist/kernel/session/operating-service.js +431 -0
- package/dist/kernel/session/operating-transport.js +102 -0
- package/dist/kernel/session/operating-types.js +4 -0
- package/dist/kernel/session/operation-routes.js +569 -0
- package/dist/kernel/session/plan.js +473 -0
- package/dist/kernel/session/planning-context.js +92 -0
- package/dist/kernel/session/planning-limits.js +2 -0
- package/dist/kernel/session/proof.js +258 -0
- package/dist/kernel/session/reducer-cli.js +23 -0
- package/dist/kernel/session/research-observations.js +58 -0
- package/dist/kernel/session/research-proof-projection.js +62 -0
- package/dist/kernel/session/route-scoring.js +537 -0
- package/dist/kernel/session/route-utterance.js +321 -0
- package/dist/kernel/session/run.js +2042 -0
- package/dist/kernel/session/runtime-write-audit.js +47 -0
- package/dist/kernel/session/scope.js +75 -0
- package/dist/kernel/session/semantic-batch.js +535 -0
- package/dist/kernel/session/setup.js +126 -0
- package/dist/kernel/session/status.js +320 -0
- package/dist/kernel/session/stepper.js +188 -0
- package/dist/kernel/session/update.js +95 -0
- package/dist/kernel/session/verify.js +122 -0
- package/dist/kernel/session/worker-prompt.js +477 -0
- package/dist/kernel/session/workspace-revision.js +58 -0
- package/dist/kernel/session/workspaces.js +68 -0
- package/dist/kernel/work-orders/instantiate.js +51 -0
- package/dist/kernel/work-orders/lifecycle.js +156 -0
- package/dist/kernel/work-orders/outcomes.js +107 -0
- package/dist/kernel/work-orders/types.js +1 -0
- package/dist/tooling/browser-proof.js +1128 -0
- package/dist/tooling/calibrate-utterance-router.js +278 -0
- package/dist/tooling/catalog-scaffold.js +182 -0
- package/dist/tooling/export-task-skill.js +181 -0
- package/dist/tooling/grade-design-surface.js +341 -0
- package/dist/tooling/grade-screenshots.js +462 -0
- package/dist/tooling/knowledge.js +208 -0
- package/dist/tooling/lib/app-copy-rules.js +369 -0
- package/dist/tooling/lib/artifact-pages.js +136 -0
- package/dist/tooling/lib/audit-plan.js +382 -0
- package/dist/tooling/lib/canonical-json.js +26 -0
- package/dist/tooling/lib/cli-entrypoint.js +13 -0
- package/dist/tooling/lib/content-assets.js +246 -0
- package/dist/tooling/lib/design-exploration.js +165 -0
- package/dist/tooling/lib/design-md.js +381 -0
- package/dist/tooling/lib/design-state.js +278 -0
- package/dist/tooling/lib/design-taste-rubric.js +326 -0
- package/dist/tooling/lib/founder-copy.js +522 -0
- package/dist/tooling/lib/git-root.js +11 -0
- package/dist/tooling/lib/grading.js +43 -0
- package/dist/tooling/lib/html.js +31 -0
- package/dist/tooling/lib/knowledge-freshness-pin.js +69 -0
- package/dist/tooling/lib/launch-state.js +794 -0
- package/dist/tooling/lib/markdown-lite.js +294 -0
- package/dist/tooling/lib/no-slop-rules.js +243 -0
- package/dist/tooling/lib/packed-check.js +60 -0
- package/dist/tooling/lib/posthog-retention.js +96 -0
- package/dist/tooling/lib/render-artifact-page.js +312 -0
- package/dist/tooling/lib/runtime-sync-lib.js +122 -0
- package/dist/tooling/lib/script-paths.js +117 -0
- package/dist/tooling/lib/shard-pool.js +99 -0
- package/dist/tooling/lib/skill-root.js +31 -0
- package/dist/tooling/lib/source-freshness-state.js +31 -0
- package/dist/tooling/lib/source-http.js +166 -0
- package/dist/tooling/lib/spawn.js +30 -0
- package/dist/tooling/lib/tsx-bin.js +64 -0
- package/dist/tooling/lib/tsx-launcher.mjs +57 -0
- package/dist/tooling/print-hosted-version.js +46 -0
- package/dist/tooling/probe-eas.js +91 -0
- package/dist/tooling/probe-posthog.js +263 -0
- package/dist/tooling/probe-revenuecat-cli.js +399 -0
- package/dist/tooling/probe-revenuecat.js +234 -0
- package/dist/tooling/promote-design-tokens.js +215 -0
- package/dist/tooling/provision-posthog-platform.js +126 -0
- package/dist/tooling/prune-posthog-persons.js +270 -0
- package/dist/tooling/render-artifact-pages.js +70 -0
- package/dist/tooling/render-credits.js +269 -0
- package/dist/tooling/render-design-room.js +451 -0
- package/dist/tooling/render-hosted-bundle.js +186 -0
- package/dist/tooling/render-product.js +102 -0
- package/dist/tooling/render-public-api.js +95 -0
- package/dist/tooling/render-task-skills.js +71 -0
- package/dist/tooling/report-research-evidence-failures.js +135 -0
- package/dist/tooling/run-audit.js +332 -0
- package/dist/tooling/runtime-sync.js +392 -0
- package/dist/tooling/seed-design-brief.js +65 -0
- package/dist/tooling/test-public-api.js +37 -0
- package/entrypoints/cli/b2c.mjs +51 -0
- package/entrypoints/cli/business.ts +255 -0
- package/entrypoints/cli/contribute.ts +273 -0
- package/entrypoints/cli/help.d.mts +23 -0
- package/entrypoints/cli/help.mjs +262 -0
- package/entrypoints/mcp/b2c-app-builder-mcp.mjs +12 -0
- package/entrypoints/mcp/business.ts +22 -0
- package/entrypoints/mcp/contribute.ts +42 -0
- package/entrypoints/mcp/run-process.ts +59 -0
- package/entrypoints/mcp/server.ts +808 -0
- package/examples/extensions/layers-growth/LICENSE-layers-mcp.txt +21 -0
- package/examples/extensions/layers-growth/README.md +39 -0
- package/examples/extensions/layers-growth/draft-input.json +31 -0
- package/examples/extensions/layers-growth/evidence.json +17 -0
- package/examples/extensions/layers-growth/extension.yaml +200 -0
- package/examples/extensions/layers-growth/integration.md +122 -0
- package/examples/extensions/layers-growth/output.json +23 -0
- package/examples/extensions/layers-growth/pack.yaml +58 -0
- package/examples/extensions/layers-growth/read-input.json +11 -0
- package/examples/extensions/postiz-social/README.md +11 -0
- package/examples/extensions/postiz-social/extension.yaml +178 -0
- package/examples/extensions/postiz-social/integration.md +24 -0
- package/examples/extensions/postiz-social/schemas/post.evidence.json +13 -0
- package/examples/extensions/postiz-social/schemas/post.input.json +13 -0
- package/examples/extensions/postiz-social/schemas/post.output.json +11 -0
- package/examples/extensions/store-screenshot-compose/README.md +108 -0
- package/examples/extensions/store-screenshot-compose/compose.mjs +683 -0
- package/examples/extensions/store-screenshot-compose/compositor.md +51 -0
- package/examples/extensions/store-screenshot-compose/copy.sample.json +28 -0
- package/examples/extensions/store-screenshot-compose/extension.yaml +212 -0
- package/examples/extensions/store-screenshot-compose/pack.yaml +60 -0
- package/examples/extensions/store-screenshot-compose/schemas/compose-layout.input.json +17 -0
- package/examples/extensions/store-screenshot-compose/schemas/compose-layout.output.json +32 -0
- package/examples/extensions/store-screenshot-compose/schemas/export-localized.input.json +28 -0
- package/examples/extensions/store-screenshot-compose/schemas/export-localized.output.json +29 -0
- package/examples/extensions/store-screenshot-compose/schemas/provenance.evidence.json +80 -0
- package/examples/extensions/store-screenshot-compose/schemas/validate-deliverables.evidence.json +41 -0
- package/examples/extensions/store-screenshot-compose/schemas/validate-deliverables.input.json +12 -0
- package/examples/extensions/store-screenshot-compose/schemas/validate-deliverables.output.json +56 -0
- package/examples/extensions/store-screenshot-compose/templates/device-well.svg.tmpl +8 -0
- package/examples/extensions/store-screenshot-compose/wells.json +38 -0
- package/examples/extensions/superwall-ios/README.md +47 -0
- package/examples/extensions/superwall-ios/dependency-checksums.json +6 -0
- package/examples/extensions/superwall-ios/evidence.json +19 -0
- package/examples/extensions/superwall-ios/extension.yaml +174 -0
- package/examples/extensions/superwall-ios/input.json +15 -0
- package/examples/extensions/superwall-ios/integration.md +9 -0
- package/examples/extensions/superwall-ios/local-proof.json +44 -0
- package/examples/extensions/superwall-ios/native/Package.resolved +32 -0
- package/examples/extensions/superwall-ios/native/Package.swift +20 -0
- package/examples/extensions/superwall-ios/native/Sources/MonetizationCore/EntitlementState.swift +54 -0
- package/examples/extensions/superwall-ios/native/Sources/MonetizationNative/RevenueCatController.swift +129 -0
- package/examples/extensions/superwall-ios/native/Tests/MonetizationCoreTests/EntitlementStateTests.swift +46 -0
- package/examples/extensions/superwall-ios/output.json +16 -0
- package/examples/extensions/superwall-ios/pack.yaml +56 -0
- package/examples/extensions/support-case/README.md +7 -0
- package/examples/extensions/support-case/evidence.json +21 -0
- package/examples/extensions/support-case/extension.yaml +83 -0
- package/examples/extensions/support-case/input.json +16 -0
- package/examples/extensions/support-case/output.json +18 -0
- package/examples/extensions/support-case/pack.yaml +38 -0
- package/examples/extensions/support-case/support.md +3 -0
- package/examples/workspace/README.md +3 -0
- package/examples/workspace/business/DESIGN.md +338 -0
- package/examples/workspace/business/PRODUCT.md +91 -0
- package/examples/workspace/business/README.md +20 -0
- package/examples/workspace/business/analytics/ANALYTICS.md +186 -0
- package/examples/workspace/business/analytics/README.md +3 -0
- package/examples/workspace/business/analytics/analytics-plan.html +14 -0
- package/examples/workspace/business/analytics/posthog-proof.example.json +11 -0
- package/examples/workspace/business/design/README.md +12 -0
- package/examples/workspace/business/design/design-room.html +219 -0
- package/examples/workspace/business/design/motion-catalog/DemoBloom.swift +208 -0
- package/examples/workspace/business/design/motion-catalog/DemoCardReveal.swift +312 -0
- package/examples/workspace/business/design/motion-catalog/DemoExtrude.swift +255 -0
- package/examples/workspace/business/design/motion-catalog/DemoGesture.swift +315 -0
- package/examples/workspace/business/design/motion-catalog/DemoGrid.swift +215 -0
- package/examples/workspace/business/design/motion-catalog/DemoMascot.swift +535 -0
- package/examples/workspace/business/design/motion-catalog/DemoMeter.swift +335 -0
- package/examples/workspace/business/design/motion-catalog/DemoScratch.swift +357 -0
- package/examples/workspace/business/design/motion-catalog/DemoScrub.swift +267 -0
- package/examples/workspace/business/design/motion-catalog/DemoShiny.swift +325 -0
- package/examples/workspace/business/design/motion-catalog/DemoSphereCloud.swift +337 -0
- package/examples/workspace/business/design/motion-catalog/DemoTreasure.swift +484 -0
- package/examples/workspace/business/design/motion-catalog/MotionLabControls.swift +48 -0
- package/examples/workspace/business/design/motion-catalog/MotionLabIndex.swift +120 -0
- package/examples/workspace/business/design/motion-catalog/MotionLabTheme.swift +54 -0
- package/examples/workspace/business/design/motion-catalog/README.md +74 -0
- package/examples/workspace/business/design/motion-catalog/TokenSpring.swift +96 -0
- package/examples/workspace/business/design/motion-catalog/motion-tokens.ts +109 -0
- package/examples/workspace/business/design/system/DesignTokens.swift +57 -0
- package/examples/workspace/business/design/system/PremiumCraft.swift +352 -0
- package/examples/workspace/business/design/system/design-tokens.ts +84 -0
- package/examples/workspace/business/design/system/design_tokens.dart +14 -0
- package/examples/workspace/business/design/system/tokens.css +45 -0
- package/examples/workspace/business/design/system/tokens.json +313 -0
- package/examples/workspace/business/engineering/ACCESSIBILITY_READINESS.md +10 -0
- package/examples/workspace/business/engineering/APP_QUALITY.md +23 -0
- package/examples/workspace/business/engineering/ENGINEERING_PLAN.md +13 -0
- package/examples/workspace/business/engineering/PRODUCTION_READINESS.md +91 -0
- package/examples/workspace/business/engineering/README.md +3 -0
- package/examples/workspace/business/engineering/TECH_SPEC.md +57 -0
- package/examples/workspace/business/engineering/app-agent-roster/APP_AGENTS.md +88 -0
- package/examples/workspace/business/engineering/app-agent-roster/agents/accessibility-device-qa.md +36 -0
- package/examples/workspace/business/engineering/app-agent-roster/agents/backend-infrastructure-engineer.md +36 -0
- package/examples/workspace/business/engineering/app-agent-roster/agents/copy-specialist.md +36 -0
- package/examples/workspace/business/engineering/app-agent-roster/agents/customer-success.md +54 -0
- package/examples/workspace/business/engineering/app-agent-roster/agents/design-guru.md +56 -0
- package/examples/workspace/business/engineering/app-agent-roster/agents/engineering-leader.md +60 -0
- package/examples/workspace/business/engineering/app-agent-roster/agents/launch-surface-producer.md +118 -0
- package/examples/workspace/business/engineering/app-agent-roster/agents/marketing-guru.md +59 -0
- package/examples/workspace/business/engineering/app-agent-roster/agents/mobile-engineer.md +36 -0
- package/examples/workspace/business/engineering/app-agent-roster/agents/operator-readiness.md +61 -0
- package/examples/workspace/business/engineering/app-agent-roster/agents/orchestrator.md +56 -0
- package/examples/workspace/business/engineering/app-agent-roster/agents/product-leader.md +52 -0
- package/examples/workspace/business/engineering/app-agent-roster/agents/research-strategist.md +36 -0
- package/examples/workspace/business/engineering/app-agent-roster/agents/security-architect.md +63 -0
- package/examples/workspace/business/growth/DEMO_VIDEO.md +44 -0
- package/examples/workspace/business/growth/EMAIL_OPS.md +109 -0
- package/examples/workspace/business/growth/FASTLANE_OPS.md +5 -0
- package/examples/workspace/business/growth/LAUNCH_NARRATIVE.md +241 -0
- package/examples/workspace/business/growth/PAID_UA.md +142 -0
- package/examples/workspace/business/growth/README.md +3 -0
- package/examples/workspace/business/growth/UGC_PLAYBOOK.md +21 -0
- package/examples/workspace/business/growth/VIRAL_GROWTH.md +130 -0
- package/examples/workspace/business/growth/content-assets/CONTENT_ASSETS.md +127 -0
- package/examples/workspace/business/growth/content-assets/content-assets.html +97 -0
- package/examples/workspace/business/growth/content-assets/manifest.json +73 -0
- package/examples/workspace/business/growth/content-assets/remotion-README.md +26 -0
- package/examples/workspace/business/growth/content-intelligence.csv +1 -0
- package/examples/workspace/business/growth/format-lab.csv +2 -0
- package/examples/workspace/business/growth/landing/README.md +81 -0
- package/examples/workspace/business/growth/landing/lib/motion-tokens.ts +103 -0
- package/examples/workspace/business/growth/landing/lib/scene-progress.ts +286 -0
- package/examples/workspace/business/growth/landing/lib/scroll-scene-controller.ts +464 -0
- package/examples/workspace/business/growth/landing/motion.css +405 -0
- package/examples/workspace/business/growth/landing/scrollytelling.portable.example.html +156 -0
- package/examples/workspace/business/growth/landing/sections/Bento.tsx +51 -0
- package/examples/workspace/business/growth/landing/sections/Cta.tsx +48 -0
- package/examples/workspace/business/growth/landing/sections/Hero.tsx +62 -0
- package/examples/workspace/business/growth/landing/sections/Marquee.tsx +34 -0
- package/examples/workspace/business/growth/landing/sections/Pricing.tsx +73 -0
- package/examples/workspace/business/growth/landing/sections/Scrollytelling.tsx +193 -0
- package/examples/workspace/business/growth/landing/sections/Stats.tsx +74 -0
- package/examples/workspace/business/growth/landing/sections/Testimonials.tsx +61 -0
- package/examples/workspace/business/growth/landing/surface-contract.example.json +790 -0
- package/examples/workspace/business/growth/paid-ua-report.csv +2 -0
- package/examples/workspace/business/growth/resend/email-templates.ts +608 -0
- package/examples/workspace/business/operations/AGENT_OPERATIONS.md +56 -0
- package/examples/workspace/business/operations/BUSINESS_ACCESS.md +114 -0
- package/examples/workspace/business/operations/FAILURE_CARDS.md +21 -0
- package/examples/workspace/business/operations/LAUNCH_RETRO.md +53 -0
- package/examples/workspace/business/operations/METRIC_CONTRACTS.md +48 -0
- package/examples/workspace/business/operations/ORCHESTRATION.md +142 -0
- package/examples/workspace/business/operations/POST_LAUNCH_OPS.md +84 -0
- package/examples/workspace/business/operations/PROVIDER_PROOF.md +20 -0
- package/examples/workspace/business/operations/README.md +3 -0
- package/examples/workspace/business/operations/agent-operations.json +130 -0
- package/examples/workspace/business/operations/agent-operations.schema.json +274 -0
- package/examples/workspace/business/operations/business-access.json +418 -0
- package/examples/workspace/business/operations/business-access.schema.json +285 -0
- package/examples/workspace/business/operations/metric-contracts.json +346 -0
- package/examples/workspace/business/operations/metric-contracts.schema.json +255 -0
- package/examples/workspace/business/operations/orchestration.html +326 -0
- package/examples/workspace/business/product/ONBOARDING.md +306 -0
- package/examples/workspace/business/product/README.md +8 -0
- package/examples/workspace/business/product/copy/COPY_BRIEF.md +64 -0
- package/examples/workspace/business/product/copy/COPY_DECK.md +84 -0
- package/examples/workspace/business/product/experience/11-star-experience/11-star-experience.html +326 -0
- package/examples/workspace/business/product/experience/11-star-experience/11_STAR_EXPERIENCE.md +93 -0
- package/examples/workspace/business/product/experience/emotional-design/EMOTIONAL_AUDIT.md +608 -0
- package/examples/workspace/business/product/experience/emotional-design/EMOTIONAL_DESIGN.md +355 -0
- package/examples/workspace/business/product/experience/emotional-design/emotional-design.html +737 -0
- package/examples/workspace/business/product/experience/ux-patterns/UX_PATTERNS.md +144 -0
- package/examples/workspace/business/product/experience/ux-patterns/ux-patterns.html +102 -0
- package/examples/workspace/business/product/onboarding.html +58 -0
- package/examples/workspace/business/product.yaml +125 -0
- package/examples/workspace/business/revenue/README.md +3 -0
- package/examples/workspace/business/revenue/REVENUE_OPS.md +210 -0
- package/examples/workspace/business/revenue/revenuecat-proof.example.json +16 -0
- package/examples/workspace/business/revenue/revenuecat-proof.md +70 -0
- package/examples/workspace/business/state/LAUNCH_TRACE.md +29 -0
- package/examples/workspace/business/state/README.md +9 -0
- package/examples/workspace/business/state/business-state.json +520 -0
- package/examples/workspace/business/store/APPLE_APP_STORE_REQUIREMENTS.md +84 -0
- package/examples/workspace/business/store/APPLE_SIGNING.md +103 -0
- package/examples/workspace/business/store/APP_REVIEW.md +10 -0
- package/examples/workspace/business/store/GOOGLE_PLAY_RELEASE.md +71 -0
- package/examples/workspace/business/store/MARKETPLACE_COMPLIANCE.md +8 -0
- package/examples/workspace/business/store/README.md +3 -0
- package/examples/workspace/business/store/STORE_CONSOLE.md +62 -0
- package/examples/workspace/business/store/app-store-listing/APP_STORE_LISTING.md +160 -0
- package/examples/workspace/business/store/app-store-listing/SCREENSHOTS.md +246 -0
- package/examples/workspace/business/store/app-store-listing/SCREENSHOT_RUBRIC.md +202 -0
- package/examples/workspace/business/store/app-store-listing/app-privacy-questionnaire.html +156 -0
- package/examples/workspace/business/store/app-store-listing/app-store-listing.html +154 -0
- package/examples/workspace/business/store/app-store-listing/screenshot-rubric-scores.example.json +117 -0
- package/examples/workspace/business/store/store-console.html +271 -0
- package/examples/workspace/business/strategy/BRAND.md +48 -0
- package/examples/workspace/business/strategy/OFFER_TEST.md +43 -0
- package/examples/workspace/business/strategy/PORTFOLIO_REGISTRY.md +34 -0
- package/examples/workspace/business/strategy/README.md +3 -0
- package/examples/workspace/business/strategy/RESEARCH.md +87 -0
- package/examples/workspace/business/strategy/SIGNAL_CORPUS.md +34 -0
- package/examples/workspace/business/strategy/TOOL_DECISIONS.md +30 -0
- package/examples/workspace/business/strategy/localization-market-research/LOCALIZATION_MARKET_RESEARCH.md +93 -0
- package/examples/workspace/business/strategy/localization-market-research/localization-market-research.html +62 -0
- package/examples/workspace/business/studio/seed/business.json +57 -0
- package/examples/workspace/business/trust/AI_SAFETY.md +10 -0
- package/examples/workspace/business/trust/COMMUNITY_SAFETY.md +10 -0
- package/examples/workspace/business/trust/PRIVACY.md +31 -0
- package/examples/workspace/business/trust/README.md +3 -0
- package/examples/workspace/business/trust/SECURITY.md +145 -0
- package/examples/workspace/business/trust/TERMS.md +21 -0
- package/examples/workspace/business/trust/secrets/.env.example +2 -0
- package/examples/workspace/business/trust/secrets/SECRETS.md +77 -0
- package/examples/workspace/business/trust/secrets/doppler.yaml +3 -0
- package/examples/workspace/business/trust/security-review.html +373 -0
- package/examples/workspace/business/ugc/script-bank.md +9 -0
- package/kernel/autonomy/budget.ts +130 -0
- package/kernel/autonomy/evaluator.ts +136 -0
- package/kernel/autonomy/grants.ts +124 -0
- package/kernel/autonomy/killswitch.ts +27 -0
- package/kernel/autonomy/prerequisites.ts +94 -0
- package/kernel/autonomy/probes/budget.ts +55 -0
- package/kernel/autonomy/probes/doppler.ts +66 -0
- package/kernel/autonomy/standing-approvals.ts +336 -0
- package/kernel/autonomy/waivers.ts +129 -0
- package/kernel/composition/activation.ts +471 -0
- package/kernel/composition/compile-bindings.ts +297 -0
- package/kernel/composition/notices.ts +226 -0
- package/kernel/composition/onboarding-selection.ts +210 -0
- package/kernel/composition/providers.ts +43 -0
- package/kernel/composition/resolve.ts +252 -0
- package/kernel/composition/resources.ts +298 -0
- package/kernel/composition/semantic-plan-lower.ts +831 -0
- package/kernel/composition/worker-context.ts +63 -0
- package/kernel/context/budget.ts +16 -0
- package/kernel/context/compile.ts +66 -0
- package/kernel/context/receipt.ts +34 -0
- package/kernel/context/selectors.ts +30 -0
- package/kernel/contribution/accepted-upstreams.ts +83 -0
- package/kernel/contribution/adoption-map.ts +153 -0
- package/kernel/contribution/check.ts +197 -0
- package/kernel/contribution/evaluate.ts +275 -0
- package/kernel/contribution/existing-owners.ts +115 -0
- package/kernel/contribution/github-metadata.ts +241 -0
- package/kernel/contribution/host-observe.ts +146 -0
- package/kernel/contribution/intake.ts +611 -0
- package/kernel/contribution/manifest-io.ts +277 -0
- package/kernel/contribution/plan.ts +422 -0
- package/kernel/contribution/preview.ts +217 -0
- package/kernel/contribution/provider-capability-delta.ts +178 -0
- package/kernel/contribution/service.ts +291 -0
- package/kernel/contribution/types.ts +180 -0
- package/kernel/contribution/untrusted.ts +198 -0
- package/kernel/contribution/upstream-coverage.ts +116 -0
- package/kernel/contribution/upstreams-load.ts +184 -0
- package/kernel/contribution/upstreams.ts +1206 -0
- package/kernel/engine/artifact-fingerprint.ts +25 -0
- package/kernel/engine/compile.ts +419 -0
- package/kernel/engine/design-taste-authority.ts +264 -0
- package/kernel/engine/dispatch.ts +96 -0
- package/kernel/engine/founder-decision-receipt.ts +580 -0
- package/kernel/engine/founder-trust-store.ts +771 -0
- package/kernel/engine/frontier.ts +157 -0
- package/kernel/engine/node-brief.ts +285 -0
- package/kernel/engine/proof-rung.ts +95 -0
- package/kernel/engine/review-evidence.ts +343 -0
- package/kernel/engine/review-facet.ts +9 -0
- package/kernel/engine/runstate.ts +1113 -0
- package/kernel/engine/source-fingerprint.ts +100 -0
- package/kernel/engine/verification-policy.ts +6 -0
- package/kernel/engine/verification.ts +154 -0
- package/kernel/knowledge-service/journey.ts +50 -0
- package/kernel/knowledge-service/projection-helpers.ts +306 -0
- package/kernel/knowledge-service/sections.ts +68 -0
- package/kernel/knowledge-service/semantic-graph-views.ts +727 -0
- package/kernel/knowledge-service/service.ts +835 -0
- package/kernel/knowledge-service/tools.ts +118 -0
- package/kernel/knowledge-service/types.ts +236 -0
- package/kernel/lib/atomic-file.ts +34 -0
- package/kernel/lib/bounded-file.ts +24 -0
- package/kernel/lib/cli.ts +44 -0
- package/kernel/lib/empty-equivalent-evidence.ts +35 -0
- package/kernel/lib/later-guidance.ts +128 -0
- package/kernel/lib/required-table-section.ts +679 -0
- package/kernel/operating-model/agreements.ts +29 -0
- package/kernel/operating-model/authorize.ts +117 -0
- package/kernel/operating-model/erasure-metadata.ts +19 -0
- package/kernel/operating-model/events.ts +142 -0
- package/kernel/operating-model/mandates.ts +81 -0
- package/kernel/operating-model/market-experiment.ts +354 -0
- package/kernel/operating-model/measurement.ts +542 -0
- package/kernel/operating-model/parties.ts +23 -0
- package/kernel/operating-model/projections.ts +111 -0
- package/kernel/operating-model/types.ts +306 -0
- package/kernel/operating-model/validate.ts +388 -0
- package/kernel/reducer/audit.ts +146 -0
- package/kernel/reducer/cli.ts +552 -0
- package/kernel/reducer/current-truth.ts +432 -0
- package/kernel/reducer/erasure-guard.ts +17 -0
- package/kernel/reducer/erasure.ts +741 -0
- package/kernel/reducer/lock.ts +169 -0
- package/kernel/reducer/patch.ts +395 -0
- package/kernel/reducer/semantic-batch-ownership.ts +36 -0
- package/kernel/reducer/semantic-graph-ownership.ts +54 -0
- package/kernel/reducer/shared-claims.ts +133 -0
- package/kernel/routing/eligibility.ts +71 -0
- package/kernel/routing/rank.ts +21 -0
- package/kernel/routing/resolve.ts +97 -0
- package/kernel/routing/signals.ts +28 -0
- package/kernel/routing/types.ts +84 -0
- package/kernel/schema/app-review-webhook-envelope.schema.json +39 -0
- package/kernel/schema/app-review.schema.json +1504 -0
- package/kernel/schema/budget-ledger.schema.json +84 -0
- package/kernel/schema/business-state.schema.json +909 -0
- package/kernel/schema/checkpoint.schema.json +17 -0
- package/kernel/schema/control.schema.json +40 -0
- package/kernel/schema/current-truth.schema.json +56 -0
- package/kernel/schema/domain-authority.ts +22 -0
- package/kernel/schema/evidence-grammar.ts +132 -0
- package/kernel/schema/evidence-schema-version.json +5 -0
- package/kernel/schema/evidence-schema-version.ts +82 -0
- package/kernel/schema/grants.schema.json +102 -0
- package/kernel/schema/index.ts +518 -0
- package/kernel/schema/market-experiment.schema.json +212 -0
- package/kernel/schema/metric-contracts.schema.json +601 -0
- package/kernel/schema/offer-test.schema.json +88 -0
- package/kernel/schema/operation-envelope.schema.json +31 -0
- package/kernel/schema/research-evidence.schema.json +144 -0
- package/kernel/schema/run-state.schema.json +430 -0
- package/kernel/schema/signal-corpus.schema.json +94 -0
- package/kernel/schema/status.schema.json +25 -0
- package/kernel/schema/types.ts +701 -0
- package/kernel/schema/waivers.schema.json +97 -0
- package/kernel/services/business.ts +431 -0
- package/kernel/services/installed-composition.ts +146 -0
- package/kernel/services/lifecycle.ts +262 -0
- package/kernel/services/plan-projection.ts +230 -0
- package/kernel/services/research-decision.ts +234 -0
- package/kernel/services/research.ts +102 -0
- package/kernel/services/source-projection.ts +503 -0
- package/kernel/session/app-review-ingress.ts +254 -0
- package/kernel/session/approve.ts +411 -0
- package/kernel/session/attempt-failure.ts +113 -0
- package/kernel/session/bootstrap.ts +497 -0
- package/kernel/session/brief.ts +94 -0
- package/kernel/session/catalog-contract.ts +293 -0
- package/kernel/session/check.ts +206 -0
- package/kernel/session/deterministic-gates.ts +76 -0
- package/kernel/session/digest.ts +405 -0
- package/kernel/session/doctor-host.ts +219 -0
- package/kernel/session/doctor.ts +387 -0
- package/kernel/session/executor.ts +934 -0
- package/kernel/session/firstparty-worker-host.ts +30 -0
- package/kernel/session/founder-brief.ts +110 -0
- package/kernel/session/founder-gate.ts +188 -0
- package/kernel/session/founder-key.ts +119 -0
- package/kernel/session/initialization-guard.ts +17 -0
- package/kernel/session/initialize.ts +209 -0
- package/kernel/session/input-inventory.ts +217 -0
- package/kernel/session/inspect.ts +304 -0
- package/kernel/session/ios-proof-receipt.ts +273 -0
- package/kernel/session/market-experiment.ts +81 -0
- package/kernel/session/new.ts +202 -0
- package/kernel/session/onboard.ts +551 -0
- package/kernel/session/operate-bind.ts +58 -0
- package/kernel/session/operate.ts +239 -0
- package/kernel/session/operating-service.ts +452 -0
- package/kernel/session/operating-transport.ts +125 -0
- package/kernel/session/operating-types.ts +107 -0
- package/kernel/session/operation-routes.ts +673 -0
- package/kernel/session/plan.ts +667 -0
- package/kernel/session/planning-context.ts +96 -0
- package/kernel/session/planning-limits.ts +2 -0
- package/kernel/session/proof.ts +302 -0
- package/kernel/session/reducer-cli.ts +30 -0
- package/kernel/session/research-observations.ts +59 -0
- package/kernel/session/research-proof-projection.ts +76 -0
- package/kernel/session/route-scoring.ts +560 -0
- package/kernel/session/route-utterance.ts +486 -0
- package/kernel/session/run.ts +2214 -0
- package/kernel/session/runtime-write-audit.ts +44 -0
- package/kernel/session/scope.ts +85 -0
- package/kernel/session/semantic-batch.ts +834 -0
- package/kernel/session/setup.ts +142 -0
- package/kernel/session/status.ts +397 -0
- package/kernel/session/stepper.ts +258 -0
- package/kernel/session/update.ts +106 -0
- package/kernel/session/verify.ts +135 -0
- package/kernel/session/worker-prompt.ts +572 -0
- package/kernel/session/workspace-revision.ts +59 -0
- package/kernel/session/workspaces.ts +73 -0
- package/kernel/work-orders/instantiate.ts +68 -0
- package/kernel/work-orders/lifecycle.ts +178 -0
- package/kernel/work-orders/outcomes.ts +161 -0
- package/kernel/work-orders/types.ts +64 -0
- package/knowledge/README.md +81 -0
- package/knowledge/data/analytics-attribution.md +317 -0
- package/knowledge/data/posthog-agent-tooling.md +101 -0
- package/knowledge/design/audience-derived-identity.md +55 -0
- package/knowledge/design/consumer-craft-benchmarks.md +72 -0
- package/knowledge/design/design-acceptance.md +199 -0
- package/knowledge/design/design-evidence-stack.md +130 -0
- package/knowledge/design/design-room.md +83 -0
- package/knowledge/design/design-visual-system.md +247 -0
- package/knowledge/design/design-worthiness.md +188 -0
- package/knowledge/design/editorial-scrollytelling.md +239 -0
- package/knowledge/design/landing-motion-craft.md +67 -0
- package/knowledge/design/mobile-flow-craft.md +177 -0
- package/knowledge/design/motion-craft-benchmarks.md +340 -0
- package/knowledge/design/premium-mobile-craft.md +137 -0
- package/knowledge/design/quality-lens.md +100 -0
- package/knowledge/design/refero-ux-patterns.md +131 -0
- package/knowledge/design/remotion-content-assets.md +370 -0
- package/knowledge/design/surfaces-b2c.md +84 -0
- package/knowledge/design/vibecoded-tells.md +129 -0
- package/knowledge/engineering/accessibility-readiness.md +24 -0
- package/knowledge/engineering/app-agent-roster.md +120 -0
- package/knowledge/engineering/app-quality.md +19 -0
- package/knowledge/engineering/backend-data-contract.md +187 -0
- package/knowledge/engineering/engineering-orchestration.md +365 -0
- package/knowledge/engineering/expo-compatibility.md +74 -0
- package/knowledge/engineering/expo-operations-map.md +84 -0
- package/knowledge/engineering/expo-stack-selection.md +75 -0
- package/knowledge/engineering/external-skill-packs.md +47 -0
- package/knowledge/engineering/mobai-toolbelt.md +389 -0
- package/knowledge/engineering/recommended-agent-skills.md +109 -0
- package/knowledge/engineering/technical-documentation-ste100.md +89 -0
- package/knowledge/engineering/xcodebuildmcp-testing.md +502 -0
- package/knowledge/experience/commitment-funnel.md +90 -0
- package/knowledge/experience/consumer-product-design-agency.md +268 -0
- package/knowledge/experience/eleven-star-experience.md +194 -0
- package/knowledge/experience/emotional-design-system.md +412 -0
- package/knowledge/experience/emotional-experience-design.md +359 -0
- package/knowledge/experience/emotional-experience-measurement.md +433 -0
- package/knowledge/experience/ethics-guardrail.md +460 -0
- package/knowledge/experience/experience-cards/commitment-card.md +36 -0
- package/knowledge/experience/experience-cards/endowed-progress-card.md +34 -0
- package/knowledge/experience/experience-cards/fresh-start-card.md +34 -0
- package/knowledge/experience/experience-cards/identity-and-self-expression-card.md +35 -0
- package/knowledge/experience/experience-cards/intent-mirroring-card.md +36 -0
- package/knowledge/experience/experience-cards/mastery-and-status-card.md +43 -0
- package/knowledge/experience/experience-cards/peak-end-card.md +44 -0
- package/knowledge/experience/experience-cards/perceived-effort-delay-card.md +37 -0
- package/knowledge/experience/experience-cards/reciprocity-card.md +38 -0
- package/knowledge/experience/experience-cards/recovery-and-trust-repair-card.md +40 -0
- package/knowledge/experience/experience-cards/streak-and-loss-aversion-card.md +37 -0
- package/knowledge/experience/experience-cards/variable-reward-card.md +42 -0
- package/knowledge/experience/experience-cards.md +172 -0
- package/knowledge/experience/onboarding-conversion.md +422 -0
- package/knowledge/experience/onboarding-foundations.md +264 -0
- package/knowledge/experience/paywall-goal-headline.md +99 -0
- package/knowledge/experience/push-notification-lifecycle.md +79 -0
- package/knowledge/growth/appsflyer-mmp.md +99 -0
- package/knowledge/growth/cro-landing.md +86 -0
- package/knowledge/growth/fastlane-growth-ops.md +321 -0
- package/knowledge/growth/geo-seo.md +163 -0
- package/knowledge/growth/hdyhau-blended-roas.md +75 -0
- package/knowledge/growth/influencer-sponsorship-engine.md +224 -0
- package/knowledge/growth/ios-consumer-playbook-intake.md +65 -0
- package/knowledge/growth/launch-narrative-cadence.md +340 -0
- package/knowledge/growth/non-competitor-angle-discovery.md +80 -0
- package/knowledge/growth/paid-user-acquisition.md +283 -0
- package/knowledge/growth/ugc-creator-engine.md +259 -0
- package/knowledge/growth/viral-growth-loops.md +174 -0
- package/knowledge/money/billing-health-and-reactivation.md +54 -0
- package/knowledge/money/offer-and-pricing-decisions.md +33 -0
- package/knowledge/money/paywall-pricing-and-experiments.md +97 -0
- package/knowledge/money/revenue-monetization.md +107 -0
- package/knowledge/money/revenuecat-agent-tooling.md +174 -0
- package/knowledge/money/revenuecat-and-store-products.md +115 -0
- package/knowledge/money/stripe-and-web-billing.md +83 -0
- package/knowledge/money/subscription-price-derivation.md +105 -0
- package/knowledge/operations/autonomy-onboarding.md +269 -0
- package/knowledge/operations/doppler-organization.md +73 -0
- package/knowledge/operations/founder-zero-operator.md +184 -0
- package/knowledge/operations/frontier-agent-operations.md +189 -0
- package/knowledge/operations/paid-tool-routing.md +172 -0
- package/knowledge/operations/post-launch-operations.md +261 -0
- package/knowledge/operations/provider-state-recipes.md +80 -0
- package/knowledge/operations/resend-email-ops.md +339 -0
- package/knowledge/operations/secrets-management.md +215 -0
- package/knowledge/orchestration/compound-engineering-routing.md +101 -0
- package/knowledge/orchestration/dynamic-workflows.md +198 -0
- package/knowledge/orchestration/full-launch-program.md +179 -0
- package/knowledge/orchestration/isolated-review.md +144 -0
- package/knowledge/orchestration/parallel-agent-orchestration.md +335 -0
- package/knowledge/orchestration/project-state.md +96 -0
- package/knowledge/process/artifact-contracts.md +1527 -0
- package/knowledge/process/cascade-edges.yaml +217 -0
- package/knowledge/process/change-cascade.md +102 -0
- package/knowledge/process/current-truth.md +45 -0
- package/knowledge/process/failure-cards.md +114 -0
- package/knowledge/process/flow-traceability.md +189 -0
- package/knowledge/process/launch-coverage.md +298 -0
- package/knowledge/process/launch-phases.md +838 -0
- package/knowledge/process/learning-capture.md +77 -0
- package/knowledge/process/learnings/audit-runs-from-repo-root.md +22 -0
- package/knowledge/process/provider-contracts.md +49 -0
- package/knowledge/process/provider-proof.md +37 -0
- package/knowledge/process/repository-profiles.md +60 -0
- package/knowledge/process/tool-recipes/device-capture-and-proof.md +100 -0
- package/knowledge/process/tool-recipes/engineering-and-agent-orchestration.md +89 -0
- package/knowledge/process/tool-recipes/funnel-domain-and-privacy.md +142 -0
- package/knowledge/process/tool-recipes/growth-and-store-routing.md +192 -0
- package/knowledge/process/tool-recipes/research-intelligence.md +258 -0
- package/knowledge/process/tool-recipes/revenue-email-analytics.md +101 -0
- package/knowledge/process/tool-recipes/secrets-and-environment.md +35 -0
- package/knowledge/process/tool-recipes/visual-and-motion-production.md +457 -0
- package/knowledge/process/tool-recipes.md +67 -0
- package/knowledge/product/ai-chat-companion.md +96 -0
- package/knowledge/product/core-loop-and-complete-scope.md +82 -0
- package/knowledge/product/habit-tracker.md +89 -0
- package/knowledge/product/photo-ai-media.md +96 -0
- package/knowledge/product/product-moat.md +64 -0
- package/knowledge/product/social-network.md +117 -0
- package/knowledge/research/distribution-first-niche.md +70 -0
- package/knowledge/research/distribution-offer-signal.md +190 -0
- package/knowledge/research/go-pivot-or-kill.md +120 -0
- package/knowledge/research/localization-market-research.md +145 -0
- package/knowledge/research/transformation-demo.md +70 -0
- package/knowledge/store/age-rating-questionnaire.md +75 -0
- package/knowledge/store/app-review-observe.md +314 -0
- package/knowledge/store/app-review-remediate.md +125 -0
- package/knowledge/store/app-review-resubmit.md +128 -0
- package/knowledge/store/app-store-connect-cli.md +347 -0
- package/knowledge/store/app-store-listing-prep.md +277 -0
- package/knowledge/store/apple-signing-release.md +551 -0
- package/knowledge/store/aso-apple-keyword-evidence.md +112 -0
- package/knowledge/store/aso-store-ops.md +316 -0
- package/knowledge/store/google-play-release.md +200 -0
- package/knowledge/store/marketplace-regional-compliance.md +21 -0
- package/knowledge/store/screenshot-toolchain.md +130 -0
- package/knowledge/store/store-console-workflow.md +760 -0
- package/knowledge/trust/community-safety.md +18 -0
- package/knowledge/trust/generative-ai-safety.md +27 -0
- package/knowledge/trust/paid-generative-ai-controls.md +85 -0
- package/knowledge/trust/privacy-terms.md +192 -0
- package/knowledge/trust/security-release-hardening.md +169 -0
- package/knowledge/words/consumer-copy-benchmarks.md +111 -0
- package/knowledge/words/conversion-copy.md +181 -0
- package/knowledge/words/no-slop-writing.md +173 -0
- package/package.json +290 -0
- package/skill-version.json +149 -0
- package/surfaces/starters/ai-chat-companion/README.md +41 -0
- package/surfaces/starters/ai-chat-companion/prompts/00-positioning-strategy.md +45 -0
- package/surfaces/starters/ai-chat-companion/prompts/01-database-schema.md +44 -0
- package/surfaces/starters/ai-chat-companion/prompts/02-auth-system.md +38 -0
- package/surfaces/starters/ai-chat-companion/prompts/03-chat-core-loop.md +42 -0
- package/surfaces/starters/ai-chat-companion/prompts/04-model-integration.md +45 -0
- package/surfaces/starters/ai-chat-companion/prompts/05-memory-personalization.md +38 -0
- package/surfaces/starters/ai-chat-companion/prompts/06-usage-limits-metering.md +36 -0
- package/surfaces/starters/ai-chat-companion/prompts/07-stripe-monetization.md +34 -0
- package/surfaces/starters/ai-chat-companion/prompts/08-safety-and-moderation.md +39 -0
- package/surfaces/starters/ai-chat-companion/prompts/variants/companion-character.md +40 -0
- package/surfaces/starters/ai-chat-companion/prompts/variants/voice-first.md +37 -0
- package/surfaces/starters/ai-chat-companion/starter/.env.example +18 -0
- package/surfaces/starters/ai-chat-companion/starter/.github/workflows/ci.yml +30 -0
- package/surfaces/starters/ai-chat-companion/starter/.gitignore.template +9 -0
- package/surfaces/starters/ai-chat-companion/starter/README.md +48 -0
- package/surfaces/starters/ai-chat-companion/starter/app/api/chat/route.ts +70 -0
- package/surfaces/starters/ai-chat-companion/starter/app/api/revenuecat/webhook/route.ts +21 -0
- package/surfaces/starters/ai-chat-companion/starter/app/api/stripe/checkout/route.ts +28 -0
- package/surfaces/starters/ai-chat-companion/starter/app/api/stripe/webhook/route.ts +34 -0
- package/surfaces/starters/ai-chat-companion/starter/app/auth/confirm/route.ts +22 -0
- package/surfaces/starters/ai-chat-companion/starter/app/chat/page.tsx +78 -0
- package/surfaces/starters/ai-chat-companion/starter/app/layout.tsx +20 -0
- package/surfaces/starters/ai-chat-companion/starter/app/login/page.tsx +47 -0
- package/surfaces/starters/ai-chat-companion/starter/app/page.tsx +17 -0
- package/surfaces/starters/ai-chat-companion/starter/components/analytics-provider.tsx +14 -0
- package/surfaces/starters/ai-chat-companion/starter/lib/analytics/events.ts +32 -0
- package/surfaces/starters/ai-chat-companion/starter/lib/analytics/posthog-client.ts +28 -0
- package/surfaces/starters/ai-chat-companion/starter/lib/billing/revenuecat.ts +27 -0
- package/surfaces/starters/ai-chat-companion/starter/lib/billing/stripe.ts +15 -0
- package/surfaces/starters/ai-chat-companion/starter/lib/strings.ts +32 -0
- package/surfaces/starters/ai-chat-companion/starter/lib/supabase/client.ts +7 -0
- package/surfaces/starters/ai-chat-companion/starter/lib/supabase/proxy.ts +29 -0
- package/surfaces/starters/ai-chat-companion/starter/lib/supabase/server.ts +23 -0
- package/surfaces/starters/ai-chat-companion/starter/next.config.ts +5 -0
- package/surfaces/starters/ai-chat-companion/starter/package-lock.json +1294 -0
- package/surfaces/starters/ai-chat-companion/starter/package.json +29 -0
- package/surfaces/starters/ai-chat-companion/starter/proxy.ts +12 -0
- package/surfaces/starters/ai-chat-companion/starter/supabase/migrations/0001_init.sql +78 -0
- package/surfaces/starters/ai-chat-companion/starter/supabase/tests/0001_rls.test.sql +75 -0
- package/surfaces/starters/ai-chat-companion/starter/tsconfig.json +41 -0
- package/surfaces/starters/habit-tracker/README.md +43 -0
- package/surfaces/starters/habit-tracker/prompts/00-positioning-strategy.md +47 -0
- package/surfaces/starters/habit-tracker/prompts/01-database-schema.md +54 -0
- package/surfaces/starters/habit-tracker/prompts/02-auth-system.md +42 -0
- package/surfaces/starters/habit-tracker/prompts/03-habit-core-loop.md +50 -0
- package/surfaces/starters/habit-tracker/prompts/04-reminders-and-streaks.md +58 -0
- package/surfaces/starters/habit-tracker/prompts/05-stats-and-insights.md +44 -0
- package/surfaces/starters/habit-tracker/prompts/06-paywall-and-monetization.md +50 -0
- package/surfaces/starters/habit-tracker/prompts/07-social-accountability.md +49 -0
- package/surfaces/starters/habit-tracker/prompts/variants/simple-counter-utility.md +43 -0
- package/surfaces/starters/habit-tracker/prompts/variants/wellness-coach.md +44 -0
- package/surfaces/starters/habit-tracker/starter/.env.example +14 -0
- package/surfaces/starters/habit-tracker/starter/.github/workflows/ci.yml +30 -0
- package/surfaces/starters/habit-tracker/starter/.gitignore.template +9 -0
- package/surfaces/starters/habit-tracker/starter/README.md +48 -0
- package/surfaces/starters/habit-tracker/starter/app/api/revenuecat/webhook/route.ts +21 -0
- package/surfaces/starters/habit-tracker/starter/app/api/stripe/checkout/route.ts +28 -0
- package/surfaces/starters/habit-tracker/starter/app/api/stripe/webhook/route.ts +34 -0
- package/surfaces/starters/habit-tracker/starter/app/auth/confirm/route.ts +22 -0
- package/surfaces/starters/habit-tracker/starter/app/layout.tsx +20 -0
- package/surfaces/starters/habit-tracker/starter/app/login/page.tsx +47 -0
- package/surfaces/starters/habit-tracker/starter/app/page.tsx +17 -0
- package/surfaces/starters/habit-tracker/starter/app/today/page.tsx +27 -0
- package/surfaces/starters/habit-tracker/starter/components/analytics-provider.tsx +14 -0
- package/surfaces/starters/habit-tracker/starter/lib/analytics/events.ts +29 -0
- package/surfaces/starters/habit-tracker/starter/lib/analytics/posthog-client.ts +28 -0
- package/surfaces/starters/habit-tracker/starter/lib/billing/revenuecat.ts +27 -0
- package/surfaces/starters/habit-tracker/starter/lib/billing/stripe.ts +15 -0
- package/surfaces/starters/habit-tracker/starter/lib/strings.ts +27 -0
- package/surfaces/starters/habit-tracker/starter/lib/supabase/client.ts +7 -0
- package/surfaces/starters/habit-tracker/starter/lib/supabase/proxy.ts +29 -0
- package/surfaces/starters/habit-tracker/starter/lib/supabase/server.ts +23 -0
- package/surfaces/starters/habit-tracker/starter/next.config.ts +5 -0
- package/surfaces/starters/habit-tracker/starter/package-lock.json +1222 -0
- package/surfaces/starters/habit-tracker/starter/package.json +28 -0
- package/surfaces/starters/habit-tracker/starter/proxy.ts +12 -0
- package/surfaces/starters/habit-tracker/starter/supabase/migrations/0001_init.sql +84 -0
- package/surfaces/starters/habit-tracker/starter/supabase/tests/0001_rls.test.sql +75 -0
- package/surfaces/starters/habit-tracker/starter/tsconfig.json +41 -0
- package/surfaces/starters/photo-ai-media/README.md +40 -0
- package/surfaces/starters/photo-ai-media/prompts/00-positioning-strategy.md +51 -0
- package/surfaces/starters/photo-ai-media/prompts/01-database-schema.md +55 -0
- package/surfaces/starters/photo-ai-media/prompts/02-auth-system.md +39 -0
- package/surfaces/starters/photo-ai-media/prompts/03-capture-and-library.md +42 -0
- package/surfaces/starters/photo-ai-media/prompts/04-ai-generation-pipeline.md +46 -0
- package/surfaces/starters/photo-ai-media/prompts/05-editing-and-presets.md +40 -0
- package/surfaces/starters/photo-ai-media/prompts/06-credits-and-monetization.md +47 -0
- package/surfaces/starters/photo-ai-media/prompts/07-sharing-and-virality.md +39 -0
- package/surfaces/starters/photo-ai-media/prompts/08-content-safety-and-rights.md +49 -0
- package/surfaces/starters/photo-ai-media/prompts/variants/avatar-headshot-studio.md +43 -0
- package/surfaces/starters/photo-ai-media/prompts/variants/photo-restoration.md +39 -0
- package/surfaces/starters/photo-ai-media/starter/.env.example +16 -0
- package/surfaces/starters/photo-ai-media/starter/.github/workflows/ci.yml +30 -0
- package/surfaces/starters/photo-ai-media/starter/.gitignore.template +9 -0
- package/surfaces/starters/photo-ai-media/starter/README.md +50 -0
- package/surfaces/starters/photo-ai-media/starter/app/api/generate/route.ts +47 -0
- package/surfaces/starters/photo-ai-media/starter/app/api/revenuecat/webhook/route.ts +21 -0
- package/surfaces/starters/photo-ai-media/starter/app/api/stripe/checkout/route.ts +28 -0
- package/surfaces/starters/photo-ai-media/starter/app/api/stripe/webhook/route.ts +34 -0
- package/surfaces/starters/photo-ai-media/starter/app/auth/confirm/route.ts +22 -0
- package/surfaces/starters/photo-ai-media/starter/app/layout.tsx +20 -0
- package/surfaces/starters/photo-ai-media/starter/app/library/page.tsx +29 -0
- package/surfaces/starters/photo-ai-media/starter/app/login/page.tsx +47 -0
- package/surfaces/starters/photo-ai-media/starter/app/page.tsx +17 -0
- package/surfaces/starters/photo-ai-media/starter/components/analytics-provider.tsx +14 -0
- package/surfaces/starters/photo-ai-media/starter/lib/analytics/events.ts +32 -0
- package/surfaces/starters/photo-ai-media/starter/lib/analytics/posthog-client.ts +28 -0
- package/surfaces/starters/photo-ai-media/starter/lib/billing/revenuecat.ts +27 -0
- package/surfaces/starters/photo-ai-media/starter/lib/billing/stripe.ts +15 -0
- package/surfaces/starters/photo-ai-media/starter/lib/strings.ts +27 -0
- package/surfaces/starters/photo-ai-media/starter/lib/supabase/client.ts +7 -0
- package/surfaces/starters/photo-ai-media/starter/lib/supabase/proxy.ts +29 -0
- package/surfaces/starters/photo-ai-media/starter/lib/supabase/server.ts +23 -0
- package/surfaces/starters/photo-ai-media/starter/next.config.ts +5 -0
- package/surfaces/starters/photo-ai-media/starter/package-lock.json +1222 -0
- package/surfaces/starters/photo-ai-media/starter/package.json +28 -0
- package/surfaces/starters/photo-ai-media/starter/proxy.ts +12 -0
- package/surfaces/starters/photo-ai-media/starter/supabase/migrations/0001_init.sql +74 -0
- package/surfaces/starters/photo-ai-media/starter/supabase/tests/0001_rls.test.sql +72 -0
- package/surfaces/starters/photo-ai-media/starter/tsconfig.json +41 -0
- package/surfaces/starters/social-network/README.md +41 -0
- package/surfaces/starters/social-network/prompts/00-niche-strategy.md +44 -0
- package/surfaces/starters/social-network/prompts/01-database-schema.md +37 -0
- package/surfaces/starters/social-network/prompts/02-auth-system.md +40 -0
- package/surfaces/starters/social-network/prompts/03-feed-and-posts.md +43 -0
- package/surfaces/starters/social-network/prompts/04-profiles-and-follow.md +41 -0
- package/surfaces/starters/social-network/prompts/05-search-and-discovery.md +36 -0
- package/surfaces/starters/social-network/prompts/06-direct-messages.md +32 -0
- package/surfaces/starters/social-network/prompts/07-stripe-monetization.md +41 -0
- package/surfaces/starters/social-network/prompts/08-invite-system.md +37 -0
- package/surfaces/starters/social-network/prompts/variants/image-first-instagram.md +34 -0
- package/surfaces/starters/social-network/prompts/variants/video-first-tiktok.md +40 -0
- package/surfaces/starters/social-network/starter/.env.example +14 -0
- package/surfaces/starters/social-network/starter/.github/workflows/ci.yml +30 -0
- package/surfaces/starters/social-network/starter/.gitignore.template +9 -0
- package/surfaces/starters/social-network/starter/README.md +47 -0
- package/surfaces/starters/social-network/starter/app/api/revenuecat/webhook/route.ts +21 -0
- package/surfaces/starters/social-network/starter/app/api/stripe/checkout/route.ts +28 -0
- package/surfaces/starters/social-network/starter/app/api/stripe/webhook/route.ts +34 -0
- package/surfaces/starters/social-network/starter/app/auth/confirm/route.ts +22 -0
- package/surfaces/starters/social-network/starter/app/feed/page.tsx +30 -0
- package/surfaces/starters/social-network/starter/app/layout.tsx +20 -0
- package/surfaces/starters/social-network/starter/app/login/page.tsx +47 -0
- package/surfaces/starters/social-network/starter/app/page.tsx +17 -0
- package/surfaces/starters/social-network/starter/components/analytics-provider.tsx +14 -0
- package/surfaces/starters/social-network/starter/lib/analytics/events.ts +31 -0
- package/surfaces/starters/social-network/starter/lib/analytics/posthog-client.ts +28 -0
- package/surfaces/starters/social-network/starter/lib/billing/revenuecat.ts +27 -0
- package/surfaces/starters/social-network/starter/lib/billing/stripe.ts +15 -0
- package/surfaces/starters/social-network/starter/lib/strings.ts +27 -0
- package/surfaces/starters/social-network/starter/lib/supabase/client.ts +7 -0
- package/surfaces/starters/social-network/starter/lib/supabase/proxy.ts +29 -0
- package/surfaces/starters/social-network/starter/lib/supabase/server.ts +23 -0
- package/surfaces/starters/social-network/starter/next.config.ts +5 -0
- package/surfaces/starters/social-network/starter/package-lock.json +1222 -0
- package/surfaces/starters/social-network/starter/package.json +28 -0
- package/surfaces/starters/social-network/starter/proxy.ts +12 -0
- package/surfaces/starters/social-network/starter/supabase/migrations/0001_init.sql +81 -0
- package/surfaces/starters/social-network/starter/supabase/tests/0001_rls.test.sql +70 -0
- package/surfaces/starters/social-network/starter/tsconfig.json +41 -0
- package/surfaces/studio/seed/schema/business.empty.json +45 -0
- package/surfaces/studio/seed/schema/business.schema.json +664 -0
- package/surfaces/ui-library/README.md +42 -0
- package/surfaces/ui-library/adapters/expo.json +57 -0
- package/surfaces/ui-library/adapters/swiftui.json +57 -0
- package/surfaces/ui-library/component-index.json +26 -0
- package/surfaces/ui-library/components/feedback.empty-state.md +22 -0
- package/surfaces/ui-library/components/feedback.haptics.md +21 -0
- package/surfaces/ui-library/components/feedback.skeleton.md +21 -0
- package/surfaces/ui-library/components/input.keyboard-behavior.md +22 -0
- package/surfaces/ui-library/components/interaction.press-feedback.md +22 -0
- package/surfaces/ui-library/schemas/adapter-manifest.schema.json +101 -0
- package/surfaces/ui-library/schemas/component-contract.schema.json +56 -0
- package/surfaces/ui-library/schemas/component-index.schema.json +34 -0
- package/surfaces/workspace-template/new-business/DESIGN.md +198 -0
- package/surfaces/workspace-template/new-business/PRODUCT.md +69 -0
- package/surfaces/workspace-template/new-business/operations/metric-contracts.json +34 -0
- package/surfaces/workspace-template/new-business/product.yaml +87 -0
- package/surfaces/workspace-template/new-business/strategy/OFFER_TEST.md +43 -0
- package/surfaces/workspace-template/new-business/strategy/RESEARCH.md +69 -0
- package/surfaces/workspace-template/new-business/strategy/SIGNAL_CORPUS.md +34 -0
- package/surfaces/workspace-template/repo-agent-entrypoints/.claude/settings.json +48 -0
- package/surfaces/workspace-template/repo-agent-entrypoints/.cursor/rules/agents.mdc +12 -0
- package/surfaces/workspace-template/repo-agent-entrypoints/AGENTS.md +102 -0
- package/surfaces/workspace-template/repo-agent-entrypoints/CLAUDE.md +14 -0
- package/tooling/README.md +3 -0
- package/tooling/browser-proof.ts +1254 -0
- package/tooling/calibrate-utterance-router.ts +374 -0
- package/tooling/catalog-scaffold.ts +181 -0
- package/tooling/ci-aggregate.mjs +105 -0
- package/tooling/ci-lane.mjs +275 -0
- package/tooling/copy-runtime-assets.mjs +18 -0
- package/tooling/export-task-skill.ts +181 -0
- package/tooling/grade-design-surface.ts +404 -0
- package/tooling/grade-screenshots.ts +586 -0
- package/tooling/knowledge.ts +219 -0
- package/tooling/lib/app-copy-rules.ts +428 -0
- package/tooling/lib/artifact-pages.ts +143 -0
- package/tooling/lib/audit-plan.ts +492 -0
- package/tooling/lib/canonical-json.ts +30 -0
- package/tooling/lib/cli-entrypoint.ts +12 -0
- package/tooling/lib/content-assets.ts +228 -0
- package/tooling/lib/design-exploration.ts +232 -0
- package/tooling/lib/design-md.ts +442 -0
- package/tooling/lib/design-state.ts +333 -0
- package/tooling/lib/design-taste-rubric.ts +375 -0
- package/tooling/lib/founder-copy.ts +548 -0
- package/tooling/lib/git-root.ts +12 -0
- package/tooling/lib/grading.ts +92 -0
- package/tooling/lib/html.ts +32 -0
- package/tooling/lib/knowledge-freshness-pin.ts +83 -0
- package/tooling/lib/launch-state.ts +965 -0
- package/tooling/lib/markdown-lite.ts +351 -0
- package/tooling/lib/no-slop-rules.ts +273 -0
- package/tooling/lib/packed-check.ts +69 -0
- package/tooling/lib/posthog-retention.ts +144 -0
- package/tooling/lib/render-artifact-page.ts +342 -0
- package/tooling/lib/runtime-sync-lib.ts +171 -0
- package/tooling/lib/script-paths.ts +131 -0
- package/tooling/lib/shard-pool.ts +121 -0
- package/tooling/lib/skill-root.ts +35 -0
- package/tooling/lib/source-freshness-state.ts +43 -0
- package/tooling/lib/source-http.ts +167 -0
- package/tooling/lib/spawn.ts +36 -0
- package/tooling/lib/tsx-bin.ts +65 -0
- package/tooling/lib/tsx-launcher.d.mts +4 -0
- package/tooling/lib/tsx-launcher.mjs +57 -0
- package/tooling/print-hosted-version.ts +49 -0
- package/tooling/probe-eas.ts +99 -0
- package/tooling/probe-posthog.ts +318 -0
- package/tooling/probe-revenuecat-cli.ts +426 -0
- package/tooling/probe-revenuecat.ts +282 -0
- package/tooling/promote-design-tokens.ts +244 -0
- package/tooling/provision-posthog-platform.ts +138 -0
- package/tooling/prune-posthog-persons.ts +295 -0
- package/tooling/render-artifact-pages.ts +93 -0
- package/tooling/render-credits.ts +301 -0
- package/tooling/render-design-room.ts +518 -0
- package/tooling/render-hosted-bundle.ts +201 -0
- package/tooling/render-product.ts +103 -0
- package/tooling/render-public-api.ts +91 -0
- package/tooling/render-task-skills.ts +69 -0
- package/tooling/report-research-evidence-failures.ts +144 -0
- package/tooling/run-audit.ts +386 -0
- package/tooling/runtime-sync.ts +404 -0
- package/tooling/seed-design-brief.ts +69 -0
- package/tooling/test-public-api.ts +39 -0
- package/tsconfig.json +32 -0
|
@@ -0,0 +1,2214 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createFirstpartyWorkerRoutes } from "./firstparty-worker-host.js";
|
|
3
|
+
import { boundedFileBytes } from "../lib/bounded-file.js";
|
|
4
|
+
import { workspaceRevision } from "./workspace-revision.js";
|
|
5
|
+
import { trackRuntimeWrites } from "./runtime-write-audit.js";
|
|
6
|
+
import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync } from "node:fs";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
9
|
+
|
|
10
|
+
import { isMainModule, parseArgs, resolveCallerPath } from "../lib/cli.js";
|
|
11
|
+
import { runReducer, skillRoot, type ReducerResult } from "./reducer-cli.js";
|
|
12
|
+
import { acquireLock, heartbeat, releaseLock, type AcquireResult } from "../reducer/lock.js";
|
|
13
|
+
import type { PatchOp, PatchPath, StatePatch } from "../reducer/patch.js";
|
|
14
|
+
import { validateBudgetLedger, validateBusinessState, validateControl, validateRunState } from "../schema/index.js";
|
|
15
|
+
import {
|
|
16
|
+
grantableDomainIds,
|
|
17
|
+
type BudgetLedgerDocument,
|
|
18
|
+
type BusinessStateV2,
|
|
19
|
+
type ControlFile,
|
|
20
|
+
type RunStateDocument,
|
|
21
|
+
type PublicSessionResult,
|
|
22
|
+
} from "../schema/types.js";
|
|
23
|
+
import { compilePlan, type CatalogInput, type CompiledPlan, type CompiledRunNode, type RunNodeId } from "../engine/compile.js";
|
|
24
|
+
import { computeFrontier, refreshAdmissibleConsumerIds } from "../engine/frontier.js";
|
|
25
|
+
import { observeAppSourceFingerprint } from "../engine/source-fingerprint.js";
|
|
26
|
+
import { buildDispatchBatches, checkBatchBoundary, type BatchHaltReason, type DispatchHooks } from "../engine/dispatch.js";
|
|
27
|
+
import {
|
|
28
|
+
acceptVerification,
|
|
29
|
+
recordRejectedVerification,
|
|
30
|
+
fingerprintInputs,
|
|
31
|
+
abandonDependencyRefreshesForConsumer,
|
|
32
|
+
beginAttempt,
|
|
33
|
+
detectOrphans,
|
|
34
|
+
isWallClockExceeded,
|
|
35
|
+
loadRunState,
|
|
36
|
+
reconcileEnvironmentalArtifacts,
|
|
37
|
+
reconcilePatch,
|
|
38
|
+
reconcileRunPlan,
|
|
39
|
+
invalidateStaleReviews,
|
|
40
|
+
invalidateDescendants,
|
|
41
|
+
requestVerificationRepair,
|
|
42
|
+
retainUnacceptedCandidateOutputs,
|
|
43
|
+
reconcileWorkflowApplicability,
|
|
44
|
+
refreshHeartbeat,
|
|
45
|
+
reopenRecurringNodes,
|
|
46
|
+
attemptsUsedInCurrentCycle,
|
|
47
|
+
reopenNodesForAuthorizedWorkOrders,
|
|
48
|
+
refreshDependenciesBeforeFrontier,
|
|
49
|
+
deferDependencyRefreshAfterFailure,
|
|
50
|
+
seedRunState,
|
|
51
|
+
workerExecutionIdentity,
|
|
52
|
+
writeRunState,
|
|
53
|
+
buildCheckpoint,
|
|
54
|
+
writeCheckpoint,
|
|
55
|
+
type OrphanEvent,
|
|
56
|
+
} from "../engine/runstate.js";
|
|
57
|
+
import { createAutonomyEvaluator, type AutonomyDecisionDetail, type AutonomyEvaluatorV2 } from "../autonomy/evaluator.js";
|
|
58
|
+
import { createDispatchHooks } from "../autonomy/killswitch.js";
|
|
59
|
+
import { domainBusinessUnit } from "../autonomy/budget.js";
|
|
60
|
+
import { createCompositeVerifier } from "../autonomy/prerequisites.js";
|
|
61
|
+
import { createDopplerAuthVerifier } from "../autonomy/probes/doppler.js";
|
|
62
|
+
import { createBudgetFundedVerifier } from "../autonomy/probes/budget.js";
|
|
63
|
+
import { verifyControlBoundary, type ControlBoundaryVerdict } from "../../adapters/install-control-permissions.js";
|
|
64
|
+
import { applyStandingApprovals } from "../autonomy/standing-approvals.js";
|
|
65
|
+
import { capsuleFromOccurrence, dueWorkOrderReviews, restoreOccurrenceAfterAttempt, takeAuthorizedOccurrence } from "../work-orders/lifecycle.js";
|
|
66
|
+
|
|
67
|
+
import {
|
|
68
|
+
listPendingFreshContext,
|
|
69
|
+
hasCurrentDeterministicVerification,
|
|
70
|
+
recordDeterministicVerification,
|
|
71
|
+
refuseFreshContextAcceptance,
|
|
72
|
+
requiresIndependentReview,
|
|
73
|
+
verificationOutputFingerprint,
|
|
74
|
+
VERIFICATION_REQUIRED_BLOCKER,
|
|
75
|
+
VERIFICATION_REJECTED_BLOCKER,
|
|
76
|
+
} from "../engine/verification.js";
|
|
77
|
+
import {
|
|
78
|
+
captureReviewEvidence,
|
|
79
|
+
parseWorkspaceRuntimeObservation,
|
|
80
|
+
refreshProducedArtifacts,
|
|
81
|
+
validateReviewReceipt,
|
|
82
|
+
validateCurrentReview,
|
|
83
|
+
workspaceArtifactFingerprint,
|
|
84
|
+
} from "../engine/review-evidence.js";
|
|
85
|
+
import { captureDesignAuthorityEvaluation } from "../engine/design-taste-authority.js";
|
|
86
|
+
import {
|
|
87
|
+
assertFounderTrustBinding,
|
|
88
|
+
bindFounderTrustToNewRun,
|
|
89
|
+
FOUNDER_TRUST_FILE_ENV,
|
|
90
|
+
FounderTrustStoreError,
|
|
91
|
+
loadFounderTrustStore,
|
|
92
|
+
recoverFounderTrustBindingFromAudit,
|
|
93
|
+
resolveFounderTrustFile,
|
|
94
|
+
type LoadedFounderTrustStore,
|
|
95
|
+
} from "../engine/founder-trust-store.js";
|
|
96
|
+
import { appendAuditEntry } from "../reducer/audit.js";
|
|
97
|
+
import { BriefInvalid, loadBrief, nodeInScope, type SessionBrief } from "./brief.js";
|
|
98
|
+
import { loadWorkspaceCatalog, renderCatalogRefusal } from "./catalog-contract.js";
|
|
99
|
+
import { resolveCliWorkspace } from "./status.js";
|
|
100
|
+
import {
|
|
101
|
+
createCliExecutor,
|
|
102
|
+
createCliVerifier,
|
|
103
|
+
createFixtureExecutor,
|
|
104
|
+
createFixtureVerifier,
|
|
105
|
+
createSlowSilentExecutor,
|
|
106
|
+
noOpExecutor,
|
|
107
|
+
type NodeExecutor,
|
|
108
|
+
type NodeVerifier,
|
|
109
|
+
type WorkerRuntime,
|
|
110
|
+
} from "./executor.js";
|
|
111
|
+
import { b2cAppBuilderHome, loadRegistry } from "../../adapters/registry.js";
|
|
112
|
+
import { acquireSharedClaim, assertSharedClaim, releaseSharedClaim, renewSharedClaim, type SharedClaim } from "../reducer/shared-claims.js";
|
|
113
|
+
import type { VerifierOutputRef } from "./worker-prompt.js";
|
|
114
|
+
import { runDeterministicGates, type GateOutcome } from "./deterministic-gates.js";
|
|
115
|
+
import {
|
|
116
|
+
formatAge,
|
|
117
|
+
pushDigest,
|
|
118
|
+
renderDigest,
|
|
119
|
+
translateHaltReason,
|
|
120
|
+
translateParkReason,
|
|
121
|
+
writeDigestFile,
|
|
122
|
+
type DigestAdvancedItem,
|
|
123
|
+
type DigestAnomaly,
|
|
124
|
+
type DigestInput,
|
|
125
|
+
type DigestOutcome,
|
|
126
|
+
type DigestParkedItem,
|
|
127
|
+
type DigestSpendLine,
|
|
128
|
+
} from "./digest.js";
|
|
129
|
+
import { INVALID_APP_REVIEW_WATCH_SUMMARY, projectAppReviewForFounder, readAppReviewState } from "../../adapters/app-review/index.js";
|
|
130
|
+
|
|
131
|
+
/** Failed audit gates permit routing a rejection, never accepting the current output. */
|
|
132
|
+
function hasCurrentFailedAuditGates(plan: CompiledPlan, run: RunStateDocument, nodeId: RunNodeId): boolean {
|
|
133
|
+
const node = plan.nodes.find((candidate) => candidate.id === nodeId);
|
|
134
|
+
const state = run.nodes[nodeId];
|
|
135
|
+
const attempt = state?.attempts.at(-1);
|
|
136
|
+
const receipt = attempt?.deterministicVerification;
|
|
137
|
+
return Boolean(
|
|
138
|
+
node?.reviewOf?.length &&
|
|
139
|
+
node.verification.gateIds.length > 0 &&
|
|
140
|
+
requiresIndependentReview(node) &&
|
|
141
|
+
state?.status === "blocked" &&
|
|
142
|
+
state.blocker === VERIFICATION_REQUIRED_BLOCKER &&
|
|
143
|
+
attempt?.status === "blocked" &&
|
|
144
|
+
receipt &&
|
|
145
|
+
receipt.passed === false &&
|
|
146
|
+
receipt.attemptId === attempt.id &&
|
|
147
|
+
receipt.inputFingerprint === attempt.inputFingerprint &&
|
|
148
|
+
receipt.outputFingerprint === verificationOutputFingerprint(plan, run, nodeId) &&
|
|
149
|
+
JSON.stringify(receipt.gateIds) === JSON.stringify(node.verification.gateIds) &&
|
|
150
|
+
receipt.authorityContextFingerprint === attempt.designAuthorityEvaluation?.authorityContextFingerprint &&
|
|
151
|
+
receipt.evidence.some((entry) => entry.trim()),
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function listPendingSessionReviews(plan: CompiledPlan, run: RunStateDocument): RunNodeId[] {
|
|
156
|
+
return [...listPendingFreshContext(plan, run), ...plan.nodes.filter((node) => hasCurrentFailedAuditGates(plan, run, node.id)).map((node) => node.id)];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The scheduled-session runner (R1, R2, R16; the KTD1 headless CLI shape). Bounded, single-run,
|
|
161
|
+
* exits every time: acquire the workspace-wide advisory lock, preflight for out-of-band tamper,
|
|
162
|
+
* honor the kill switch, seed/resume run state, dispatch within grants+budget, and — on every
|
|
163
|
+
* exit path, success or failure — write a founder-plain digest before releasing the lock. Sessions
|
|
164
|
+
* never reach around the reducer: any state this runner changes on the six reducer-owned
|
|
165
|
+
* documents (business-state/control/grants/waivers/budget-ledger/current-truth) goes through kernel/reducer/cli.ts
|
|
166
|
+
* as a subprocess, never a direct write. Commit patches cannot target current-truth; reconcile writes it.
|
|
167
|
+
*
|
|
168
|
+
* Exit codes mirror the reducer's own convention for consistency across the two CLIs a scheduler
|
|
169
|
+
* invokes: 0 = ran (whatever the outcome — the digest tells the real story), 1 = the workspace
|
|
170
|
+
* isn't usable (missing/invalid required documents, or an unexpected internal error), 2 = did not
|
|
171
|
+
* run (lock contention — "back off and report" per R13), 3 = preflight/tamper failure (R14).
|
|
172
|
+
*/
|
|
173
|
+
|
|
174
|
+
export interface WorkspacePaths {
|
|
175
|
+
readonly root: string;
|
|
176
|
+
readonly state: string;
|
|
177
|
+
readonly control: string;
|
|
178
|
+
readonly ledger: string;
|
|
179
|
+
readonly manifest: string;
|
|
180
|
+
readonly audit: string;
|
|
181
|
+
readonly sessionLock: string;
|
|
182
|
+
readonly catalog: string;
|
|
183
|
+
readonly runState: string;
|
|
184
|
+
readonly checkpoint: string;
|
|
185
|
+
readonly agentOperations: string;
|
|
186
|
+
readonly appReview: string;
|
|
187
|
+
readonly currentTruth: string;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export function resolveWorkspacePaths(root: string): WorkspacePaths {
|
|
191
|
+
return {
|
|
192
|
+
root,
|
|
193
|
+
state: path.join(root, "state", "business-state.json"),
|
|
194
|
+
control: path.join(root, "control", "control.json"),
|
|
195
|
+
ledger: path.join(root, "control", "budget-ledger.json"),
|
|
196
|
+
manifest: path.join(root, "control", "manifest.json"),
|
|
197
|
+
audit: path.join(root, "control", "audit.jsonl"),
|
|
198
|
+
sessionLock: path.join(root, "control", "session.lock"),
|
|
199
|
+
catalog: path.join(root, "catalog.json"),
|
|
200
|
+
runState: path.join(root, "run", "run-state.json"),
|
|
201
|
+
checkpoint: path.join(root, "run", "checkpoint.json"),
|
|
202
|
+
agentOperations: path.join(root, "operations", "agent-operations.json"),
|
|
203
|
+
appReview: path.join(root, "run", "app-review.json"),
|
|
204
|
+
currentTruth: path.join(root, "state", "current-truth.json"),
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** Close a settled interrupted public request without executing work or accepting evidence.
|
|
209
|
+
* Stale lock recovery and uncertain-effect readback remain separate existing authority boundaries.
|
|
210
|
+
*/
|
|
211
|
+
export function recoverPublicRequest(
|
|
212
|
+
workspace: string,
|
|
213
|
+
input: { expectedRevision: string; requestId: string },
|
|
214
|
+
): { result: PublicSessionResult; replayed: boolean; revision: string } {
|
|
215
|
+
const paths = resolveWorkspacePaths(workspace);
|
|
216
|
+
const owner = `request-recovery-${randomUUID()}`;
|
|
217
|
+
const held: string[] = [];
|
|
218
|
+
const safe = (file: string) => {
|
|
219
|
+
const relative = path.relative(workspace, file);
|
|
220
|
+
if (relative.startsWith("..") || path.isAbsolute(relative)) throw new Error("business.unsafe_workspace_file");
|
|
221
|
+
let current = workspace;
|
|
222
|
+
if (!lstatSync(current).isDirectory() || lstatSync(current).isSymbolicLink()) throw new Error("business.unsafe_workspace_file");
|
|
223
|
+
for (const segment of relative.split(path.sep)) {
|
|
224
|
+
current = path.join(current, segment);
|
|
225
|
+
let stat;
|
|
226
|
+
try {
|
|
227
|
+
stat = lstatSync(current);
|
|
228
|
+
} catch (error) {
|
|
229
|
+
if ((error as NodeJS.ErrnoException).code === "ENOENT") continue;
|
|
230
|
+
throw error;
|
|
231
|
+
}
|
|
232
|
+
if (stat.isSymbolicLink() || (current === file ? !stat.isFile() : !stat.isDirectory())) throw new Error("business.unsafe_workspace_file");
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
for (const file of [
|
|
236
|
+
paths.sessionLock,
|
|
237
|
+
`${paths.manifest}.lock`,
|
|
238
|
+
`${paths.state}.lock`,
|
|
239
|
+
paths.runState,
|
|
240
|
+
`${paths.runState}.tmp`,
|
|
241
|
+
paths.checkpoint,
|
|
242
|
+
`${paths.checkpoint}.tmp`,
|
|
243
|
+
])
|
|
244
|
+
safe(file);
|
|
245
|
+
// Verify transition guards before creating even a temporary lock.
|
|
246
|
+
workspaceRevision(workspace);
|
|
247
|
+
try {
|
|
248
|
+
for (const file of [paths.sessionLock, `${paths.manifest}.lock`, `${paths.state}.lock`]) {
|
|
249
|
+
const lease = acquireLock(file, { ownerSessionId: owner, retries: 0 });
|
|
250
|
+
if (!lease.ok) throw new Error(lease.reason === "held" ? "business.session_lock_unavailable" : "business.request_lock_recovery_required");
|
|
251
|
+
held.push(file);
|
|
252
|
+
if (file === paths.sessionLock && !tamperCheckPasses(paths)) throw new Error("business.preflight_refused");
|
|
253
|
+
}
|
|
254
|
+
if (workspaceRevision(workspace) !== input.expectedRevision) throw new Error("business.stale_revision");
|
|
255
|
+
const catalog = loadWorkspaceCatalog(workspace);
|
|
256
|
+
if (!catalog.ok) throw new Error("business.catalog_unavailable");
|
|
257
|
+
const loaded = validateRunState(JSON.parse(boundedFileBytes(paths.runState, 32 * 1024 * 1024).toString("utf8")));
|
|
258
|
+
if (!loaded.valid) throw new Error("business.request_state_invalid");
|
|
259
|
+
const run = loaded.value!;
|
|
260
|
+
const plan = compilePlan(catalog.catalog, run.createdAt);
|
|
261
|
+
if (run.planId !== plan.planId) throw new Error("business.request_plan_changed");
|
|
262
|
+
if (Object.keys(run.nodes).length !== plan.nodes.length || plan.nodes.some((node) => run.nodes[node.id]?.nodeId !== node.id))
|
|
263
|
+
throw new Error("business.request_state_invalid");
|
|
264
|
+
if (
|
|
265
|
+
run.artifactBindings.length !== plan.artifactBindings.length ||
|
|
266
|
+
plan.artifactBindings.some(
|
|
267
|
+
(binding) => run.artifactBindings.filter((current) => current.artifactId === binding.artifactId && current.path === binding.path).length !== 1,
|
|
268
|
+
)
|
|
269
|
+
)
|
|
270
|
+
throw new Error("business.request_state_invalid");
|
|
271
|
+
const record = run.publicRequests && Object.hasOwn(run.publicRequests, input.requestId) ? run.publicRequests[input.requestId] : undefined;
|
|
272
|
+
if (!record) throw new Error("business.request_not_found");
|
|
273
|
+
const checkpoint = () => buildCheckpoint(run, record.sessionId, createHash("sha256").update(JSON.stringify(run)).digest("hex"), run.updatedAt);
|
|
274
|
+
if (record.status === "completed" && record.result) {
|
|
275
|
+
let current: unknown;
|
|
276
|
+
try {
|
|
277
|
+
current = JSON.parse(boundedFileBytes(paths.checkpoint, 32 * 1024 * 1024).toString("utf8"));
|
|
278
|
+
} catch {
|
|
279
|
+
current = undefined;
|
|
280
|
+
}
|
|
281
|
+
if (JSON.stringify((current as { runState?: unknown } | undefined)?.runState) !== JSON.stringify(run)) writeCheckpoint(paths.checkpoint, checkpoint());
|
|
282
|
+
return { result: record.result, replayed: true, revision: workspaceRevision(workspace) };
|
|
283
|
+
}
|
|
284
|
+
if (record.status !== "running" || record.result) throw new Error("business.request_state_invalid");
|
|
285
|
+
const heartbeatAt = Date.parse(run.heartbeatAt);
|
|
286
|
+
if (!Number.isFinite(heartbeatAt) || Date.now() - heartbeatAt <= run.ttlSeconds * 1000) throw new Error("business.request_session_not_settled");
|
|
287
|
+
const uncertain = new Set(["running", "orphaned", "needs_readback"]);
|
|
288
|
+
const histories = [run, ...(run.archivedPlans ?? [])];
|
|
289
|
+
for (const history of histories) {
|
|
290
|
+
if (Object.values(history.workOrders ?? {}).some((occurrence) => occurrence.status === "running")) throw new Error("business.request_readback_required");
|
|
291
|
+
for (const state of Object.values(history.nodes)) {
|
|
292
|
+
const node = history === run ? plan.nodes.find((entry) => entry.id === state.nodeId) : undefined;
|
|
293
|
+
if (
|
|
294
|
+
state.attempts.some((attempt) => attempt.status === "failed") &&
|
|
295
|
+
(!node || !node.idempotent || node.protectedCategory || !["observe", "draft"].includes(node.actionClass))
|
|
296
|
+
)
|
|
297
|
+
throw new Error("business.request_readback_required");
|
|
298
|
+
const latest = state.attempts.at(-1);
|
|
299
|
+
const verifiedRepeat = Boolean(
|
|
300
|
+
node &&
|
|
301
|
+
node.idempotent &&
|
|
302
|
+
!node.protectedCategory &&
|
|
303
|
+
["observe", "draft"].includes(node.actionClass) &&
|
|
304
|
+
state.status === "succeeded" &&
|
|
305
|
+
latest?.status === "succeeded" &&
|
|
306
|
+
latest.inputFingerprint === fingerprintInputs(node.inputs, run.artifactBindings) &&
|
|
307
|
+
hasCurrentDeterministicVerification(plan, run, node.id) &&
|
|
308
|
+
(!requiresIndependentReview(node) || validateCurrentReview(plan, run, node.id, workspace).length === 0) &&
|
|
309
|
+
node.inputs.every((id) => {
|
|
310
|
+
const binding = run.artifactBindings.find((entry) => entry.artifactId === id);
|
|
311
|
+
return binding?.fingerprint && binding.fingerprint === workspaceArtifactFingerprint(workspace, binding.path);
|
|
312
|
+
}) &&
|
|
313
|
+
node.outputs.every((id) => {
|
|
314
|
+
const binding = run.artifactBindings.find((entry) => entry.artifactId === id);
|
|
315
|
+
return binding?.accepted && binding.attemptId === latest.id && binding.fingerprint === workspaceArtifactFingerprint(workspace, binding.path);
|
|
316
|
+
}),
|
|
317
|
+
);
|
|
318
|
+
if (
|
|
319
|
+
uncertain.has(state.status) ||
|
|
320
|
+
state.attempts.some(
|
|
321
|
+
(attempt) =>
|
|
322
|
+
attempt.readbackRequired || (uncertain.has(attempt.status) && !(attempt.status === "orphaned" && attempt !== latest && verifiedRepeat)),
|
|
323
|
+
)
|
|
324
|
+
)
|
|
325
|
+
throw new Error("business.request_readback_required");
|
|
326
|
+
}
|
|
327
|
+
for (const artifact of history.artifactBindings) {
|
|
328
|
+
const file = path.resolve(workspace, artifact.path);
|
|
329
|
+
safe(file);
|
|
330
|
+
if (!existsSync(file)) continue;
|
|
331
|
+
const bytes = boundedFileBytes(file, 32 * 1024 * 1024);
|
|
332
|
+
if (bytes.includes(Buffer.from("b2c.operation-intent/v1"))) throw new Error("business.request_readback_required");
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
const result: PublicSessionResult = {
|
|
336
|
+
runId: run.runId,
|
|
337
|
+
planId: run.planId,
|
|
338
|
+
outcome: "interrupted",
|
|
339
|
+
completed: 0,
|
|
340
|
+
held: Object.values(run.nodes).filter((node) => node.status !== "succeeded").length,
|
|
341
|
+
};
|
|
342
|
+
record.status = "completed";
|
|
343
|
+
record.result = result;
|
|
344
|
+
run.updatedAt = new Date().toISOString();
|
|
345
|
+
// The run is authoritative; its atomic write preserves exact-retry identity even if checkpoint writing is interrupted.
|
|
346
|
+
writeRunState(paths.runState, run);
|
|
347
|
+
writeCheckpoint(paths.checkpoint, checkpoint());
|
|
348
|
+
return { result, replayed: false, revision: workspaceRevision(workspace) };
|
|
349
|
+
} finally {
|
|
350
|
+
for (const file of held.reverse()) releaseLock(file, owner);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
let patchSequence = 0;
|
|
355
|
+
function nextPatchId(sessionId: string): string {
|
|
356
|
+
patchSequence += 1;
|
|
357
|
+
return `patch.${sessionId}.${patchSequence}`;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* The session's tamper backstop (R14): the reducer's manifest preflight confirms none of the six
|
|
362
|
+
* reducer-owned documents changed outside the reducer since the last commit, and verify-audit
|
|
363
|
+
* confirms the hash-chained audit log's chain is intact. Run at session start AND at every batch
|
|
364
|
+
* boundary so a same-session out-of-band edit is caught before the next batch, not next session.
|
|
365
|
+
* Note: this DETECTS out-of-band mutation; it does not by itself PREVENT a Bash-capable session
|
|
366
|
+
* from invoking the reducer — see the reducer's founder-authority gate and the OS-permission
|
|
367
|
+
* requirement in the workspace AGENTS.md for the prevention layers.
|
|
368
|
+
*/
|
|
369
|
+
function tamperCheckPasses(paths: WorkspacePaths): boolean {
|
|
370
|
+
if (runReducer(["preflight", "--manifest", paths.manifest]).code !== 0) return false;
|
|
371
|
+
if (existsSync(paths.audit) && runReducer(["verify-audit", "--audit", paths.audit]).code !== 0) return false;
|
|
372
|
+
return true;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
const DESIGN_TASTE_FOUNDER_DECISION_CODES = new Set([
|
|
376
|
+
"worthiness.taste_gate_authority_evidence",
|
|
377
|
+
"worthiness.taste_gate_delegation_authority",
|
|
378
|
+
"worthiness.taste_gate_incomplete",
|
|
379
|
+
]);
|
|
380
|
+
const DESIGN_AUDIT_WORKFLOW_IDS = new Set(["workflow.design.design-system-audit", "workflow.design.implementation-craft-audit"]);
|
|
381
|
+
const IMPLEMENTATION_AUDIT_EVIDENCE_CODES = new Set([
|
|
382
|
+
"design_acceptance.report",
|
|
383
|
+
"design_acceptance.report_coverage",
|
|
384
|
+
"design_acceptance.self_review",
|
|
385
|
+
"design_acceptance.chronology",
|
|
386
|
+
"design_acceptance.stale_candidate",
|
|
387
|
+
]);
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* A design-audit worker can finish without producing its one declared review artifact, or can
|
|
391
|
+
* return a malformed knowledge receipt before any gate sees that artifact. Both are reversible
|
|
392
|
+
* audit-authoring defects. They consume the audit node's own bounded retry budget; they are not
|
|
393
|
+
* evidence that the Design Room candidate needs repair.
|
|
394
|
+
*/
|
|
395
|
+
function isRetryableDesignAuditExecutorFailure(node: CompiledRunNode, error: string | undefined): boolean {
|
|
396
|
+
// Global control/audit tamper checks halt the session before dispatch. Once one of these two
|
|
397
|
+
// local audit workers is running, every non-empty executor failure is a reversible failure to
|
|
398
|
+
// author or prove the review. Keep it on the audit node's bounded retry budget; it establishes
|
|
399
|
+
// no defect in the Design Room or implementation candidate.
|
|
400
|
+
return DESIGN_AUDIT_WORKFLOW_IDS.has(node.workflowId) && Boolean(error?.trim());
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/** Product/craft rejection repairs declared producers. Invalid audit-authored evidence retries
|
|
404
|
+
* only the relevant design audit, because no product defect has yet been established. */
|
|
405
|
+
function isRetryableDesignAuditGateFailure(node: CompiledRunNode, outcome: GateOutcome): boolean {
|
|
406
|
+
if (DESIGN_AUDIT_WORKFLOW_IDS.has(node.workflowId) && outcome.unclassifiedFailure) return true;
|
|
407
|
+
if (node.workflowId === "workflow.design.design-system-audit") {
|
|
408
|
+
return outcome.issueCodes.length > 0 && outcome.issueCodes.every((code) => code === "worthiness.taste_gate_review_evidence");
|
|
409
|
+
}
|
|
410
|
+
return (
|
|
411
|
+
node.workflowId === "workflow.design.implementation-craft-audit" &&
|
|
412
|
+
outcome.issueCodes.length > 0 &&
|
|
413
|
+
outcome.issueCodes.every((code) => IMPLEMENTATION_AUDIT_EVIDENCE_CODES.has(code))
|
|
414
|
+
);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* A design audit's own missing, changed, or unsafe output proves only that this audit attempt is
|
|
419
|
+
* unusable. It does not prove a defect in any reviewed producer. Consume the audit's bounded
|
|
420
|
+
* retry budget and leave every Design Room / implementation attempt untouched.
|
|
421
|
+
*/
|
|
422
|
+
function queueDesignAuditOnlyRetry(plan: CompiledPlan, run: RunStateDocument, nodeId: RunNodeId, findings: readonly string[], now: string): number {
|
|
423
|
+
const node = plan.nodes.find((candidate) => candidate.id === nodeId);
|
|
424
|
+
const state = run.nodes[nodeId];
|
|
425
|
+
const attempt = state?.attempts.at(-1);
|
|
426
|
+
if (!node || !state || !attempt || !DESIGN_AUDIT_WORKFLOW_IDS.has(node.workflowId)) return 0;
|
|
427
|
+
const evidence = findings.filter((entry) => entry.trim().length > 0);
|
|
428
|
+
if (evidence.length === 0) return 0;
|
|
429
|
+
|
|
430
|
+
attempt.status = "failed";
|
|
431
|
+
attempt.finishedAt ??= now;
|
|
432
|
+
attempt.error ??= evidence.join("; ");
|
|
433
|
+
attempt.independentVerification = undefined;
|
|
434
|
+
if (attempt.workOrderOccurrenceId) restoreOccurrenceAfterAttempt(run, attempt.workOrderOccurrenceId, now);
|
|
435
|
+
state.acceptedOutputFingerprint = undefined;
|
|
436
|
+
state.verifiedBySessionId = undefined;
|
|
437
|
+
state.repairInstructions = evidence.map((entry) => `Repair invalid audit evidence: ${entry}`);
|
|
438
|
+
for (const binding of run.artifactBindings) {
|
|
439
|
+
if (node.outputs.includes(binding.artifactId as never)) binding.accepted = false;
|
|
440
|
+
}
|
|
441
|
+
// This output is still pending independent verification, so no downstream node can have
|
|
442
|
+
// accepted it. Walking descendants here is both unnecessary and wrong for review feedback
|
|
443
|
+
// cycles: Design Room reads its audit findings on a real rejection, which would otherwise make
|
|
444
|
+
// an audit-file integrity defect look like product work and reopen the producer.
|
|
445
|
+
if (attemptsUsedInCurrentCycle(state) < node.maxAttempts) {
|
|
446
|
+
state.status = "stale";
|
|
447
|
+
state.blocker = undefined;
|
|
448
|
+
run.updatedAt = now;
|
|
449
|
+
return 1;
|
|
450
|
+
}
|
|
451
|
+
state.status = "blocked";
|
|
452
|
+
state.blocker = `The design audit evidence remained invalid after ${node.maxAttempts} attempts.`;
|
|
453
|
+
run.updatedAt = now;
|
|
454
|
+
return 0;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
function commitPatch(targetFile: string, paths: WorkspacePaths, sessionId: string, patch: StatePatch): ReducerResult {
|
|
458
|
+
return runReducer(["commit", "--file", targetFile, "--manifest", paths.manifest, "--audit", paths.audit, "--session", sessionId], JSON.stringify(patch));
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function tryLoadJson(filePath: string): unknown | undefined {
|
|
462
|
+
if (!existsSync(filePath)) return undefined;
|
|
463
|
+
try {
|
|
464
|
+
return JSON.parse(readFileSync(filePath, "utf8"));
|
|
465
|
+
} catch {
|
|
466
|
+
return undefined;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* The four workspace loaders below are exported so kernel/session/plan.ts reads a workspace exactly
|
|
472
|
+
* the way a real session does. A second, private copy in the read-only planner is the one thing
|
|
473
|
+
* that would make its report diverge from what an actual run would then do — and a planner that
|
|
474
|
+
* disagrees with the runner is worse than no planner.
|
|
475
|
+
*/
|
|
476
|
+
export function loadControlFile(controlPath: string): ControlFile | undefined {
|
|
477
|
+
const raw = tryLoadJson(controlPath);
|
|
478
|
+
if (raw === undefined) return undefined;
|
|
479
|
+
const result = validateControl(raw);
|
|
480
|
+
return result.valid ? result.value : undefined;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
export function loadBusinessStateFile(statePath: string): BusinessStateV2 | undefined {
|
|
484
|
+
const raw = tryLoadJson(statePath);
|
|
485
|
+
if (raw === undefined) return undefined;
|
|
486
|
+
const result = validateBusinessState(raw);
|
|
487
|
+
return result.valid ? result.value : undefined;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
function emptyLedger(now: string): BudgetLedgerDocument {
|
|
491
|
+
return { schemaVersion: "1.0.0", updatedAt: now, balances: [], entries: [] };
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/** A business that hasn't set up a budget yet is a legitimate state, not an error — spend nodes simply park (autonomy.budget_unfunded). */
|
|
495
|
+
export function loadLedgerFile(ledgerPath: string, now: string): BudgetLedgerDocument {
|
|
496
|
+
const raw = tryLoadJson(ledgerPath);
|
|
497
|
+
if (raw === undefined) return emptyLedger(now);
|
|
498
|
+
const result = validateBudgetLedger(raw);
|
|
499
|
+
return result.valid ? result.value! : emptyLedger(now);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
export function loadCatalogFile(catalogPath: string): CatalogInput {
|
|
503
|
+
const raw = tryLoadJson(catalogPath) as CatalogInput | undefined;
|
|
504
|
+
return raw ?? { version: "catalog.empty", artifacts: [], workflows: [] };
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/** Hook used by installed briefs/CI to reject a stale or substituted executable catalog. */
|
|
508
|
+
export function assertCatalogCompatibility(catalog: CatalogInput, expectedVersion?: string): void {
|
|
509
|
+
if (!catalog.version || catalog.version === "catalog.empty") throw new Error("catalog.version_missing: executable catalog is missing or invalid");
|
|
510
|
+
if (expectedVersion && catalog.version !== expectedVersion) throw new Error(`catalog.version_stale: expected ${expectedVersion}, found ${catalog.version}`);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
/** Load the installer-owned catalog version automatically; a present but incomplete binding fails closed. */
|
|
514
|
+
export function runtimeCatalogVersion(workspace: string): string | undefined {
|
|
515
|
+
const manifestPath = path.join(workspace, ".b2c-launch", "runtime.json");
|
|
516
|
+
if (!existsSync(manifestPath)) return undefined;
|
|
517
|
+
const manifest = tryLoadJson(manifestPath);
|
|
518
|
+
if (!manifest || typeof manifest !== "object" || Array.isArray(manifest)) throw new Error("catalog.runtime_binding_invalid: runtime.json is not an object");
|
|
519
|
+
const version = (manifest as Record<string, unknown>).catalogVersion;
|
|
520
|
+
if (typeof version !== "string" || !version.trim()) {
|
|
521
|
+
throw new Error("catalog.runtime_binding_stale: runtime.json has no catalogVersion; refresh the installed entrypoints");
|
|
522
|
+
}
|
|
523
|
+
return version;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/** Records evaluator.evaluate()'s full decision detail per node id as frontier examines it, so the digest can translate the *precise* reasonCode rather than a generic fallback. */
|
|
527
|
+
function withCapture(inner: AutonomyEvaluatorV2, sink: Map<string, AutonomyDecisionDetail>): AutonomyEvaluatorV2 {
|
|
528
|
+
return {
|
|
529
|
+
evaluate(node: CompiledRunNode): AutonomyDecisionDetail {
|
|
530
|
+
const detail = inner.evaluate(node);
|
|
531
|
+
sink.set(node.id, detail);
|
|
532
|
+
return detail;
|
|
533
|
+
},
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* The reducer's fail-closed join rejects a patch whose declared output didn't actually change
|
|
539
|
+
* (patch.declared_output_missing) — and committed/spent can trade places while remaining stays
|
|
540
|
+
* numerically invariant (e.g. committed 25→0, spent 0→25, remaining 975→975). This only ever
|
|
541
|
+
* declares (and only ever sets) a balance field that is genuinely different, so the always-touched
|
|
542
|
+
* `updatedAt` timestamp is the one guaranteed change per commit.
|
|
543
|
+
*/
|
|
544
|
+
function pushIfChanged(ops: PatchOp[], declaredOutputs: PatchPath[], path: PatchPath, before: number, after: number): void {
|
|
545
|
+
if (before === after) return;
|
|
546
|
+
ops.push({ op: "set", path, value: after });
|
|
547
|
+
declaredOutputs.push(path);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/** Estimate ledger entry + balance decrement, committed via the reducer (never a direct write) — R10's "hard-stop before, actuals after" estimate half. */
|
|
551
|
+
function buildEstimatePatch(
|
|
552
|
+
ledger: BudgetLedgerDocument,
|
|
553
|
+
node: CompiledRunNode,
|
|
554
|
+
decision: AutonomyDecisionDetail,
|
|
555
|
+
sessionId: string,
|
|
556
|
+
now: string,
|
|
557
|
+
): { patch: StatePatch; entryId: string } | undefined {
|
|
558
|
+
if (
|
|
559
|
+
decision.estimateAmount === undefined ||
|
|
560
|
+
decision.budgetUnit === undefined ||
|
|
561
|
+
decision.budgetPeriod === undefined ||
|
|
562
|
+
decision.estimateCurrency === undefined
|
|
563
|
+
)
|
|
564
|
+
return undefined;
|
|
565
|
+
const entryId = `ledger.${sessionId}.${randomUUID().slice(0, 8)}`;
|
|
566
|
+
const entry = {
|
|
567
|
+
id: entryId,
|
|
568
|
+
unit: decision.budgetUnit,
|
|
569
|
+
domainId: node.domainId,
|
|
570
|
+
nodeRef: node.id,
|
|
571
|
+
period: decision.budgetPeriod,
|
|
572
|
+
estimate: { amount: decision.estimateAmount, currency: decision.estimateCurrency, declaredAt: now },
|
|
573
|
+
actual: null,
|
|
574
|
+
status: "estimated",
|
|
575
|
+
...(decision.waiverId ? { waiverRef: decision.waiverId } : {}),
|
|
576
|
+
auditRef: `audit.${entryId}`,
|
|
577
|
+
};
|
|
578
|
+
const ops: PatchOp[] = [{ op: "append", path: ["entries"], value: entry }];
|
|
579
|
+
const declaredOutputs: PatchPath[] = [["entries"]];
|
|
580
|
+
const balanceIndex = ledger.balances.findIndex((balance) => balance.unit === decision.budgetUnit && balance.period === decision.budgetPeriod);
|
|
581
|
+
if (balanceIndex >= 0) {
|
|
582
|
+
const balance = ledger.balances[balanceIndex]!;
|
|
583
|
+
const committed = balance.committed + decision.estimateAmount;
|
|
584
|
+
const remaining = balance.allocated - committed - balance.spent;
|
|
585
|
+
pushIfChanged(ops, declaredOutputs, ["balances", String(balanceIndex), "committed"], balance.committed, committed);
|
|
586
|
+
pushIfChanged(ops, declaredOutputs, ["balances", String(balanceIndex), "remaining"], balance.remaining, remaining);
|
|
587
|
+
ops.push({ op: "set", path: ["balances", String(balanceIndex), "updatedAt"], value: now });
|
|
588
|
+
declaredOutputs.push(["balances", String(balanceIndex), "updatedAt"]);
|
|
589
|
+
}
|
|
590
|
+
return {
|
|
591
|
+
entryId,
|
|
592
|
+
patch: {
|
|
593
|
+
schemaVersion: "1.0.0",
|
|
594
|
+
patchId: nextPatchId(sessionId),
|
|
595
|
+
targetDoc: "budget-ledger",
|
|
596
|
+
reason: `Recording estimated spend for ${node.title}`,
|
|
597
|
+
authoredBy: sessionId,
|
|
598
|
+
authoredAt: now,
|
|
599
|
+
preconditions: [],
|
|
600
|
+
ops,
|
|
601
|
+
declaredOutputs,
|
|
602
|
+
},
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* Actual recording after execution. The fixture/no-op executors carry no cost-reporting field
|
|
608
|
+
* (NodeExecutionResult is {status, outputs, evidence, error?} per the U5 contract), so the actual
|
|
609
|
+
* is recorded equal to the estimate — a deliberate, named placeholder until U6's real executor can
|
|
610
|
+
* report a true actual.
|
|
611
|
+
*/
|
|
612
|
+
function buildActualPatch(
|
|
613
|
+
ledger: BudgetLedgerDocument,
|
|
614
|
+
entryId: string,
|
|
615
|
+
node: CompiledRunNode,
|
|
616
|
+
decision: AutonomyDecisionDetail,
|
|
617
|
+
sessionId: string,
|
|
618
|
+
now: string,
|
|
619
|
+
): StatePatch | undefined {
|
|
620
|
+
if (decision.estimateAmount === undefined || decision.budgetUnit === undefined || decision.estimateCurrency === undefined) return undefined;
|
|
621
|
+
const entryIndex = ledger.entries.findIndex((entry) => entry.id === entryId);
|
|
622
|
+
if (entryIndex < 0) return undefined;
|
|
623
|
+
const amount = decision.estimateAmount;
|
|
624
|
+
const ops: PatchOp[] = [
|
|
625
|
+
{ op: "set", path: ["entries", String(entryIndex), "actual"], value: { amount, currency: decision.estimateCurrency, recordedAt: now } },
|
|
626
|
+
{ op: "set", path: ["entries", String(entryIndex), "status"], value: "actualized" },
|
|
627
|
+
];
|
|
628
|
+
const declaredOutputs: PatchPath[] = [
|
|
629
|
+
["entries", String(entryIndex), "actual"],
|
|
630
|
+
["entries", String(entryIndex), "status"],
|
|
631
|
+
];
|
|
632
|
+
const balanceIndex = ledger.balances.findIndex((balance) => balance.unit === decision.budgetUnit && balance.period === decision.budgetPeriod);
|
|
633
|
+
if (balanceIndex >= 0) {
|
|
634
|
+
const balance = ledger.balances[balanceIndex]!;
|
|
635
|
+
const committed = Math.max(0, balance.committed - amount);
|
|
636
|
+
const spent = balance.spent + amount;
|
|
637
|
+
const remaining = balance.allocated - committed - spent;
|
|
638
|
+
pushIfChanged(ops, declaredOutputs, ["balances", String(balanceIndex), "committed"], balance.committed, committed);
|
|
639
|
+
pushIfChanged(ops, declaredOutputs, ["balances", String(balanceIndex), "spent"], balance.spent, spent);
|
|
640
|
+
pushIfChanged(ops, declaredOutputs, ["balances", String(balanceIndex), "remaining"], balance.remaining, remaining);
|
|
641
|
+
ops.push({ op: "set", path: ["balances", String(balanceIndex), "updatedAt"], value: now });
|
|
642
|
+
declaredOutputs.push(["balances", String(balanceIndex), "updatedAt"]);
|
|
643
|
+
}
|
|
644
|
+
return {
|
|
645
|
+
schemaVersion: "1.0.0",
|
|
646
|
+
patchId: nextPatchId(sessionId),
|
|
647
|
+
targetDoc: "budget-ledger",
|
|
648
|
+
reason: `Recording actual spend for ${node.title}`,
|
|
649
|
+
authoredBy: sessionId,
|
|
650
|
+
authoredAt: now,
|
|
651
|
+
preconditions: [],
|
|
652
|
+
ops,
|
|
653
|
+
declaredOutputs,
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
function orphanSentence(event: OrphanEvent, title: string): string {
|
|
658
|
+
return event.resolution === "ready"
|
|
659
|
+
? `"${title}" didn't finish cleanly last session — I'll try it again this time.`
|
|
660
|
+
: `"${title}" didn't finish cleanly last session, and I can't safely retry it blind — I need to check what actually happened before touching it again.`;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
/**
|
|
664
|
+
* computeFrontier() only ever returns the current ready frontier, not the full dependency
|
|
665
|
+
* closure, so a scoped session's own entry chain can be permanently stuck: an in-scope node
|
|
666
|
+
* whose only unmet dependency sits in a different, out-of-scope domain never becomes ready at
|
|
667
|
+
* all, and the dispatch loop used to just break with no explanation once scope-filtering emptied
|
|
668
|
+
* readyIds. This walks the dependency chain from every not-yet-succeeded in-scope node (not just
|
|
669
|
+
* the current ready set) to find the titles of out-of-scope nodes actually blocking it, so that
|
|
670
|
+
* case can be reported by name instead of silently doing nothing.
|
|
671
|
+
*
|
|
672
|
+
* This deliberately does NOT flag an out-of-scope node that happens to be ready but isn't a
|
|
673
|
+
* dependency of anything in scope -- that is ordinary parallel work for a different session, not
|
|
674
|
+
* a blocker, and a scoped session correctly leaves it untouched without comment (see
|
|
675
|
+
* "session: scope hints restrict this session..." in checks/verification/fixtures/session.fixtures.ts).
|
|
676
|
+
*/
|
|
677
|
+
function findOutOfScopeBlockers(plan: CompiledPlan, run: RunStateDocument, scopeHints: readonly string[]): string[] {
|
|
678
|
+
const nodesById = new Map(plan.nodes.map((node) => [node.id, node]));
|
|
679
|
+
const blockingTitles = new Set<string>();
|
|
680
|
+
const visited = new Set<string>();
|
|
681
|
+
|
|
682
|
+
const walk = (nodeId: RunNodeId): void => {
|
|
683
|
+
if (visited.has(nodeId)) return;
|
|
684
|
+
visited.add(nodeId);
|
|
685
|
+
const node = nodesById.get(nodeId);
|
|
686
|
+
if (!node) return;
|
|
687
|
+
for (const dependencyId of node.dependencies) {
|
|
688
|
+
if (run.nodes[dependencyId]?.status === "succeeded") continue;
|
|
689
|
+
const dependencyNode = nodesById.get(dependencyId);
|
|
690
|
+
if (!dependencyNode) continue;
|
|
691
|
+
if (nodeInScope(scopeHints, dependencyNode.domainId, dependencyNode.workflowId)) {
|
|
692
|
+
walk(dependencyId);
|
|
693
|
+
} else {
|
|
694
|
+
blockingTitles.add(dependencyNode.title);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
};
|
|
698
|
+
|
|
699
|
+
for (const node of plan.nodes) {
|
|
700
|
+
if (run.nodes[node.id]?.status === "succeeded") continue;
|
|
701
|
+
if (!nodeInScope(scopeHints, node.domainId, node.workflowId)) continue;
|
|
702
|
+
walk(node.id);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
return [...blockingTitles];
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* Layer 3 disclosure, never a gate (R14/AGENTS.md "Autonomy Trust Boundary"): once any granted
|
|
710
|
+
* business unit sits above the lowest level, the founder is relying on control/'s OS write
|
|
711
|
+
* protection to make that grant a real limit rather than a suggestion. If verifyControlBoundary
|
|
712
|
+
* hasn't proven that boundary is genuinely `enforced`, the founder is told in plain terms — this
|
|
713
|
+
* never blocks dispatch, and stays silent when every grant is at the lowest level (nothing to
|
|
714
|
+
* disclose). Pure and exported so it's testable without spawning a session subprocess; run.ts's
|
|
715
|
+
* own main() is the only caller in production.
|
|
716
|
+
*/
|
|
717
|
+
export function buildControlBoundaryAnomaly(control: ControlFile, verdict: ControlBoundaryVerdict, command: string): DigestAnomaly | undefined {
|
|
718
|
+
if (verdict.state === "enforced") return undefined;
|
|
719
|
+
const units = new Set<string>();
|
|
720
|
+
for (const domainId of grantableDomainIds) {
|
|
721
|
+
const grant = control.grants[domainId];
|
|
722
|
+
if (!grant || grant.level === "review-first") continue;
|
|
723
|
+
units.add(domainBusinessUnit(domainId));
|
|
724
|
+
}
|
|
725
|
+
if (units.size === 0) return undefined;
|
|
726
|
+
const unitList = [...units].sort().join(", ");
|
|
727
|
+
return {
|
|
728
|
+
message: `I'm set up to act on my own for ${unitList}, but the folder that holds those permissions isn't locked down yet, so those limits are guidance rather than a hard stop. Here's the one command that fixes it: ${command}`,
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
export interface SessionInvocation {
|
|
733
|
+
workspace: string;
|
|
734
|
+
sessionId: string;
|
|
735
|
+
brief: SessionBrief;
|
|
736
|
+
expectedRevision: string;
|
|
737
|
+
requestId: string;
|
|
738
|
+
requestDigest: string;
|
|
739
|
+
maxConcurrency: number;
|
|
740
|
+
wallClockSeconds: number;
|
|
741
|
+
/** Explicit workspace runtime observation. Omit stays unobserved. A live-device word cannot invent it. */
|
|
742
|
+
runtimeObserved?: boolean | string;
|
|
743
|
+
/** Diagnostic executor for the public wrapper. Omit keeps the real auto session. */
|
|
744
|
+
executor?: "auto" | "fixture" | "noop";
|
|
745
|
+
/** Diagnostic verifier for the public wrapper. Omit follows the executor. */
|
|
746
|
+
verifier?: "cli" | "fixture" | "off";
|
|
747
|
+
}
|
|
748
|
+
export interface SessionHost {
|
|
749
|
+
operationRoutes?: import("./operation-routes.js").OperationRouteRegistry;
|
|
750
|
+
/** Diagnostic executor for tests and the public wrapper. Omit keeps the real auto session. */
|
|
751
|
+
executor?: "auto" | "fixture" | "noop";
|
|
752
|
+
/** Diagnostic verifier for tests and the public wrapper. Omit follows the executor. */
|
|
753
|
+
verifier?: "cli" | "fixture" | "off";
|
|
754
|
+
}
|
|
755
|
+
interface InternalSessionHost extends SessionHost {
|
|
756
|
+
brief?: SessionBrief;
|
|
757
|
+
notifications?: boolean;
|
|
758
|
+
request?: { id: string; digest: string; expectedRevision: string };
|
|
759
|
+
result?: import("../schema/types.js").PublicSessionResult;
|
|
760
|
+
replayed?: boolean;
|
|
761
|
+
refusal?: string;
|
|
762
|
+
}
|
|
763
|
+
export async function runSession(
|
|
764
|
+
input: SessionInvocation,
|
|
765
|
+
dependencies: SessionHost = {},
|
|
766
|
+
): Promise<import("../schema/types.js").PublicSessionResult & { replayed: boolean }> {
|
|
767
|
+
const host: InternalSessionHost = {
|
|
768
|
+
...dependencies,
|
|
769
|
+
brief: input.brief,
|
|
770
|
+
notifications: false,
|
|
771
|
+
request: { id: input.requestId, digest: input.requestDigest, expectedRevision: input.expectedRevision },
|
|
772
|
+
};
|
|
773
|
+
const code = await runSessionCore(
|
|
774
|
+
{
|
|
775
|
+
workspace: input.workspace,
|
|
776
|
+
brief: "internal",
|
|
777
|
+
session: input.sessionId,
|
|
778
|
+
"max-concurrency": String(input.maxConcurrency),
|
|
779
|
+
"wall-clock-seconds": String(input.wallClockSeconds),
|
|
780
|
+
"lock-retries": "0",
|
|
781
|
+
...(input.runtimeObserved === true
|
|
782
|
+
? { "runtime-observed": "true" }
|
|
783
|
+
: input.runtimeObserved !== undefined && input.runtimeObserved !== false
|
|
784
|
+
? { "runtime-observed": String(input.runtimeObserved) }
|
|
785
|
+
: {}),
|
|
786
|
+
...(input.executor ? { executor: input.executor } : {}),
|
|
787
|
+
...(input.verifier ? { verifier: input.verifier } : {}),
|
|
788
|
+
},
|
|
789
|
+
host,
|
|
790
|
+
);
|
|
791
|
+
if (host.refusal) throw new Error(host.refusal);
|
|
792
|
+
if (!host.result) throw new Error(code ? "business.session_refused" : "business.session_result_missing");
|
|
793
|
+
return { ...host.result, replayed: host.replayed ?? false };
|
|
794
|
+
}
|
|
795
|
+
async function main(): Promise<number> {
|
|
796
|
+
return runSessionCore(parseArgs(process.argv.slice(2)), { notifications: true });
|
|
797
|
+
}
|
|
798
|
+
async function runSessionCore(args: Record<string, string | undefined>, host: InternalSessionHost): Promise<number> {
|
|
799
|
+
if (Object.hasOwn(args, "catalog")) {
|
|
800
|
+
if (!host.request) console.error("session.unsupported_argument: --catalog is not supported. Use composition activation to change the workspace pin.");
|
|
801
|
+
return 1;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
const missing = ["workspace", "brief", "session"].filter((name) => !args[name]);
|
|
805
|
+
if (missing.length > 0) {
|
|
806
|
+
if (!host.request) console.error(`session.missing_argument: --${missing.join(", --")} ${missing.length === 1 ? "is" : "are"} required`);
|
|
807
|
+
return 1;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
let runtimeObservation;
|
|
811
|
+
try {
|
|
812
|
+
runtimeObservation = parseWorkspaceRuntimeObservation(args["runtime-observed"]);
|
|
813
|
+
} catch {
|
|
814
|
+
if (!host.request) {
|
|
815
|
+
console.error(
|
|
816
|
+
"ISSUE session.runtime_observation_invalid: --runtime-observed accepts only an explicit workspace token; a sentence or live-device word cannot invent it",
|
|
817
|
+
);
|
|
818
|
+
}
|
|
819
|
+
return 1;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
const maxConcurrency = Number(args["max-concurrency"] ?? 4);
|
|
823
|
+
if (!Number.isSafeInteger(maxConcurrency) || maxConcurrency < 1) {
|
|
824
|
+
if (!host.request) console.error("session.invalid_concurrency: --max-concurrency must be a positive integer");
|
|
825
|
+
return 1;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
const resolvedWorkspace = resolveCliWorkspace(args.workspace!);
|
|
829
|
+
if (!resolvedWorkspace.ok) {
|
|
830
|
+
console.error(resolvedWorkspace.message);
|
|
831
|
+
return 1;
|
|
832
|
+
}
|
|
833
|
+
const workspace = resolvedWorkspace.path;
|
|
834
|
+
const paths = resolveWorkspacePaths(workspace);
|
|
835
|
+
// Invalid catalog pins are a read-only refusal. Keep this outside finish(), which
|
|
836
|
+
// writes a digest and can send email, and before even creating the run or lock directory.
|
|
837
|
+
let compatible = loadWorkspaceCatalog(workspace);
|
|
838
|
+
if (!compatible.ok) {
|
|
839
|
+
if (!host.request) console.error(renderCatalogRefusal(compatible.refusal));
|
|
840
|
+
return 1;
|
|
841
|
+
}
|
|
842
|
+
// runstate.ts's writeAtomic (unlike the reducer's writer) does not create parent directories.
|
|
843
|
+
if (!host.request) mkdirSync(path.dirname(paths.runState), { recursive: true });
|
|
844
|
+
const sessionId = args.session!;
|
|
845
|
+
const startedAt = args.now ?? new Date().toISOString();
|
|
846
|
+
let executor: NodeExecutor = noOpExecutor;
|
|
847
|
+
|
|
848
|
+
let lockAcquired = false;
|
|
849
|
+
let brief: SessionBrief | undefined;
|
|
850
|
+
let invocationRun: RunStateDocument | undefined;
|
|
851
|
+
const anomalies: DigestAnomaly[] = [];
|
|
852
|
+
|
|
853
|
+
const finish = async (
|
|
854
|
+
outcome: DigestOutcome,
|
|
855
|
+
extra: { advanced?: DigestAdvancedItem[]; parked?: DigestParkedItem[]; spend?: DigestSpendLine[] } = {},
|
|
856
|
+
exitCode = 0,
|
|
857
|
+
): Promise<number> => {
|
|
858
|
+
host.result = {
|
|
859
|
+
runId: invocationRun?.runId ?? null,
|
|
860
|
+
planId: invocationRun?.planId ?? null,
|
|
861
|
+
outcome,
|
|
862
|
+
completed: extra.advanced?.length ?? 0,
|
|
863
|
+
held: extra.parked?.length ?? 0,
|
|
864
|
+
};
|
|
865
|
+
if (host.request && invocationRun && lockAcquired) {
|
|
866
|
+
const record = invocationRun.publicRequests?.[host.request.id];
|
|
867
|
+
if (record) {
|
|
868
|
+
record.status = "completed";
|
|
869
|
+
record.result = host.result;
|
|
870
|
+
writeRunState(paths.runState, invocationRun);
|
|
871
|
+
writeCheckpoint(
|
|
872
|
+
paths.checkpoint,
|
|
873
|
+
buildCheckpoint(
|
|
874
|
+
invocationRun,
|
|
875
|
+
sessionId,
|
|
876
|
+
`checkpoint:${invocationRun.planId}:${invocationRun.runId}:${invocationRun.updatedAt}`,
|
|
877
|
+
invocationRun.updatedAt,
|
|
878
|
+
),
|
|
879
|
+
);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
if (host.request && !invocationRun) {
|
|
883
|
+
host.refusal = "business.preflight_refused";
|
|
884
|
+
if (lockAcquired) {
|
|
885
|
+
releaseLock(paths.sessionLock, sessionId);
|
|
886
|
+
lockAcquired = false;
|
|
887
|
+
}
|
|
888
|
+
return exitCode || 1;
|
|
889
|
+
}
|
|
890
|
+
const endedAt = new Date().toISOString();
|
|
891
|
+
const businessSlug = brief?.businessSlug ?? path.basename(workspace);
|
|
892
|
+
const loadedAppReview = readAppReviewState(paths.appReview);
|
|
893
|
+
let appReview: DigestInput["appReview"];
|
|
894
|
+
switch (loadedAppReview.status) {
|
|
895
|
+
case "missing":
|
|
896
|
+
appReview = undefined;
|
|
897
|
+
break;
|
|
898
|
+
case "ok":
|
|
899
|
+
{
|
|
900
|
+
const founder = projectAppReviewForFounder(loadedAppReview.state);
|
|
901
|
+
appReview = { summary: founder.summary, caseLines: founder.caseLines };
|
|
902
|
+
}
|
|
903
|
+
break;
|
|
904
|
+
case "invalid":
|
|
905
|
+
anomalies.push({ message: INVALID_APP_REVIEW_WATCH_SUMMARY });
|
|
906
|
+
appReview = { summary: INVALID_APP_REVIEW_WATCH_SUMMARY };
|
|
907
|
+
break;
|
|
908
|
+
default: {
|
|
909
|
+
const exhaustive: never = loadedAppReview;
|
|
910
|
+
throw new Error(`Unhandled App Review load status ${String(exhaustive)}`);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
const input: DigestInput = {
|
|
914
|
+
sessionId,
|
|
915
|
+
businessSlug,
|
|
916
|
+
startedAt,
|
|
917
|
+
endedAt,
|
|
918
|
+
outcome,
|
|
919
|
+
advanced: extra.advanced ?? [],
|
|
920
|
+
parked: extra.parked ?? [],
|
|
921
|
+
spend: extra.spend ?? [],
|
|
922
|
+
anomalies,
|
|
923
|
+
appReview,
|
|
924
|
+
};
|
|
925
|
+
const rendered = renderDigest(input);
|
|
926
|
+
const to = host.notifications ? brief?.founderContact?.email : undefined;
|
|
927
|
+
if (to) {
|
|
928
|
+
const push = await pushDigest(rendered, to);
|
|
929
|
+
if (push.attempted && push.ok === false)
|
|
930
|
+
anomalies.push({
|
|
931
|
+
message: `I tried to email you this update and it didn't go through (${push.error ?? "an unknown error"}). It's still saved in this business's digests folder.`,
|
|
932
|
+
});
|
|
933
|
+
input.push = push;
|
|
934
|
+
} else {
|
|
935
|
+
input.push = { attempted: false, skippedReason: "no founder contact on file" };
|
|
936
|
+
}
|
|
937
|
+
const final = renderDigest(input);
|
|
938
|
+
writeDigestFile(workspace, sessionId, final.markdown);
|
|
939
|
+
if (lockAcquired) {
|
|
940
|
+
try {
|
|
941
|
+
releaseLock(paths.sessionLock, sessionId);
|
|
942
|
+
} catch {
|
|
943
|
+
/* best effort: a digest was written regardless */
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
return exitCode;
|
|
947
|
+
};
|
|
948
|
+
|
|
949
|
+
try {
|
|
950
|
+
try {
|
|
951
|
+
brief = host.brief ?? loadBrief(resolveCallerPath(args.brief!));
|
|
952
|
+
} catch (error) {
|
|
953
|
+
const reason = error instanceof BriefInvalid ? error.issues.join("; ") : error instanceof Error ? error.message : String(error);
|
|
954
|
+
anomalies.push({ message: `I couldn't read the session instructions I was given (${reason}), so I stopped before touching anything.` });
|
|
955
|
+
return await finish("workspace_not_ready", {}, 1);
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
const executorMode = args.executor ?? "auto";
|
|
959
|
+
const requestedWorkerRuntime = args["worker-runtime"] ?? brief.workerRuntime ?? process.env.B2C_APP_BUILDER_WORKER_RUNTIME?.trim() ?? "auto";
|
|
960
|
+
if (!["auto", "claude", "codex", "cursor"].includes(requestedWorkerRuntime)) {
|
|
961
|
+
anomalies.push({
|
|
962
|
+
message: `The requested worker runtime "${requestedWorkerRuntime}" is not one of auto, claude, codex, or cursor (set --worker-runtime, the brief's workerRuntime, or B2C_APP_BUILDER_WORKER_RUNTIME), so I stopped before dispatching anything.`,
|
|
963
|
+
});
|
|
964
|
+
return await finish("workspace_not_ready", {}, 1);
|
|
965
|
+
}
|
|
966
|
+
const workerRuntime = requestedWorkerRuntime as WorkerRuntime;
|
|
967
|
+
const operationRoutes = host.operationRoutes ?? (executorMode === "auto" ? createFirstpartyWorkerRoutes(compatible.catalog, workerRuntime) : undefined);
|
|
968
|
+
executor =
|
|
969
|
+
executorMode === "fixture"
|
|
970
|
+
? createFixtureExecutor()
|
|
971
|
+
: executorMode === "slow-silent"
|
|
972
|
+
? createSlowSilentExecutor(Number(args["slow-delay-ms"] ?? 2000))
|
|
973
|
+
: executorMode === "noop"
|
|
974
|
+
? noOpExecutor
|
|
975
|
+
: createCliExecutor(workerRuntime, operationRoutes);
|
|
976
|
+
// Fresh-context verification is part of a session, not a separate ceremony someone must
|
|
977
|
+
// remember: the sweep below dispatches an independent judge for produced-but-unaccepted work.
|
|
978
|
+
// "off" is an explicit diagnostic override and is reported honestly in the digest — before
|
|
979
|
+
// this seam existed, every fresh-context node was a structural dead end (produced, parked
|
|
980
|
+
// "Verification required" forever) while the digest implied a check was underway.
|
|
981
|
+
// The default FOLLOWS the executor mode: a diagnostic session (fixture/slow-silent/noop
|
|
982
|
+
// executor) must never quietly spawn a real worker CLI to judge synthetic work — on a
|
|
983
|
+
// machine with codex/claude installed that would make fixture runs slow, nondeterministic,
|
|
984
|
+
// and silently expensive. Only a real session defaults to the real verifier.
|
|
985
|
+
const verifierMode = args.verifier ?? (executorMode === "fixture" ? "fixture" : executorMode === "auto" ? "cli" : "off");
|
|
986
|
+
const rejectedFixtureNodes = new Set<string>();
|
|
987
|
+
const verifier: NodeVerifier | undefined =
|
|
988
|
+
verifierMode === "off"
|
|
989
|
+
? undefined
|
|
990
|
+
: verifierMode === "fixture"
|
|
991
|
+
? createFixtureVerifier()
|
|
992
|
+
: ["fixture-reject-once", "fixture-repair-reviewed-once"].includes(verifierMode) && executorMode === "fixture"
|
|
993
|
+
? {
|
|
994
|
+
async verify(node, context) {
|
|
995
|
+
const verdict =
|
|
996
|
+
rejectedFixtureNodes.has(node.id) || (verifierMode === "fixture-repair-reviewed-once" && !node.reviewOf?.length) ? "accepted" : "rejected";
|
|
997
|
+
rejectedFixtureNodes.add(node.id);
|
|
998
|
+
const outcome = await createFixtureVerifier(verdict).verify(node, context);
|
|
999
|
+
return {
|
|
1000
|
+
...outcome,
|
|
1001
|
+
...(verdict === "rejected" && verifierMode === "fixture-repair-reviewed-once"
|
|
1002
|
+
? { repairWorkflowIds: node.reviewOf!.map((id) => `workflow.${id.slice("run.".length)}`) }
|
|
1003
|
+
: {}),
|
|
1004
|
+
};
|
|
1005
|
+
},
|
|
1006
|
+
}
|
|
1007
|
+
: verifierMode === "fixture-reject"
|
|
1008
|
+
? createFixtureVerifier("rejected")
|
|
1009
|
+
: createCliVerifier(workerRuntime, operationRoutes);
|
|
1010
|
+
|
|
1011
|
+
const lockTtlSeconds = Number(args["lock-ttl-seconds"] ?? 120);
|
|
1012
|
+
const acquireResult: AcquireResult = acquireLock(paths.sessionLock, {
|
|
1013
|
+
ownerSessionId: sessionId,
|
|
1014
|
+
ttlSeconds: lockTtlSeconds,
|
|
1015
|
+
retries: Number(args["lock-retries"] ?? 3),
|
|
1016
|
+
retryDelayMs: Number(args["lock-retry-delay-ms"] ?? 100),
|
|
1017
|
+
breakStale: args["break-stale-verified"] === "true",
|
|
1018
|
+
});
|
|
1019
|
+
if (!acquireResult.ok) {
|
|
1020
|
+
if (host.request) {
|
|
1021
|
+
host.refusal = "business.session_lock_unavailable";
|
|
1022
|
+
return 2;
|
|
1023
|
+
}
|
|
1024
|
+
const outcome: DigestOutcome = acquireResult.reason === "held" ? "did_not_run_lock_held" : "did_not_run_lock_stale";
|
|
1025
|
+
anomalies.push({
|
|
1026
|
+
message: `Another session (or one that may not have shut down cleanly) already had this business locked, so I backed off rather than risk a collision.`,
|
|
1027
|
+
});
|
|
1028
|
+
return await finish(outcome, {}, 2);
|
|
1029
|
+
}
|
|
1030
|
+
lockAcquired = true;
|
|
1031
|
+
if (host.request) {
|
|
1032
|
+
const existing = existsSync(paths.runState) ? loadRunState(paths.runState) : undefined;
|
|
1033
|
+
const previous =
|
|
1034
|
+
existing?.publicRequests && Object.hasOwn(existing.publicRequests, host.request.id) ? existing.publicRequests[host.request.id] : undefined;
|
|
1035
|
+
if (previous) {
|
|
1036
|
+
host.refusal =
|
|
1037
|
+
previous.requestDigest !== host.request.digest
|
|
1038
|
+
? "business.request_conflict"
|
|
1039
|
+
: previous.status !== "completed" || !previous.result
|
|
1040
|
+
? "business.request_recovery_required"
|
|
1041
|
+
: undefined;
|
|
1042
|
+
if (!host.refusal) {
|
|
1043
|
+
host.result = previous.result;
|
|
1044
|
+
host.replayed = true;
|
|
1045
|
+
}
|
|
1046
|
+
releaseLock(paths.sessionLock, sessionId);
|
|
1047
|
+
lockAcquired = false;
|
|
1048
|
+
return host.refusal ? 4 : 0;
|
|
1049
|
+
}
|
|
1050
|
+
if (Object.values(existing?.publicRequests ?? {}).some((record) => record.status === "running")) {
|
|
1051
|
+
host.refusal = "business.request_recovery_required";
|
|
1052
|
+
releaseLock(paths.sessionLock, sessionId);
|
|
1053
|
+
lockAcquired = false;
|
|
1054
|
+
return 4;
|
|
1055
|
+
}
|
|
1056
|
+
if (workspaceRevision(workspace) !== host.request.expectedRevision) {
|
|
1057
|
+
host.refusal = "business.stale_revision";
|
|
1058
|
+
releaseLock(paths.sessionLock, sessionId);
|
|
1059
|
+
lockAcquired = false;
|
|
1060
|
+
return 4;
|
|
1061
|
+
}
|
|
1062
|
+
compatible = loadWorkspaceCatalog(workspace);
|
|
1063
|
+
if (!compatible.ok) {
|
|
1064
|
+
host.refusal = "business.catalog_unavailable";
|
|
1065
|
+
releaseLock(paths.sessionLock, sessionId);
|
|
1066
|
+
lockAcquired = false;
|
|
1067
|
+
return 4;
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
if (!tamperCheckPasses(paths)) {
|
|
1072
|
+
anomalies.push({
|
|
1073
|
+
message:
|
|
1074
|
+
"This business's saved files don't match what I last recorded — something changed them outside of my normal process. I stopped before making anything worse.",
|
|
1075
|
+
});
|
|
1076
|
+
return await finish("preflight_failed", {}, 3);
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
const control = loadControlFile(paths.control);
|
|
1080
|
+
if (!control) {
|
|
1081
|
+
anomalies.push({ message: "This business isn't set up yet — I couldn't find its control settings." });
|
|
1082
|
+
return await finish("workspace_not_ready", {}, 1);
|
|
1083
|
+
}
|
|
1084
|
+
// No refusal for an ungranted business: zero grants is an ordinary cold start, not a broken
|
|
1085
|
+
// workspace. plan.ts and bootstrap.ts both report it and exit 0, and control.json cannot tell
|
|
1086
|
+
// "never onboarded" from an onboard whose `units` was empty, so a grants-empty refusal would
|
|
1087
|
+
// eventually reject a genuinely onboarded business. Every node parks through the ordinary
|
|
1088
|
+
// evaluator path and the digest explains the missing authority in founder language.
|
|
1089
|
+
|
|
1090
|
+
// Disclosure, not a gate (see buildControlBoundaryAnomaly's doc comment): evaluated every
|
|
1091
|
+
// session, before dispatch and before the kill switch even short-circuits, so a standing
|
|
1092
|
+
// configuration gap is surfaced regardless of whether work happens this run.
|
|
1093
|
+
const boundaryVerdict = verifyControlBoundary(workspace);
|
|
1094
|
+
const boundaryCommand = `tsx ${path.join(skillRoot(), "adapters/install-control-permissions.ts")} --workspace ${workspace} --apply`;
|
|
1095
|
+
const boundaryAnomaly = buildControlBoundaryAnomaly(control, boundaryVerdict, boundaryCommand);
|
|
1096
|
+
if (boundaryAnomaly) {
|
|
1097
|
+
// Technical detail stays in the run log; the digest only ever gets the founder-plain sentence.
|
|
1098
|
+
if (!host.request)
|
|
1099
|
+
console.error(
|
|
1100
|
+
`session.control_boundary: state=${boundaryVerdict.state} agentUidDiffers=${boundaryVerdict.agentUidDiffers} mode=${boundaryVerdict.controlMode} ownerUid=${boundaryVerdict.ownerUid} processUid=${boundaryVerdict.processUid} reasons=${JSON.stringify(boundaryVerdict.reasons)}`,
|
|
1101
|
+
);
|
|
1102
|
+
anomalies.push(boundaryAnomaly);
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
if (control.killSwitch.engaged) {
|
|
1106
|
+
return await finish("parked_kill_switch", {}, 0);
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
const businessState = loadBusinessStateFile(paths.state);
|
|
1110
|
+
if (!businessState) {
|
|
1111
|
+
anomalies.push({ message: "This business isn't set up yet — I couldn't find its saved progress." });
|
|
1112
|
+
return await finish("workspace_not_ready", {}, 1);
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
const sessionNow = () => new Date().toISOString();
|
|
1116
|
+
let ledger = loadLedgerFile(paths.ledger, startedAt);
|
|
1117
|
+
const catalog = compatible.catalog;
|
|
1118
|
+
const explicitCatalogVersion = brief.expectedCatalogVersion ?? process.env.B2C_EXPECTED_CATALOG_VERSION;
|
|
1119
|
+
const installedCatalogVersion = runtimeCatalogVersion(workspace);
|
|
1120
|
+
if (explicitCatalogVersion && installedCatalogVersion && explicitCatalogVersion !== installedCatalogVersion) {
|
|
1121
|
+
throw new Error(`catalog.version_binding_conflict: brief expected ${explicitCatalogVersion}, installed runtime expected ${installedCatalogVersion}`);
|
|
1122
|
+
}
|
|
1123
|
+
assertCatalogCompatibility(catalog, explicitCatalogVersion ?? installedCatalogVersion);
|
|
1124
|
+
const plan = compilePlan(catalog, startedAt);
|
|
1125
|
+
|
|
1126
|
+
// budget_funded closes over this ledger snapshot (captured once, before dispatch starts) —
|
|
1127
|
+
// see kernel/autonomy/probes/budget.ts's doc comment on why a snapshot is the correct semantics
|
|
1128
|
+
// for a "verified at most once per session" prerequisite, not a live-reread.
|
|
1129
|
+
const prerequisiteVerifier = createCompositeVerifier({
|
|
1130
|
+
doppler_auth: createDopplerAuthVerifier({
|
|
1131
|
+
project: args["doppler-project"] ?? control.businessSlug,
|
|
1132
|
+
config: args["doppler-config"] ?? "production",
|
|
1133
|
+
secretsMdPath: args["secrets-md"] ?? path.join(workspace, "SECRETS.md"),
|
|
1134
|
+
}),
|
|
1135
|
+
budget_funded: createBudgetFundedVerifier(ledger),
|
|
1136
|
+
});
|
|
1137
|
+
|
|
1138
|
+
const wallClockCapSeconds = Number(args["wall-clock-seconds"] ?? brief.wallClockSecondsOverride ?? 1800);
|
|
1139
|
+
|
|
1140
|
+
const resumedExistingRun = existsSync(paths.runState);
|
|
1141
|
+
let run = (() => {
|
|
1142
|
+
if (resumedExistingRun) {
|
|
1143
|
+
const existing = loadRunState(paths.runState);
|
|
1144
|
+
if (existing.planId !== plan.planId) {
|
|
1145
|
+
anomalies.push({ message: "The plan changed. I preserved prior attempts and approvals, and reopened work whose evidence no longer satisfies it." });
|
|
1146
|
+
return reconcileRunPlan(plan, existing, businessState, { ownerSessionId: sessionId, ttlSeconds: 300, wallClockCapSeconds, now: startedAt });
|
|
1147
|
+
}
|
|
1148
|
+
return existing;
|
|
1149
|
+
}
|
|
1150
|
+
return undefined;
|
|
1151
|
+
})();
|
|
1152
|
+
|
|
1153
|
+
let orphanEvents: OrphanEvent[] = [];
|
|
1154
|
+
if (run) {
|
|
1155
|
+
run.ownerSessionId = sessionId;
|
|
1156
|
+
run.wallClockCapSeconds = wallClockCapSeconds;
|
|
1157
|
+
orphanEvents = detectOrphans(plan, run, startedAt);
|
|
1158
|
+
for (const event of orphanEvents) {
|
|
1159
|
+
const title = plan.nodes.find((node) => node.id === event.nodeId)?.title ?? event.nodeId;
|
|
1160
|
+
anomalies.push({ message: orphanSentence(event, title) });
|
|
1161
|
+
}
|
|
1162
|
+
} else {
|
|
1163
|
+
run = seedRunState(plan, businessState, { ownerSessionId: sessionId, ttlSeconds: 300, wallClockCapSeconds, now: startedAt });
|
|
1164
|
+
}
|
|
1165
|
+
if (host.request) {
|
|
1166
|
+
invocationRun = run;
|
|
1167
|
+
(run.publicRequests ??= {})[host.request.id] = { requestDigest: host.request.digest, sessionId, status: "running" };
|
|
1168
|
+
writeRunState(paths.runState, run);
|
|
1169
|
+
}
|
|
1170
|
+
// Signed design authority is optional for work that does not need it, but once a run binds
|
|
1171
|
+
// trust it must revalidate the exact external store and audit edge before any worker starts.
|
|
1172
|
+
// A store that appears after an unbound run began cannot retroactively become that run's
|
|
1173
|
+
// trust root. The autonomous process also proves that its OS identity cannot replace the
|
|
1174
|
+
// founder-owned public-key store. The public key is readable by design; workers never receive
|
|
1175
|
+
// the launcher path override or any private signing material.
|
|
1176
|
+
let founderTrustStore: LoadedFounderTrustStore | undefined;
|
|
1177
|
+
const founderTrustPath = resolveFounderTrustFile();
|
|
1178
|
+
const founderTrustConfigured = Boolean(process.env[FOUNDER_TRUST_FILE_ENV]?.trim()) || existsSync(founderTrustPath);
|
|
1179
|
+
if (run.founderDecisionTrust || founderTrustConfigured) {
|
|
1180
|
+
founderTrustStore = loadFounderTrustStore({ role: "autonomous_session" });
|
|
1181
|
+
if (run.founderDecisionTrust) {
|
|
1182
|
+
assertFounderTrustBinding(run, { workspaceRoot: workspace, auditPath: paths.audit, store: founderTrustStore });
|
|
1183
|
+
} else if (!resumedExistingRun) {
|
|
1184
|
+
bindFounderTrustToNewRun(run, {
|
|
1185
|
+
workspaceRoot: workspace,
|
|
1186
|
+
auditPath: paths.audit,
|
|
1187
|
+
runStatePath: paths.runState,
|
|
1188
|
+
sessionId,
|
|
1189
|
+
store: founderTrustStore,
|
|
1190
|
+
boundAt: startedAt,
|
|
1191
|
+
});
|
|
1192
|
+
} else {
|
|
1193
|
+
recoverFounderTrustBindingFromAudit(run, { workspaceRoot: workspace, auditPath: paths.audit, store: founderTrustStore });
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
// Producer-less artifacts (the workspace's own files) accept from disk presence — without
|
|
1197
|
+
// this, a fresh business's plan has no root nodes at all. Runs on resume too, so a
|
|
1198
|
+
// precondition that changed between sessions invalidates its descendants before dispatch.
|
|
1199
|
+
reconcileEnvironmentalArtifacts(plan, run, workspace, startedAt);
|
|
1200
|
+
// The operating loop: recurring nodes (weekly ops review, growth iteration) whose cadence
|
|
1201
|
+
// has elapsed reopen before the frontier is computed, so a scheduled session finds the
|
|
1202
|
+
// standing work on its own calendar instead of the founder having to re-ask for it.
|
|
1203
|
+
reopenRecurringNodes(plan, run, startedAt);
|
|
1204
|
+
reopenNodesForAuthorizedWorkOrders(plan, run, startedAt);
|
|
1205
|
+
const dueReviews = dueWorkOrderReviews(run, startedAt);
|
|
1206
|
+
if (dueReviews.length > 0) {
|
|
1207
|
+
appendAuditEntry(paths.audit, {
|
|
1208
|
+
sessionId,
|
|
1209
|
+
targetDoc: "run-state",
|
|
1210
|
+
patchId: `work-order-review:${sessionId}`,
|
|
1211
|
+
action: "work_order_review_due",
|
|
1212
|
+
summary: dueReviews.map((occurrence) => occurrence.id).join(","),
|
|
1213
|
+
stateHash: "",
|
|
1214
|
+
issueCodes: [],
|
|
1215
|
+
});
|
|
1216
|
+
}
|
|
1217
|
+
observeAppSourceFingerprint(plan, run, workspace, startedAt);
|
|
1218
|
+
invalidateStaleReviews(plan, run, workspace, startedAt);
|
|
1219
|
+
writeRunState(paths.runState, run);
|
|
1220
|
+
|
|
1221
|
+
const dispatchHooks: DispatchHooks = createDispatchHooks({
|
|
1222
|
+
loadControl: () => loadControlFile(paths.control)!,
|
|
1223
|
+
lockPath: paths.sessionLock,
|
|
1224
|
+
ownerSessionId: sessionId,
|
|
1225
|
+
});
|
|
1226
|
+
// Pass the ledger as a live accessor, not a snapshot: `ledger` is reassigned after every
|
|
1227
|
+
// spend commit below, and the evaluator must see the true remaining balance so independently
|
|
1228
|
+
// scoped spend nodes cannot each pass the hard-stop while collectively overrunning the budget (R10).
|
|
1229
|
+
const evaluator = createAutonomyEvaluator({
|
|
1230
|
+
grants: control.grants,
|
|
1231
|
+
waivers: control.waivers,
|
|
1232
|
+
ledger: () => ledger,
|
|
1233
|
+
prerequisiteVerifier,
|
|
1234
|
+
runId: run.runId,
|
|
1235
|
+
authority: catalog.authority,
|
|
1236
|
+
});
|
|
1237
|
+
const decisions = new Map<string, AutonomyDecisionDetail>();
|
|
1238
|
+
const captured = withCapture(evaluator, decisions);
|
|
1239
|
+
|
|
1240
|
+
const advanced: DigestAdvancedItem[] = [];
|
|
1241
|
+
let haltReason: BatchHaltReason | undefined;
|
|
1242
|
+
let timedOut = false;
|
|
1243
|
+
|
|
1244
|
+
/**
|
|
1245
|
+
* Fresh-context verification sweep, run at every empty-frontier point inside the dispatch
|
|
1246
|
+
* loop: an accepted node re-opens the frontier, so downstream work dispatches in THIS
|
|
1247
|
+
* session instead of parking until the next one. The judge is a separate verifier session
|
|
1248
|
+
* id that owns no attempts (the same refusal rules kernel/session/verify.ts enforces, from the
|
|
1249
|
+
* shared module), its worker runs in a fresh subprocess context, and every acceptance is
|
|
1250
|
+
* attested in the hash-chained audit log exactly like the operator CLI's. Accepted work and
|
|
1251
|
+
* bounded queued repair count as progress. An unavailable verifier or exhausted repair
|
|
1252
|
+
* budget leaves no new dispatch work, so the caller stops.
|
|
1253
|
+
*/
|
|
1254
|
+
const verifierSessionId = `${sessionId}.verifier`;
|
|
1255
|
+
const scopedRefreshDependencyIds = new Set<RunNodeId>();
|
|
1256
|
+
const failedScopedRefreshDependencyIds = new Set<RunNodeId>();
|
|
1257
|
+
// A cooperative yield's final sweep is deliberately narrower than an ordinary empty-frontier
|
|
1258
|
+
// sweep. It may judge only exact attempts that THIS session moved into fresh-context pending
|
|
1259
|
+
// state in a fully completed dispatch batch. Older durable pending work remains discoverable
|
|
1260
|
+
// by ordinary sweeps, but a yield before any batch must not opportunistically judge it.
|
|
1261
|
+
const cooperativeYieldCandidateAttempts = new Map<RunNodeId, string>();
|
|
1262
|
+
const runVerificationSweep = async (allowCooperativeYield = false, candidateAttempts?: ReadonlyMap<RunNodeId, string>): Promise<number> => {
|
|
1263
|
+
if (!verifier) return 0;
|
|
1264
|
+
const allPending = listPendingSessionReviews(plan, run);
|
|
1265
|
+
const allPendingSet = new Set(allPending);
|
|
1266
|
+
// Retire an exact candidate only when that attempt is no longer the pending attempt. A
|
|
1267
|
+
// still-pending, unvisited candidate survives a boundary interruption for the final sweep.
|
|
1268
|
+
for (const [nodeId, attemptId] of cooperativeYieldCandidateAttempts) {
|
|
1269
|
+
const latestAttempt = run.nodes[nodeId]?.attempts.at(-1);
|
|
1270
|
+
if (!allPendingSet.has(nodeId) || latestAttempt?.id !== attemptId) cooperativeYieldCandidateAttempts.delete(nodeId);
|
|
1271
|
+
}
|
|
1272
|
+
const pending = allPending.filter((nodeId) => {
|
|
1273
|
+
const node = plan.nodes.find((candidate) => candidate.id === nodeId)!;
|
|
1274
|
+
const inScope = nodeInScope(brief!.scopeHints, node.domainId, node.workflowId) || scopedRefreshDependencyIds.has(nodeId);
|
|
1275
|
+
if (!inScope) return false;
|
|
1276
|
+
if (!candidateAttempts) return true;
|
|
1277
|
+
return candidateAttempts.get(nodeId) === run.nodes[nodeId]?.attempts.at(-1)?.id;
|
|
1278
|
+
});
|
|
1279
|
+
let progressCount = 0;
|
|
1280
|
+
for (const nodeId of pending) {
|
|
1281
|
+
if (deferredSharedReviews.has(nodeId)) continue;
|
|
1282
|
+
if (isWallClockExceeded(run, sessionNow(), startedAt)) {
|
|
1283
|
+
timedOut = true;
|
|
1284
|
+
break;
|
|
1285
|
+
}
|
|
1286
|
+
let boundary;
|
|
1287
|
+
try {
|
|
1288
|
+
boundary = checkBatchBoundary(dispatchHooks);
|
|
1289
|
+
} catch {
|
|
1290
|
+
haltReason = "kill_switch";
|
|
1291
|
+
break;
|
|
1292
|
+
}
|
|
1293
|
+
if (boundary.halt && !(allowCooperativeYield && boundary.reason === "cooperative_yield")) {
|
|
1294
|
+
haltReason = boundary.reason;
|
|
1295
|
+
break;
|
|
1296
|
+
}
|
|
1297
|
+
heartbeat(paths.sessionLock, sessionId);
|
|
1298
|
+
const node = plan.nodes.find((candidate) => candidate.id === nodeId)!;
|
|
1299
|
+
const state = run.nodes[nodeId]!;
|
|
1300
|
+
const attempt = state.attempts.at(-1);
|
|
1301
|
+
const rejectionOnly = hasCurrentFailedAuditGates(plan, run, nodeId);
|
|
1302
|
+
const refusal = refuseFreshContextAcceptance(plan, run, nodeId, verifierSessionId);
|
|
1303
|
+
if (refusal && !(rejectionOnly && refusal.code === "gates_required")) {
|
|
1304
|
+
// The sweep listed this node moments ago, so a refusal here is an internal
|
|
1305
|
+
// inconsistency worth an operator's eyes — never silently skipped.
|
|
1306
|
+
if (!host.request) console.error(`session.verify_refused ${nodeId}: ${refusal.code}: ${refusal.message}`);
|
|
1307
|
+
continue;
|
|
1308
|
+
}
|
|
1309
|
+
const outputs: VerifierOutputRef[] = node.outputs.map((artifactId) => {
|
|
1310
|
+
const binding = run.artifactBindings.find((candidate) => candidate.artifactId === artifactId);
|
|
1311
|
+
return { artifactId, path: binding?.path ?? "", evidence: attempt?.evidence ?? [] };
|
|
1312
|
+
});
|
|
1313
|
+
let reviewReceipt;
|
|
1314
|
+
try {
|
|
1315
|
+
reviewReceipt = captureReviewEvidence(
|
|
1316
|
+
plan,
|
|
1317
|
+
run,
|
|
1318
|
+
nodeId,
|
|
1319
|
+
workspace,
|
|
1320
|
+
verifierSessionId,
|
|
1321
|
+
sessionNow(),
|
|
1322
|
+
attempt?.proofSource === "synthetic" ? "synthetic" : "workspace",
|
|
1323
|
+
);
|
|
1324
|
+
} catch {
|
|
1325
|
+
const repairAt = sessionNow();
|
|
1326
|
+
const findings = ["Review evidence is missing or changed; restore the current artifacts and criteria before review."];
|
|
1327
|
+
progressCount += DESIGN_AUDIT_WORKFLOW_IDS.has(node.workflowId)
|
|
1328
|
+
? queueDesignAuditOnlyRetry(plan, run, nodeId, findings, repairAt)
|
|
1329
|
+
: requestVerificationRepair(plan, run, nodeId, findings, repairAt).length;
|
|
1330
|
+
writeRunState(paths.runState, run);
|
|
1331
|
+
anomalies.push({ message: `I could not verify the current files for "${node.title}", so its work remains incomplete.` });
|
|
1332
|
+
continue;
|
|
1333
|
+
}
|
|
1334
|
+
const reviewClaims: SharedClaim[] = [];
|
|
1335
|
+
const reviewTtl = Math.min(86400, Math.max(node.ttlSeconds, lockTtlSeconds));
|
|
1336
|
+
for (const resource of [...(node.sharedResources ?? [])].sort()) {
|
|
1337
|
+
const acquired = acquireSharedClaim({
|
|
1338
|
+
home: sharedHome,
|
|
1339
|
+
resource,
|
|
1340
|
+
workspaceId: sharedWorkspaceIdentity(),
|
|
1341
|
+
occurrenceId: `${run.runId}:${nodeId}:${attempt?.id}:review`,
|
|
1342
|
+
ttlSeconds: reviewTtl,
|
|
1343
|
+
now: sessionNow(),
|
|
1344
|
+
});
|
|
1345
|
+
if (!acquired.ok) {
|
|
1346
|
+
for (const claim of reviewClaims) releaseSharedClaim(sharedHome, claim, { now: sessionNow() });
|
|
1347
|
+
deferredSharedReviews.add(nodeId);
|
|
1348
|
+
anomalies.push({
|
|
1349
|
+
message: `The shared device or provider project for the independent check of "${node.title}" is unavailable. I kept its review pending.`,
|
|
1350
|
+
});
|
|
1351
|
+
break;
|
|
1352
|
+
}
|
|
1353
|
+
reviewClaims.push(acquired.claim);
|
|
1354
|
+
}
|
|
1355
|
+
if (deferredSharedReviews.has(nodeId)) continue;
|
|
1356
|
+
let reviewOwnershipLost = false;
|
|
1357
|
+
let reviewReconciled = false;
|
|
1358
|
+
const assertReviewOwnership = (): void => {
|
|
1359
|
+
if (reviewOwnershipLost) throw new Error("shared_claim.ownership_lost");
|
|
1360
|
+
for (const claim of reviewClaims) assertSharedClaim(sharedHome, claim, sessionNow());
|
|
1361
|
+
};
|
|
1362
|
+
const parkReviewReadback = (): void => {
|
|
1363
|
+
deferredSharedReviews.add(nodeId);
|
|
1364
|
+
state.status = "needs_readback";
|
|
1365
|
+
state.blocker = "A shared resource needs reconciliation before independent review can resume.";
|
|
1366
|
+
state.acceptedOutputFingerprint = undefined;
|
|
1367
|
+
state.verifiedBySessionId = undefined;
|
|
1368
|
+
if (attempt) {
|
|
1369
|
+
attempt.status = "needs_readback";
|
|
1370
|
+
attempt.finishedAt = sessionNow();
|
|
1371
|
+
attempt.independentVerification = undefined;
|
|
1372
|
+
}
|
|
1373
|
+
for (const binding of run.artifactBindings) if (node.outputs.includes(binding.artifactId as never)) binding.accepted = false;
|
|
1374
|
+
invalidateDescendants(plan, run, node.outputs, sessionNow());
|
|
1375
|
+
writeRunState(paths.runState, run);
|
|
1376
|
+
};
|
|
1377
|
+
const reviewRuntimeWrites = node.sourceAccess?.length || node.selectedOperation ? trackRuntimeWrites(workspace) : undefined;
|
|
1378
|
+
const reviewTimer = setInterval(
|
|
1379
|
+
() => {
|
|
1380
|
+
try {
|
|
1381
|
+
for (let index = 0; index < reviewClaims.length; index++)
|
|
1382
|
+
reviewClaims[index] = renewSharedClaim(sharedHome, reviewClaims[index]!, reviewTtl, sessionNow());
|
|
1383
|
+
if (reviewRuntimeWrites) reviewRuntimeWrites.write("control/session.lock", () => heartbeat(paths.sessionLock, sessionId));
|
|
1384
|
+
else heartbeat(paths.sessionLock, sessionId);
|
|
1385
|
+
} catch {
|
|
1386
|
+
reviewOwnershipLost = true;
|
|
1387
|
+
}
|
|
1388
|
+
},
|
|
1389
|
+
Math.max(50, (Math.min(reviewTtl, lockTtlSeconds) * 1000) / 3),
|
|
1390
|
+
);
|
|
1391
|
+
reviewTimer.unref();
|
|
1392
|
+
try {
|
|
1393
|
+
const reviewNode = rejectionOnly
|
|
1394
|
+
? {
|
|
1395
|
+
...node,
|
|
1396
|
+
instructions: `${node.instructions ?? ""}\n\nThe current attempt failed these mechanical checks: ${attempt!.deterministicVerification!.evidence.join("; ")}. This is a rejection-only review. Return rejected with actionable findings and repairWorkflowIds naming only declared reviewOf producers. The audit must never nominate itself. Do not accept the candidate, repair files, or weaken the checks.`,
|
|
1397
|
+
}
|
|
1398
|
+
: node;
|
|
1399
|
+
assertReviewOwnership();
|
|
1400
|
+
const outcome = await verifier.verify(reviewNode, {
|
|
1401
|
+
runtimeWrites: reviewRuntimeWrites?.snapshot,
|
|
1402
|
+
runId: run.runId,
|
|
1403
|
+
inputFingerprint: attempt?.inputFingerprint,
|
|
1404
|
+
workspaceDir: workspace,
|
|
1405
|
+
skillRootDir: skillRoot(),
|
|
1406
|
+
outputs,
|
|
1407
|
+
now: sessionNow(),
|
|
1408
|
+
});
|
|
1409
|
+
reviewRuntimeWrites?.assertIntact();
|
|
1410
|
+
assertReviewOwnership();
|
|
1411
|
+
// This exact candidate has now been judged (accepted/rejected) or attempted
|
|
1412
|
+
// (unavailable). Retire it individually; never clear the whole cohort, because a normal
|
|
1413
|
+
// sweep can be interrupted between candidates and the unvisited remainder still needs
|
|
1414
|
+
// the cooperative-yield final pass.
|
|
1415
|
+
cooperativeYieldCandidateAttempts.delete(nodeId);
|
|
1416
|
+
const judgedAt = sessionNow();
|
|
1417
|
+
const reviewIssues = validateReviewReceipt(plan, run, nodeId, reviewReceipt, workspace).filter(
|
|
1418
|
+
(issue) => !(rejectionOnly && hasCurrentFailedAuditGates(plan, run, nodeId) && issue === "review.gates_missing_or_stale"),
|
|
1419
|
+
);
|
|
1420
|
+
if (reviewIssues.length) {
|
|
1421
|
+
const findings = ["Artifacts or criteria changed during review; run the checks and review again."];
|
|
1422
|
+
progressCount += DESIGN_AUDIT_WORKFLOW_IDS.has(node.workflowId)
|
|
1423
|
+
? queueDesignAuditOnlyRetry(plan, run, nodeId, findings, judgedAt)
|
|
1424
|
+
: requestVerificationRepair(plan, run, nodeId, findings, judgedAt).length;
|
|
1425
|
+
assertReviewOwnership();
|
|
1426
|
+
writeRunState(paths.runState, run);
|
|
1427
|
+
reviewReconciled = true;
|
|
1428
|
+
continue;
|
|
1429
|
+
}
|
|
1430
|
+
if (rejectionOnly && outcome.status === "accepted") {
|
|
1431
|
+
const evidence = [
|
|
1432
|
+
"Acceptance refused: the current attempt still has failed mechanical checks.",
|
|
1433
|
+
...attempt!.deterministicVerification!.evidence,
|
|
1434
|
+
outcome.evidence,
|
|
1435
|
+
];
|
|
1436
|
+
recordRejectedVerification(plan, run, nodeId, evidence, judgedAt, reviewReceipt, "failed");
|
|
1437
|
+
state.blocker = VERIFICATION_REJECTED_BLOCKER;
|
|
1438
|
+
const repaired = requestVerificationRepair(plan, run, nodeId, evidence, judgedAt);
|
|
1439
|
+
progressCount += repaired.length;
|
|
1440
|
+
run.updatedAt = judgedAt;
|
|
1441
|
+
anomalies.push({
|
|
1442
|
+
message: repaired.length
|
|
1443
|
+
? `The independent check could not accept "${node.title}" while its required checks still fail. I queued its declared producer for repair.`
|
|
1444
|
+
: `The independent check could not accept "${node.title}" while its required checks still fail. I kept the work incomplete.`,
|
|
1445
|
+
});
|
|
1446
|
+
} else if (outcome.status === "accepted") {
|
|
1447
|
+
try {
|
|
1448
|
+
assertReviewOwnership();
|
|
1449
|
+
acceptVerification(plan, run, nodeId, [outcome.evidence], judgedAt, verifierSessionId, reviewReceipt, workspace, runtimeObservation);
|
|
1450
|
+
} catch (error) {
|
|
1451
|
+
if (reviewClaims.length) parkReviewReadback();
|
|
1452
|
+
if (!host.request) console.error(`session.verify_accept_failed ${nodeId}: ${error instanceof Error ? error.message : String(error)}`);
|
|
1453
|
+
continue;
|
|
1454
|
+
}
|
|
1455
|
+
assertReviewOwnership();
|
|
1456
|
+
appendAuditEntry(paths.audit, {
|
|
1457
|
+
sessionId: verifierSessionId,
|
|
1458
|
+
targetDoc: "run-state",
|
|
1459
|
+
patchId: `verify:${verifierSessionId}:${nodeId}`,
|
|
1460
|
+
action: "verification_accepted",
|
|
1461
|
+
summary: `${nodeId}: ${outcome.evidence}`,
|
|
1462
|
+
stateHash: "",
|
|
1463
|
+
issueCodes: [],
|
|
1464
|
+
});
|
|
1465
|
+
advanced.push({ nodeId, title: node.title, unit: domainBusinessUnit(node.domainId, catalog.authority) });
|
|
1466
|
+
progressCount += 1;
|
|
1467
|
+
} else if (outcome.status === "rejected") {
|
|
1468
|
+
recordRejectedVerification(
|
|
1469
|
+
plan,
|
|
1470
|
+
run,
|
|
1471
|
+
nodeId,
|
|
1472
|
+
[outcome.evidence],
|
|
1473
|
+
judgedAt,
|
|
1474
|
+
reviewReceipt,
|
|
1475
|
+
rejectionOnly ? "failed" : "checked",
|
|
1476
|
+
);
|
|
1477
|
+
state.blocker = VERIFICATION_REJECTED_BLOCKER;
|
|
1478
|
+
const repaired = requestVerificationRepair(plan, run, nodeId, [outcome.evidence], judgedAt, outcome.repairWorkflowIds);
|
|
1479
|
+
progressCount += repaired.length;
|
|
1480
|
+
run.updatedAt = judgedAt;
|
|
1481
|
+
anomalies.push({
|
|
1482
|
+
message: repaired.length
|
|
1483
|
+
? `The review found unfinished work in "${node.title}". I queued its findings for repair under the current mandate.`
|
|
1484
|
+
: `The review found unfinished work in "${node.title}", and repair needs attention before it can continue.`,
|
|
1485
|
+
});
|
|
1486
|
+
} else {
|
|
1487
|
+
// Unavailable judged nothing: the node keeps its "Verification required" blocker so a
|
|
1488
|
+
// future session's sweep (or the operator CLI) picks it up, and this session says so.
|
|
1489
|
+
if (!host.request) console.error(`session.verifier_unavailable ${nodeId}: ${outcome.error ?? "unknown"}`);
|
|
1490
|
+
anomalies.push({
|
|
1491
|
+
message: `I finished "${node.title}" but couldn't run the independent double-check on it this session, so I'm not calling it done yet.`,
|
|
1492
|
+
});
|
|
1493
|
+
}
|
|
1494
|
+
assertReviewOwnership();
|
|
1495
|
+
writeRunState(paths.runState, run);
|
|
1496
|
+
reviewReconciled = true;
|
|
1497
|
+
} catch (error) {
|
|
1498
|
+
if (!reviewClaims.length) throw error;
|
|
1499
|
+
parkReviewReadback();
|
|
1500
|
+
} finally {
|
|
1501
|
+
clearInterval(reviewTimer);
|
|
1502
|
+
if (reviewReconciled) {
|
|
1503
|
+
try {
|
|
1504
|
+
assertReviewOwnership();
|
|
1505
|
+
for (const claim of reviewClaims) releaseSharedClaim(sharedHome, claim, { now: sessionNow() });
|
|
1506
|
+
} catch {
|
|
1507
|
+
if (reviewClaims.length) parkReviewReadback();
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
return progressCount;
|
|
1513
|
+
};
|
|
1514
|
+
|
|
1515
|
+
const sharedHome = b2cAppBuilderHome();
|
|
1516
|
+
const deferredSharedResources = new Map<RunNodeId, string>();
|
|
1517
|
+
const deferredSharedReviews = new Set<RunNodeId>();
|
|
1518
|
+
const sharedWaitReason = "A shared resource is in use; this work will resume in a later session.";
|
|
1519
|
+
// Only a contention deferral is automatically eligible next session. An uncertain
|
|
1520
|
+
// effect stays needs_readback until explicit recovery reconciles it.
|
|
1521
|
+
for (const node of plan.nodes) {
|
|
1522
|
+
const state = run.nodes[node.id];
|
|
1523
|
+
if (node.sharedResources?.length && state?.status === "blocked" && state.blocker === sharedWaitReason) {
|
|
1524
|
+
state.status = "pending";
|
|
1525
|
+
state.blocker = undefined;
|
|
1526
|
+
}
|
|
1527
|
+
}
|
|
1528
|
+
const sharedWorkspaceIdentity = (): string => {
|
|
1529
|
+
const canonical = realpathSync(workspace);
|
|
1530
|
+
const registered = loadRegistry().workspaces.find((entry) => {
|
|
1531
|
+
try {
|
|
1532
|
+
return realpathSync(entry.path) === canonical;
|
|
1533
|
+
} catch {
|
|
1534
|
+
return false;
|
|
1535
|
+
}
|
|
1536
|
+
});
|
|
1537
|
+
return registered ? `registered:${registered.id}` : `path:${createHash("sha256").update(canonical).digest("hex")}`;
|
|
1538
|
+
};
|
|
1539
|
+
dispatchLoop: while (true) {
|
|
1540
|
+
const now = sessionNow();
|
|
1541
|
+
if (isWallClockExceeded(run, now, startedAt)) {
|
|
1542
|
+
timedOut = true;
|
|
1543
|
+
break;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
let boundary;
|
|
1547
|
+
try {
|
|
1548
|
+
boundary = checkBatchBoundary(dispatchHooks);
|
|
1549
|
+
} catch {
|
|
1550
|
+
anomalies.push({ message: "I couldn't confirm it was still safe to continue, so I stopped rather than guess." });
|
|
1551
|
+
haltReason = "kill_switch";
|
|
1552
|
+
break;
|
|
1553
|
+
}
|
|
1554
|
+
if (boundary.halt) {
|
|
1555
|
+
haltReason = boundary.reason;
|
|
1556
|
+
break;
|
|
1557
|
+
}
|
|
1558
|
+
// Re-run the tamper check at every batch boundary, not only at session start: a same-session
|
|
1559
|
+
// out-of-band edit to control/state/ledger (e.g. re-disabling a kill switch, self-granting)
|
|
1560
|
+
// or a forged audit entry is caught before the next batch dispatches, not next session (R14).
|
|
1561
|
+
if (!tamperCheckPasses(paths)) {
|
|
1562
|
+
anomalies.push({
|
|
1563
|
+
message:
|
|
1564
|
+
"Partway through, this business's saved files stopped matching what I recorded — something changed them outside my normal process. I stopped rather than continue on top of it.",
|
|
1565
|
+
});
|
|
1566
|
+
haltReason = "kill_switch";
|
|
1567
|
+
break;
|
|
1568
|
+
}
|
|
1569
|
+
heartbeat(paths.sessionLock, sessionId);
|
|
1570
|
+
|
|
1571
|
+
observeAppSourceFingerprint(plan, run, workspace, sessionNow());
|
|
1572
|
+
invalidateStaleReviews(plan, run, workspace, sessionNow());
|
|
1573
|
+
// Applicability can change between sessions. Settle it before refresh mutates any accepted
|
|
1574
|
+
// dependency proof, so a newly deferred/not-needed consumer cannot spend a refresh attempt.
|
|
1575
|
+
reconcileWorkflowApplicability(plan, run, businessState, sessionNow());
|
|
1576
|
+
for (const node of plan.nodes) {
|
|
1577
|
+
const state = run.nodes[node.id];
|
|
1578
|
+
if (state && ["not_needed", "skipped"].includes(state.status)) {
|
|
1579
|
+
abandonDependencyRefreshesForConsumer(plan, run, node.id, sessionNow());
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
applyStandingApprovals(plan, run, paths.agentOperations, sessionNow());
|
|
1583
|
+
const activeScopeHints = brief?.scopeHints;
|
|
1584
|
+
const scopedRefreshConsumers = refreshAdmissibleConsumerIds(plan, run, businessState, captured);
|
|
1585
|
+
if (activeScopeHints?.length) {
|
|
1586
|
+
for (const consumerId of [...scopedRefreshConsumers]) {
|
|
1587
|
+
const node = plan.nodes.find((candidate) => candidate.id === consumerId)!;
|
|
1588
|
+
if (!nodeInScope(activeScopeHints, node.domainId, node.workflowId)) scopedRefreshConsumers.delete(consumerId);
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
if (scopedRefreshConsumers && failedScopedRefreshDependencyIds.size > 0) {
|
|
1592
|
+
for (const consumerId of [...scopedRefreshConsumers]) {
|
|
1593
|
+
const consumerNode = plan.nodes.find((node) => node.id === consumerId);
|
|
1594
|
+
if (consumerNode?.refreshDependencies.some((refresh) => failedScopedRefreshDependencyIds.has(refresh.nodeId))) {
|
|
1595
|
+
scopedRefreshConsumers.delete(consumerId);
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
if (scopedRefreshConsumers) {
|
|
1600
|
+
for (const consumerId of scopedRefreshConsumers) {
|
|
1601
|
+
const consumerNode = plan.nodes.find((node) => node.id === consumerId);
|
|
1602
|
+
const consumerState = run.nodes[consumerId];
|
|
1603
|
+
if (!consumerNode || !consumerState || !["pending", "ready", "stale"].includes(consumerState.status)) continue;
|
|
1604
|
+
const cycles = new Set(consumerState.dependencyRefreshCycles ?? []);
|
|
1605
|
+
for (const refresh of consumerNode.refreshDependencies) {
|
|
1606
|
+
const token = `${refresh.nodeId}@${consumerState.attempts.length}`;
|
|
1607
|
+
if (cycles.has(token) && run.nodes[refresh.nodeId]?.status !== "succeeded") scopedRefreshDependencyIds.add(refresh.nodeId);
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
const reopenedRefreshDependencies = refreshDependenciesBeforeFrontier(plan, run, sessionNow(), scopedRefreshConsumers);
|
|
1612
|
+
reopenNodesForAuthorizedWorkOrders(plan, run, sessionNow());
|
|
1613
|
+
for (const nodeId of reopenedRefreshDependencies) scopedRefreshDependencyIds.add(nodeId);
|
|
1614
|
+
writeRunState(paths.runState, run);
|
|
1615
|
+
const frontier = computeFrontier(plan, run, businessState, captured);
|
|
1616
|
+
let readyIds: RunNodeId[] = frontier.ready.filter((nodeId) => !failedScopedRefreshDependencyIds.has(nodeId) && !deferredSharedResources.has(nodeId));
|
|
1617
|
+
if (brief.scopeHints && brief.scopeHints.length > 0) {
|
|
1618
|
+
const inScope = readyIds.filter((id) => {
|
|
1619
|
+
const node = plan.nodes.find((candidate) => candidate.id === id)!;
|
|
1620
|
+
return nodeInScope(brief!.scopeHints, node.domainId, node.workflowId) || scopedRefreshDependencyIds.has(id);
|
|
1621
|
+
});
|
|
1622
|
+
// A scoped session dispatches nodes matching its scope plus the exact dependencies it
|
|
1623
|
+
// reopened for an in-scope consumer's declared refresh cycle. It never silently reaches
|
|
1624
|
+
// across that boundary for an ordinary prerequisite the founder did not grant this
|
|
1625
|
+
// session. When nothing in scope is currently ready, check
|
|
1626
|
+
// whether that's ordinary (an out-of-scope ready node with no bearing on this scope, or
|
|
1627
|
+
// the in-scope work is simply done -- both silent by design) or whether an in-scope node
|
|
1628
|
+
// is stuck behind an out-of-scope prerequisite that hasn't succeeded yet, in which case
|
|
1629
|
+
// the loop used to just break with no explanation. Report the blocker by title, not its
|
|
1630
|
+
// raw domainId -- an anomaly message reaches the founder through the same digest as
|
|
1631
|
+
// "advanced"/"parked" entries, and domainId values (e.g. "domain.money") are exactly what
|
|
1632
|
+
// the founder-copy internal-vocabulary blocklist exists to keep out of that surface.
|
|
1633
|
+
if (inScope.length === 0) {
|
|
1634
|
+
const blockingTitles = findOutOfScopeBlockers(plan, run, brief.scopeHints);
|
|
1635
|
+
if (blockingTitles.length > 0) {
|
|
1636
|
+
anomalies.push({
|
|
1637
|
+
message: `Nothing in this session's current scope is ready to run yet. Progress is waiting on other work outside this session's scope: ${blockingTitles.join(", ")}. Widen this session's scope, or run a session covering that work first, before retrying.`,
|
|
1638
|
+
});
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
readyIds = inScope;
|
|
1642
|
+
}
|
|
1643
|
+
if (readyIds.length === 0) {
|
|
1644
|
+
// Nothing dispatchable — but produced work may be parked pending its fresh-context
|
|
1645
|
+
// check. Acceptance or bounded queued repair reopens the frontier. Otherwise stop
|
|
1646
|
+
// with the remaining blockers recorded. A halt or timeout uses the same boundary.
|
|
1647
|
+
const progressCount = await runVerificationSweep();
|
|
1648
|
+
if (progressCount > 0 && !timedOut && !haltReason) continue;
|
|
1649
|
+
break;
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
const batches = buildDispatchBatches(plan, readyIds, maxConcurrency);
|
|
1653
|
+
for (const batch of batches) {
|
|
1654
|
+
let innerBoundary;
|
|
1655
|
+
try {
|
|
1656
|
+
innerBoundary = checkBatchBoundary(dispatchHooks);
|
|
1657
|
+
} catch {
|
|
1658
|
+
anomalies.push({ message: "I couldn't confirm it was still safe to continue, so I stopped rather than guess." });
|
|
1659
|
+
haltReason = "kill_switch";
|
|
1660
|
+
break dispatchLoop;
|
|
1661
|
+
}
|
|
1662
|
+
if (innerBoundary.halt) {
|
|
1663
|
+
haltReason = innerBoundary.reason;
|
|
1664
|
+
break dispatchLoop;
|
|
1665
|
+
}
|
|
1666
|
+
heartbeat(paths.sessionLock, sessionId);
|
|
1667
|
+
|
|
1668
|
+
// Snapshot before dispatch and register only the fresh-context pending delta after the
|
|
1669
|
+
// entire batch has durably reconciled. Registering inside the node loop would let a
|
|
1670
|
+
// partially completed batch leak into the cooperative-yield sweep.
|
|
1671
|
+
const pendingBeforeBatch = new Set(listPendingSessionReviews(plan, run));
|
|
1672
|
+
|
|
1673
|
+
const outcomes = await Promise.allSettled(
|
|
1674
|
+
batch.nodeIds.map(async (nodeId) => {
|
|
1675
|
+
const node = plan.nodes.find((candidate) => candidate.id === nodeId)!;
|
|
1676
|
+
// Standing authority is time- and target-bound. Re-read it at the final dispatch seam,
|
|
1677
|
+
// after the batch boundary and immediately before any estimate or worker starts. A
|
|
1678
|
+
// revoked/expired envelope or changed planned action resets its sourced approvals to
|
|
1679
|
+
// pending, even when an earlier frontier pass had classified this node as ready.
|
|
1680
|
+
applyStandingApprovals(plan, run, paths.agentOperations, sessionNow());
|
|
1681
|
+
if (node.approvals.some((approval) => run.approvals[approval.id] !== "approved")) {
|
|
1682
|
+
const nodeState = run.nodes[nodeId];
|
|
1683
|
+
if (nodeState) {
|
|
1684
|
+
nodeState.status = "waiting_founder";
|
|
1685
|
+
nodeState.blocker = "Founder approval required";
|
|
1686
|
+
run.updatedAt = sessionNow();
|
|
1687
|
+
writeRunState(paths.runState, run);
|
|
1688
|
+
}
|
|
1689
|
+
return;
|
|
1690
|
+
}
|
|
1691
|
+
// Re-evaluate at the final dispatch seam. Frontier decisions are planning evidence,
|
|
1692
|
+
// not authority: grants, prerequisites, waivers, budgets, and time bounds may have
|
|
1693
|
+
// changed since that pass, just as standing envelopes may have above.
|
|
1694
|
+
const decision = captured.evaluate(node);
|
|
1695
|
+
if (!decision.allowed) {
|
|
1696
|
+
const nodeState = run.nodes[nodeId];
|
|
1697
|
+
if (nodeState) {
|
|
1698
|
+
nodeState.status = "blocked";
|
|
1699
|
+
nodeState.blocker = decision.parkReason ?? "Dispatch-time authority no longer permits this work.";
|
|
1700
|
+
run.updatedAt = sessionNow();
|
|
1701
|
+
writeRunState(paths.runState, run);
|
|
1702
|
+
}
|
|
1703
|
+
return;
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
const sharedClaims: SharedClaim[] = [];
|
|
1707
|
+
const sharedTtlSeconds = Math.min(86400, Math.max(node.ttlSeconds, lockTtlSeconds));
|
|
1708
|
+
const releaseUnusedClaims = (): void => {
|
|
1709
|
+
for (const claim of sharedClaims) releaseSharedClaim(sharedHome, claim, { now: sessionNow() });
|
|
1710
|
+
};
|
|
1711
|
+
if (node.sharedResources?.length) {
|
|
1712
|
+
const identity = sharedWorkspaceIdentity();
|
|
1713
|
+
for (const resource of [...node.sharedResources].sort()) {
|
|
1714
|
+
const acquired = acquireSharedClaim({
|
|
1715
|
+
home: sharedHome,
|
|
1716
|
+
resource,
|
|
1717
|
+
workspaceId: identity,
|
|
1718
|
+
occurrenceId: `${run.runId}:${nodeId}:${(run.nodes[nodeId]?.attempts.length ?? 0) + 1}`,
|
|
1719
|
+
ttlSeconds: sharedTtlSeconds,
|
|
1720
|
+
now: sessionNow(),
|
|
1721
|
+
});
|
|
1722
|
+
if (!acquired.ok) {
|
|
1723
|
+
// No effect or occurrence has started, so rolling back earlier acquisitions is safe.
|
|
1724
|
+
releaseUnusedClaims();
|
|
1725
|
+
const reason =
|
|
1726
|
+
acquired.reason === "reconciliation_required" ? "A shared resource needs reconciliation before this work can resume." : sharedWaitReason;
|
|
1727
|
+
deferredSharedResources.set(nodeId, reason);
|
|
1728
|
+
run.nodes[nodeId]!.status = "blocked";
|
|
1729
|
+
run.nodes[nodeId]!.blocker = reason;
|
|
1730
|
+
writeRunState(paths.runState, run);
|
|
1731
|
+
break;
|
|
1732
|
+
}
|
|
1733
|
+
sharedClaims.push(acquired.claim);
|
|
1734
|
+
}
|
|
1735
|
+
if (deferredSharedResources.has(nodeId)) return;
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
let estimateEntryId: string | undefined;
|
|
1739
|
+
if (decision.allowed && decision.estimateAmount !== undefined) {
|
|
1740
|
+
const built = buildEstimatePatch(ledger, node, decision, sessionId, sessionNow());
|
|
1741
|
+
if (built) {
|
|
1742
|
+
const result = commitPatch(paths.ledger, paths, sessionId, built.patch);
|
|
1743
|
+
if (result.code === 0) {
|
|
1744
|
+
ledger = loadLedgerFile(paths.ledger, sessionNow());
|
|
1745
|
+
estimateEntryId = built.entryId;
|
|
1746
|
+
} else {
|
|
1747
|
+
anomalies.push({
|
|
1748
|
+
message: `I couldn't record the expected cost for "${node.title}" before starting it, so I left it for you to look at instead of spending blind.`,
|
|
1749
|
+
});
|
|
1750
|
+
releaseUnusedClaims();
|
|
1751
|
+
return;
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
const attemptTime = sessionNow();
|
|
1757
|
+
let attempt: ReturnType<typeof beginAttempt>;
|
|
1758
|
+
const occurrence = takeAuthorizedOccurrence(run, node.workflowId);
|
|
1759
|
+
const attemptNumber = (run.nodes[nodeId]?.attempts.length ?? 0) + 1;
|
|
1760
|
+
const executionIdentity = node.reviewOf?.length ? workerExecutionIdentity(sessionId, run.runId, nodeId, attemptNumber) : sessionId;
|
|
1761
|
+
try {
|
|
1762
|
+
attempt = beginAttempt(plan, run, nodeId, executionIdentity, attemptTime, occurrence?.id);
|
|
1763
|
+
attempt.proofSource = executorMode === "fixture" || executorMode === "slow-silent" ? "synthetic" : "workspace";
|
|
1764
|
+
if (node.workflowId === "workflow.design.design-system-audit") {
|
|
1765
|
+
// Authority belongs to this exact dispatch. Persist it before the worker starts so
|
|
1766
|
+
// a later delegation or direct verdict cannot retroactively authorize its output.
|
|
1767
|
+
attempt.designAuthorityEvaluation = captureDesignAuthorityEvaluation(run, paths.audit, "dispatch", {
|
|
1768
|
+
workspaceRoot: workspace,
|
|
1769
|
+
evaluatedAt: attemptTime,
|
|
1770
|
+
...(founderTrustStore ? { trustedKey: founderTrustStore.trustedKey } : {}),
|
|
1771
|
+
});
|
|
1772
|
+
}
|
|
1773
|
+
} catch (error) {
|
|
1774
|
+
// beginAttempt throws once a node has exhausted its maxAttempts (or on an internal
|
|
1775
|
+
// plan/run mismatch). Left uncaught, this would escape to the outer catch and report
|
|
1776
|
+
// the WHOLE session as "crashed" — dropping every already-succeeded node from this
|
|
1777
|
+
// run's digest over a single node's retry budget. Park just this node instead (the
|
|
1778
|
+
// fixed blocker string below matches digest.ts's BLOCKER_TEXT_EXACT so it renders as
|
|
1779
|
+
// a plain sentence, never the raw error) and keep dispatching the rest of the batch.
|
|
1780
|
+
releaseUnusedClaims();
|
|
1781
|
+
if (occurrence) restoreOccurrenceAfterAttempt(run, occurrence.id, attemptTime);
|
|
1782
|
+
if (!host.request) console.error(`session.begin_attempt_failed ${nodeId}: ${error instanceof Error ? error.message : String(error)}`);
|
|
1783
|
+
const nodeState = run.nodes[nodeId];
|
|
1784
|
+
if (nodeState) {
|
|
1785
|
+
nodeState.status = "blocked";
|
|
1786
|
+
nodeState.blocker = "Ran out of attempts for this session.";
|
|
1787
|
+
run.updatedAt = attemptTime;
|
|
1788
|
+
writeRunState(paths.runState, run);
|
|
1789
|
+
}
|
|
1790
|
+
return;
|
|
1791
|
+
}
|
|
1792
|
+
writeRunState(paths.runState, run);
|
|
1793
|
+
|
|
1794
|
+
let sharedOwnershipLost = false;
|
|
1795
|
+
const assertSharedOwnership = (): void => {
|
|
1796
|
+
if (sharedOwnershipLost) throw new Error("shared_claim.ownership_lost");
|
|
1797
|
+
for (const claim of sharedClaims) assertSharedClaim(sharedHome, claim, sessionNow());
|
|
1798
|
+
};
|
|
1799
|
+
const parkSharedReadback = (): void => {
|
|
1800
|
+
const reason = "A shared resource needs reconciliation before this work can resume.";
|
|
1801
|
+
deferredSharedResources.set(nodeId, reason);
|
|
1802
|
+
attempt.status = "needs_readback";
|
|
1803
|
+
attempt.finishedAt = sessionNow();
|
|
1804
|
+
const current = run.nodes[nodeId]!;
|
|
1805
|
+
current.status = "needs_readback";
|
|
1806
|
+
current.blocker = reason;
|
|
1807
|
+
current.acceptedOutputFingerprint = undefined;
|
|
1808
|
+
current.verifiedBySessionId = undefined;
|
|
1809
|
+
for (const binding of run.artifactBindings) {
|
|
1810
|
+
if (node.outputs.includes(binding.artifactId as never)) binding.accepted = false;
|
|
1811
|
+
}
|
|
1812
|
+
invalidateDescendants(plan, run, node.outputs, sessionNow());
|
|
1813
|
+
writeRunState(paths.runState, run);
|
|
1814
|
+
};
|
|
1815
|
+
const checkSharedOwnership = (): boolean => {
|
|
1816
|
+
try {
|
|
1817
|
+
assertSharedOwnership();
|
|
1818
|
+
return true;
|
|
1819
|
+
} catch {
|
|
1820
|
+
parkSharedReadback();
|
|
1821
|
+
return false;
|
|
1822
|
+
}
|
|
1823
|
+
};
|
|
1824
|
+
const runtimeWrites = node.sourceAccess?.length || node.selectedOperation ? trackRuntimeWrites(workspace) : undefined;
|
|
1825
|
+
const refreshAttemptHeartbeat = (): void => {
|
|
1826
|
+
try {
|
|
1827
|
+
for (let index = 0; index < sharedClaims.length; index++) {
|
|
1828
|
+
sharedClaims[index] = renewSharedClaim(sharedHome, sharedClaims[index]!, sharedTtlSeconds, sessionNow());
|
|
1829
|
+
}
|
|
1830
|
+
} catch {
|
|
1831
|
+
sharedOwnershipLost = true;
|
|
1832
|
+
}
|
|
1833
|
+
try {
|
|
1834
|
+
refreshHeartbeat(run, nodeId, sessionNow());
|
|
1835
|
+
if (runtimeWrites) {
|
|
1836
|
+
runtimeWrites.write("run/run-state.json", () => writeRunState(paths.runState, run));
|
|
1837
|
+
runtimeWrites.write("control/session.lock", () => heartbeat(paths.sessionLock, sessionId));
|
|
1838
|
+
} else {
|
|
1839
|
+
writeRunState(paths.runState, run);
|
|
1840
|
+
heartbeat(paths.sessionLock, sessionId);
|
|
1841
|
+
}
|
|
1842
|
+
} catch {
|
|
1843
|
+
/* best effort: a heartbeat refresh is an optimization, never load-bearing for this attempt's own result */
|
|
1844
|
+
}
|
|
1845
|
+
};
|
|
1846
|
+
// R12/R13 liveness must not depend on the executor voluntarily calling back: a
|
|
1847
|
+
// slow-but-alive real executor (U6) that never calls `heartbeat` would otherwise let its
|
|
1848
|
+
// own attempt/lock heartbeat go stale mid-run and risk a --break-stale-verified acquirer
|
|
1849
|
+
// stealing the lock out from under it. This timer refreshes both independently of the
|
|
1850
|
+
// executor for as long as execute() is in flight; the executor-supplied callback below is
|
|
1851
|
+
// still honored as an extra signal, but neither one is load-bearing on its own now. The
|
|
1852
|
+
// interval is a fraction of the tighter of the two TTLs in play so a refresh always lands
|
|
1853
|
+
// comfortably inside the window; unref'd (never keeps this short-lived CLI's event loop
|
|
1854
|
+
// alive on its own) and always cleared in `finally`, including when execute() throws.
|
|
1855
|
+
const heartbeatIntervalMs = Math.max(50, (Math.min(attempt.ttlSeconds, lockTtlSeconds) * 1000) / 3);
|
|
1856
|
+
const heartbeatTimer = setInterval(refreshAttemptHeartbeat, heartbeatIntervalMs);
|
|
1857
|
+
heartbeatTimer.unref();
|
|
1858
|
+
let result: Awaited<ReturnType<typeof executor.execute>>;
|
|
1859
|
+
try {
|
|
1860
|
+
const authorization = {
|
|
1861
|
+
workflowId: node.workflowId,
|
|
1862
|
+
runId: run.runId,
|
|
1863
|
+
attemptId: attempt.id,
|
|
1864
|
+
executionIdentity,
|
|
1865
|
+
inputFingerprint: attempt.inputFingerprint,
|
|
1866
|
+
evaluatedAt: attemptTime,
|
|
1867
|
+
actionClass: node.actionClass,
|
|
1868
|
+
...(node.protectedCategory ? { protectedCategory: node.protectedCategory } : {}),
|
|
1869
|
+
...(node.workflowId === "workflow.design.design-system-audit" ? { designTasteDelegation: attempt.designAuthorityEvaluation!.delegation } : {}),
|
|
1870
|
+
approvalRequirements: node.approvals.map((approval) => {
|
|
1871
|
+
const provenance = run.approvalProvenance?.[approval.id];
|
|
1872
|
+
return {
|
|
1873
|
+
id: approval.id,
|
|
1874
|
+
description: approval.description,
|
|
1875
|
+
status: run.approvals[approval.id] ?? "pending",
|
|
1876
|
+
...(provenance?.source === "standing_envelope"
|
|
1877
|
+
? {
|
|
1878
|
+
envelopeId: provenance.envelopeId,
|
|
1879
|
+
actionId: provenance.actionId,
|
|
1880
|
+
validatedAt: provenance.validatedAt,
|
|
1881
|
+
}
|
|
1882
|
+
: {}),
|
|
1883
|
+
};
|
|
1884
|
+
}),
|
|
1885
|
+
autonomy: {
|
|
1886
|
+
reasonCode: decision.reasonCode,
|
|
1887
|
+
...(decision.grantLevel ? { grantLevel: decision.grantLevel } : {}),
|
|
1888
|
+
...(decision.waiverId ? { waiverId: decision.waiverId } : {}),
|
|
1889
|
+
evidenceRefs: [...decision.evidenceRefs],
|
|
1890
|
+
...(decision.estimateAmount !== undefined ? { estimateAmount: decision.estimateAmount } : {}),
|
|
1891
|
+
...(decision.estimateCurrency ? { estimateCurrency: decision.estimateCurrency } : {}),
|
|
1892
|
+
...(decision.remainingBudget !== undefined ? { remainingBudget: decision.remainingBudget } : {}),
|
|
1893
|
+
},
|
|
1894
|
+
} as const;
|
|
1895
|
+
const capsule = capsuleFromOccurrence(occurrence);
|
|
1896
|
+
assertSharedOwnership();
|
|
1897
|
+
result = await executor.execute(node, {
|
|
1898
|
+
runId: run.runId,
|
|
1899
|
+
attemptId: attempt.id,
|
|
1900
|
+
workspaceDir: workspace,
|
|
1901
|
+
skillRootDir: skillRoot(),
|
|
1902
|
+
artifactPaths: Object.fromEntries(plan.artifactBindings.map((binding) => [binding.artifactId, binding.path])),
|
|
1903
|
+
authorization,
|
|
1904
|
+
refreshInstructions: [...(run.nodes[nodeId]?.refreshInstructions ?? []), ...(run.nodes[nodeId]?.repairInstructions ?? [])],
|
|
1905
|
+
now: attemptTime,
|
|
1906
|
+
heartbeat: refreshAttemptHeartbeat,
|
|
1907
|
+
runtimeWrites: runtimeWrites?.snapshot,
|
|
1908
|
+
...(capsule ? { contextSelectors: capsule.sourceIds } : {}),
|
|
1909
|
+
});
|
|
1910
|
+
} catch (error) {
|
|
1911
|
+
if (!sharedClaims.length) throw error;
|
|
1912
|
+
result = { status: "failed", outputs: [], evidence: [], error: "Shared-resource worker did not return a certain result." };
|
|
1913
|
+
} finally {
|
|
1914
|
+
clearInterval(heartbeatTimer);
|
|
1915
|
+
}
|
|
1916
|
+
runtimeWrites?.assertIntact();
|
|
1917
|
+
const finishedAt = sessionNow();
|
|
1918
|
+
if (!checkSharedOwnership()) return;
|
|
1919
|
+
if (result.status === "failed" && sharedClaims.length) {
|
|
1920
|
+
parkSharedReadback();
|
|
1921
|
+
return;
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
try {
|
|
1925
|
+
if (result.status === "failed") {
|
|
1926
|
+
const failedState = run.nodes[nodeId];
|
|
1927
|
+
const retryableAuditEvidenceFailure = isRetryableDesignAuditExecutorFailure(node, result.error);
|
|
1928
|
+
if (result.error?.startsWith("worker knowledge receipt rejected:")) {
|
|
1929
|
+
retainUnacceptedCandidateOutputs(run, node, attempt.id, result.outputs);
|
|
1930
|
+
}
|
|
1931
|
+
attempt.status = "failed";
|
|
1932
|
+
attempt.finishedAt = finishedAt;
|
|
1933
|
+
attempt.error = result.error;
|
|
1934
|
+
if (attempt.workOrderOccurrenceId) {
|
|
1935
|
+
restoreOccurrenceAfterAttempt(run, attempt.workOrderOccurrenceId, finishedAt);
|
|
1936
|
+
}
|
|
1937
|
+
const deferredRefresh = deferDependencyRefreshAfterFailure(plan, run, nodeId, finishedAt);
|
|
1938
|
+
if (deferredRefresh) {
|
|
1939
|
+
failedScopedRefreshDependencyIds.add(nodeId);
|
|
1940
|
+
scopedRefreshDependencyIds.delete(nodeId);
|
|
1941
|
+
}
|
|
1942
|
+
if (!deferredRefresh && failedState) {
|
|
1943
|
+
failedState.refreshInstructions = undefined;
|
|
1944
|
+
if (retryableAuditEvidenceFailure) {
|
|
1945
|
+
failedState.acceptedOutputFingerprint = undefined;
|
|
1946
|
+
failedState.verifiedBySessionId = undefined;
|
|
1947
|
+
failedState.repairInstructions = [`Repair invalid audit evidence: ${result.error ?? "the declared audit output is missing"}`];
|
|
1948
|
+
for (const binding of run.artifactBindings) {
|
|
1949
|
+
if (node.outputs.includes(binding.artifactId as never)) binding.accepted = false;
|
|
1950
|
+
}
|
|
1951
|
+
if (attemptsUsedInCurrentCycle(failedState) < node.maxAttempts) {
|
|
1952
|
+
failedState.status = "stale";
|
|
1953
|
+
failedState.blocker = undefined;
|
|
1954
|
+
} else {
|
|
1955
|
+
failedState.status = "blocked";
|
|
1956
|
+
failedState.blocker = `The design audit evidence remained invalid after ${node.maxAttempts} attempts.`;
|
|
1957
|
+
}
|
|
1958
|
+
} else {
|
|
1959
|
+
failedState.status = "failed";
|
|
1960
|
+
failedState.blocker = result.error ?? "The work didn't complete.";
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
run.updatedAt = finishedAt;
|
|
1964
|
+
// A failed node is neither "advanced" nor "parked" in run-state terms — without this it would
|
|
1965
|
+
// vanish from the digest entirely (silence), so a failure is reported as something to watch.
|
|
1966
|
+
// The raw executor error is never interpolated here: it's a debug string (may itself carry
|
|
1967
|
+
// internal ids), not founder copy — only the node's own human title is safe to name.
|
|
1968
|
+
anomalies.push({
|
|
1969
|
+
message: retryableAuditEvidenceFailure
|
|
1970
|
+
? `I tried "${node.title}", but its audit evidence was invalid. I kept its bounded audit-only retry queued.`
|
|
1971
|
+
: `I tried "${node.title}" and it didn't go through. I'll leave it for a future session or for you to look at.`,
|
|
1972
|
+
});
|
|
1973
|
+
} else {
|
|
1974
|
+
reconcilePatch(
|
|
1975
|
+
plan,
|
|
1976
|
+
run,
|
|
1977
|
+
{
|
|
1978
|
+
nodeId,
|
|
1979
|
+
attemptId: attempt.id,
|
|
1980
|
+
outputs: result.outputs.map((output) => ({
|
|
1981
|
+
artifactId: output.artifactId,
|
|
1982
|
+
path: output.path,
|
|
1983
|
+
fingerprint: output.fingerprint,
|
|
1984
|
+
evidence: [...output.evidence],
|
|
1985
|
+
})),
|
|
1986
|
+
},
|
|
1987
|
+
finishedAt,
|
|
1988
|
+
);
|
|
1989
|
+
// Gates execute out of process and may validate the current audit attempt and exact
|
|
1990
|
+
// artifact binding. Persist that engine-owned identity before a gate reads run-state.
|
|
1991
|
+
writeRunState(paths.runState, run);
|
|
1992
|
+
if (run.nodes[nodeId]!.status === "succeeded") {
|
|
1993
|
+
advanced.push({ nodeId, title: node.title, unit: domainBusinessUnit(node.domainId, catalog.authority) });
|
|
1994
|
+
} else if (node.verification.kind === "deterministic" && node.verification.gateIds.length > 0) {
|
|
1995
|
+
// Mechanical checks are required before judgment. A gated judgment node remains
|
|
1996
|
+
// pending for the independent sweep after its exact-attempt gate receipt is saved.
|
|
1997
|
+
const gateOutcome = runDeterministicGates(node.verification.gateIds, workspace, {
|
|
1998
|
+
gateArguments: node.verification.gateArguments,
|
|
1999
|
+
selectedOperation: node.selectedOperation,
|
|
2000
|
+
});
|
|
2001
|
+
if (attempt.proofSource === "workspace") {
|
|
2002
|
+
const changedArtifacts = refreshProducedArtifacts(plan, run, nodeId, workspace);
|
|
2003
|
+
invalidateDescendants(plan, run, changedArtifacts, sessionNow());
|
|
2004
|
+
}
|
|
2005
|
+
if (!checkSharedOwnership()) return;
|
|
2006
|
+
recordDeterministicVerification(plan, run, nodeId, gateOutcome, sessionNow());
|
|
2007
|
+
if (gateOutcome.allPassed) {
|
|
2008
|
+
if (!requiresIndependentReview(node)) acceptVerification(plan, run, nodeId, gateOutcome.evidence, sessionNow(), sessionId);
|
|
2009
|
+
const accepted = run.nodes[nodeId]!.status as string;
|
|
2010
|
+
if (accepted === "succeeded") advanced.push({ nodeId, title: node.title, unit: domainBusinessUnit(node.domainId, catalog.authority) });
|
|
2011
|
+
} else {
|
|
2012
|
+
// An honest audit can fail because its producer needs repair. Preserve the
|
|
2013
|
+
// failed receipt for a rejection-only sweep that can select that producer.
|
|
2014
|
+
const currentState = run.nodes[nodeId]!;
|
|
2015
|
+
const founderTasteDecisionNeeded =
|
|
2016
|
+
node.workflowId === "workflow.design.design-system-audit" &&
|
|
2017
|
+
gateOutcome.issueCodes.some((code) => DESIGN_TASTE_FOUNDER_DECISION_CODES.has(code));
|
|
2018
|
+
const invalidDesignAuditEvidence = isRetryableDesignAuditGateFailure(node, gateOutcome);
|
|
2019
|
+
if (founderTasteDecisionNeeded) {
|
|
2020
|
+
currentState.status = "waiting_founder";
|
|
2021
|
+
currentState.blocker = "Taste Gate needs a founder decision for the current design candidate.";
|
|
2022
|
+
} else if (invalidDesignAuditEvidence) {
|
|
2023
|
+
// This is an audit-authoring defect, not a product-design or craft rejection.
|
|
2024
|
+
// Give the fresh-context audit worker a bounded chance to repair its own
|
|
2025
|
+
// missing, malformed, stale, or non-independent evidence. Never route this
|
|
2026
|
+
// branch to a reviewed producer: no product bytes have been judged. Reducer
|
|
2027
|
+
// audit-chain tamper has already halted at preflight and never reaches here.
|
|
2028
|
+
attempt.status = "failed";
|
|
2029
|
+
attempt.finishedAt = sessionNow();
|
|
2030
|
+
currentState.acceptedOutputFingerprint = undefined;
|
|
2031
|
+
currentState.verifiedBySessionId = undefined;
|
|
2032
|
+
currentState.repairInstructions = gateOutcome.evidence.map((entry) => `Repair invalid audit evidence: ${entry}`);
|
|
2033
|
+
for (const binding of run.artifactBindings) {
|
|
2034
|
+
if (node.outputs.includes(binding.artifactId as never)) binding.accepted = false;
|
|
2035
|
+
}
|
|
2036
|
+
if (attemptsUsedInCurrentCycle(currentState) < node.maxAttempts) {
|
|
2037
|
+
currentState.status = "stale";
|
|
2038
|
+
currentState.blocker = undefined;
|
|
2039
|
+
} else {
|
|
2040
|
+
currentState.status = "blocked";
|
|
2041
|
+
currentState.blocker = `The design audit evidence remained invalid after ${node.maxAttempts} attempts.`;
|
|
2042
|
+
}
|
|
2043
|
+
} else if (!hasCurrentFailedAuditGates(plan, run, nodeId)) {
|
|
2044
|
+
requestVerificationRepair(plan, run, nodeId, gateOutcome.evidence, sessionNow());
|
|
2045
|
+
}
|
|
2046
|
+
anomalies.push({ message: `I finished "${node.title}" but its checks didn't pass yet, so I'm not calling it done.` });
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
if (!checkSharedOwnership()) return;
|
|
2051
|
+
if (estimateEntryId) {
|
|
2052
|
+
const actualPatch = buildActualPatch(ledger, estimateEntryId, node, decision, sessionId, sessionNow());
|
|
2053
|
+
if (actualPatch) {
|
|
2054
|
+
const actualResult = commitPatch(paths.ledger, paths, sessionId, actualPatch);
|
|
2055
|
+
if (actualResult.code === 0) ledger = loadLedgerFile(paths.ledger, sessionNow());
|
|
2056
|
+
else
|
|
2057
|
+
anomalies.push({
|
|
2058
|
+
message: `I finished "${node.title}" but couldn't record the final cost — the estimate is saved, the actual isn't yet.`,
|
|
2059
|
+
});
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
if (!checkSharedOwnership()) return;
|
|
2064
|
+
writeRunState(paths.runState, run);
|
|
2065
|
+
// Reconciliation is durable before ownership is released. A failed or thrown worker
|
|
2066
|
+
// retains every claim: expiry alone never makes uncertain external effects replayable.
|
|
2067
|
+
if (result.status !== "failed") {
|
|
2068
|
+
assertSharedOwnership();
|
|
2069
|
+
for (const claim of sharedClaims) releaseSharedClaim(sharedHome, claim, { now: sessionNow() });
|
|
2070
|
+
}
|
|
2071
|
+
} catch (error) {
|
|
2072
|
+
if (!sharedClaims.length) throw error;
|
|
2073
|
+
parkSharedReadback();
|
|
2074
|
+
}
|
|
2075
|
+
}),
|
|
2076
|
+
);
|
|
2077
|
+
// Keep session ownership until every started worker has settled. A rejected
|
|
2078
|
+
// worker must not release the lock while its siblings can still write.
|
|
2079
|
+
const failed = outcomes.find((outcome) => outcome.status === "rejected");
|
|
2080
|
+
if (failed?.status === "rejected") throw failed.reason;
|
|
2081
|
+
|
|
2082
|
+
for (const nodeId of listPendingSessionReviews(plan, run)) {
|
|
2083
|
+
if (pendingBeforeBatch.has(nodeId)) continue;
|
|
2084
|
+
const latestAttempt = run.nodes[nodeId]?.attempts.at(-1);
|
|
2085
|
+
const node = plan.nodes.find((candidate) => candidate.id === nodeId);
|
|
2086
|
+
const ownedBySession =
|
|
2087
|
+
latestAttempt?.ownerSessionId === sessionId ||
|
|
2088
|
+
(latestAttempt !== undefined &&
|
|
2089
|
+
Boolean(node?.reviewOf?.length) &&
|
|
2090
|
+
latestAttempt.ownerSessionId === workerExecutionIdentity(sessionId, run.runId, nodeId, latestAttempt.number));
|
|
2091
|
+
if (latestAttempt && ownedBySession) cooperativeYieldCandidateAttempts.set(nodeId, latestAttempt.id);
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
// A cooperative yield can arrive while a batch is running. That batch may produce
|
|
2097
|
+
// fresh-context work after the loop's last empty-frontier sweep, so judge it before the
|
|
2098
|
+
// session closes. Ordinary empty-frontier completion already ran the sweep above; do not
|
|
2099
|
+
// invoke an unavailable verifier twice. A timeout or kill switch remains final.
|
|
2100
|
+
if (verifier && !timedOut && haltReason === "cooperative_yield" && cooperativeYieldCandidateAttempts.size > 0) {
|
|
2101
|
+
await runVerificationSweep(true, cooperativeYieldCandidateAttempts);
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
if (!verifier) {
|
|
2105
|
+
const unverified = listPendingSessionReviews(plan, run).length;
|
|
2106
|
+
if (unverified > 0) {
|
|
2107
|
+
anomalies.push({
|
|
2108
|
+
message:
|
|
2109
|
+
unverified === 1
|
|
2110
|
+
? "Independent double-checks were turned off for this session, so one piece of finished work is waiting on a check rather than done."
|
|
2111
|
+
: `Independent double-checks were turned off for this session, so ${unverified} pieces of finished work are waiting on a check rather than done.`,
|
|
2112
|
+
});
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
// One final, side-effect-free frontier pass so run.nodes reflects the latest classification for the digest, regardless of why the loop exited.
|
|
2117
|
+
try {
|
|
2118
|
+
applyStandingApprovals(plan, run, paths.agentOperations, sessionNow());
|
|
2119
|
+
computeFrontier(plan, run, businessState, captured);
|
|
2120
|
+
} catch {
|
|
2121
|
+
/* best effort snapshot only */
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
for (const [nodeId, reason] of deferredSharedResources) {
|
|
2125
|
+
const state = run.nodes[nodeId];
|
|
2126
|
+
if (state) {
|
|
2127
|
+
if (state.status !== "needs_readback") state.status = "blocked";
|
|
2128
|
+
state.blocker = reason;
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
const parked: DigestParkedItem[] = [];
|
|
2132
|
+
for (const node of plan.nodes) {
|
|
2133
|
+
const state = run.nodes[node.id];
|
|
2134
|
+
if (!state || !["blocked", "waiting_founder", "needs_readback"].includes(state.status)) continue;
|
|
2135
|
+
const detail = decisions.get(node.id);
|
|
2136
|
+
const pendingGate = businessState.founderGates.pending.find((gate) => gate.reason.includes(node.title));
|
|
2137
|
+
parked.push({
|
|
2138
|
+
nodeId: node.id,
|
|
2139
|
+
title: node.title,
|
|
2140
|
+
unit: domainBusinessUnit(node.domainId, catalog.authority),
|
|
2141
|
+
reasonText: translateParkReason({ reasonCode: detail?.allowed === false ? detail.reasonCode : undefined, blocker: state.blocker }),
|
|
2142
|
+
ageText: pendingGate ? formatAge(pendingGate.createdAt, sessionNow()) : undefined,
|
|
2143
|
+
});
|
|
2144
|
+
}
|
|
2145
|
+
for (const gate of businessState.founderGates.pending) {
|
|
2146
|
+
if (parked.some((item) => gate.reason.includes(item.title))) continue;
|
|
2147
|
+
parked.push({
|
|
2148
|
+
nodeId: gate.id,
|
|
2149
|
+
title: gate.reason,
|
|
2150
|
+
unit: "Operations",
|
|
2151
|
+
reasonText: "This has been waiting on you.",
|
|
2152
|
+
ageText: formatAge(gate.createdAt, sessionNow()),
|
|
2153
|
+
});
|
|
2154
|
+
}
|
|
2155
|
+
|
|
2156
|
+
if (haltReason) anomalies.push({ message: `I stopped partway through because ${translateHaltReason(haltReason)}.` });
|
|
2157
|
+
if (timedOut) anomalies.push({ message: "I hit my time limit for this session and stopped on purpose rather than run indefinitely." });
|
|
2158
|
+
|
|
2159
|
+
const spend: DigestSpendLine[] = ledger.balances.map((balance) => ({
|
|
2160
|
+
unit: balance.unit,
|
|
2161
|
+
period: balance.period,
|
|
2162
|
+
currency: balance.currency,
|
|
2163
|
+
allocated: balance.allocated,
|
|
2164
|
+
committed: balance.committed,
|
|
2165
|
+
spent: balance.spent,
|
|
2166
|
+
remaining: balance.remaining,
|
|
2167
|
+
}));
|
|
2168
|
+
|
|
2169
|
+
const finalNow = sessionNow();
|
|
2170
|
+
run.heartbeatAt = finalNow;
|
|
2171
|
+
run.updatedAt = finalNow;
|
|
2172
|
+
writeRunState(paths.runState, run);
|
|
2173
|
+
const checkpointHash = `checkpoint:${plan.planId}:${run.runId}:${run.updatedAt}`;
|
|
2174
|
+
writeCheckpoint(paths.checkpoint, buildCheckpoint(run, sessionId, checkpointHash, finalNow));
|
|
2175
|
+
|
|
2176
|
+
const completedAdvanced = [
|
|
2177
|
+
...new Map(advanced.filter((entry) => run.nodes[entry.nodeId]?.status === "succeeded").map((entry) => [entry.nodeId, entry])).values(),
|
|
2178
|
+
];
|
|
2179
|
+
const outcome: DigestOutcome = timedOut
|
|
2180
|
+
? "timed_out"
|
|
2181
|
+
: haltReason === "kill_switch"
|
|
2182
|
+
? "halted_kill_switch"
|
|
2183
|
+
: haltReason === "cooperative_yield"
|
|
2184
|
+
? "halted_interactive_yield"
|
|
2185
|
+
: completedAdvanced.length === 0 && parked.length === 0
|
|
2186
|
+
? "nothing_to_do"
|
|
2187
|
+
: "completed";
|
|
2188
|
+
|
|
2189
|
+
return await finish(outcome, { advanced: completedAdvanced, parked, spend }, 0);
|
|
2190
|
+
} catch (error) {
|
|
2191
|
+
// The raw error text is never handed to the founder — an internal exception (e.g. a catalog
|
|
2192
|
+
// authoring defect) can carry engine vocabulary verbatim (workflow/artifact ids). It goes to
|
|
2193
|
+
// stderr for whoever operates this session instead.
|
|
2194
|
+
if (!host.request) console.error(`session.crashed: ${error instanceof Error ? (error.stack ?? error.message) : String(error)}`);
|
|
2195
|
+
anomalies.push({
|
|
2196
|
+
message:
|
|
2197
|
+
error instanceof FounderTrustStoreError
|
|
2198
|
+
? "I could not verify the founder-controlled design authority store and stopped before dispatching work."
|
|
2199
|
+
: "Something unexpected went wrong on my end and I had to stop.",
|
|
2200
|
+
});
|
|
2201
|
+
return await finish("crashed", {}, 1);
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
if (isMainModule(import.meta.url)) {
|
|
2206
|
+
main()
|
|
2207
|
+
.then((code) => {
|
|
2208
|
+
process.exitCode = code;
|
|
2209
|
+
})
|
|
2210
|
+
.catch((error) => {
|
|
2211
|
+
console.error(`session.fatal: ${error instanceof Error ? (error.stack ?? error.message) : String(error)}`);
|
|
2212
|
+
process.exitCode = 1;
|
|
2213
|
+
});
|
|
2214
|
+
}
|