productfoo 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +338 -2
- package/bin/foo +3 -0
- package/bin/foo.mjs +42 -0
- package/commands/bug.md +31 -0
- package/commands/discovery.md +28 -0
- package/commands/ideate.md +27 -0
- package/commands/init.md +28 -0
- package/commands/pitch.md +27 -0
- package/commands/preview.md +25 -0
- package/commands/research.md +31 -0
- package/commands/roast.md +27 -0
- package/commands/spec.md +30 -0
- package/config/pricing.yaml +198 -0
- package/config/routing-policy.yaml +171 -0
- package/dist-public/src/activeModel.d.ts +83 -0
- package/dist-public/src/activeModel.js +331 -0
- package/dist-public/src/agentAdapters.d.ts +122 -0
- package/dist-public/src/agentAdapters.js +178 -0
- package/dist-public/src/agentState.d.ts +43 -0
- package/dist-public/src/agentState.js +177 -0
- package/dist-public/src/bugCapsule.d.ts +94 -0
- package/dist-public/src/bugCapsule.js +227 -0
- package/dist-public/src/bugCapture.d.ts +26 -0
- package/dist-public/src/bugCapture.js +251 -0
- package/dist-public/src/bugOwnerLog.d.ts +93 -0
- package/dist-public/src/bugOwnerLog.js +304 -0
- package/dist-public/src/bugReportStore.d.ts +48 -0
- package/dist-public/src/bugReportStore.js +860 -0
- package/dist-public/src/bugSpecContext.d.ts +7 -0
- package/dist-public/src/bugSpecContext.js +129 -0
- package/dist-public/src/channelFreshness.d.ts +25 -0
- package/dist-public/src/channelFreshness.js +194 -0
- package/dist-public/src/cli.d.ts +30 -0
- package/dist-public/src/cli.js +1667 -0
- package/dist-public/src/cliArgs.d.ts +7 -0
- package/dist-public/src/cliArgs.js +44 -0
- package/dist-public/src/codeCatalog.d.ts +41 -0
- package/dist-public/src/codeCatalog.js +197 -0
- package/dist-public/src/commandContract.d.ts +84 -0
- package/dist-public/src/commandContract.js +390 -0
- package/dist-public/src/commandUsage.d.ts +3 -0
- package/dist-public/src/commandUsage.js +30 -0
- package/dist-public/src/commands/agent.d.ts +60 -0
- package/dist-public/src/commands/agent.js +1353 -0
- package/dist-public/src/commands/asp.d.ts +8 -0
- package/dist-public/src/commands/asp.js +669 -0
- package/dist-public/src/commands/evalCmd.d.ts +4 -0
- package/dist-public/src/commands/evalCmd.js +405 -0
- package/dist-public/src/commands/login.d.ts +25 -0
- package/dist-public/src/commands/login.js +94 -0
- package/dist-public/src/commands/loop.d.ts +16 -0
- package/dist-public/src/commands/loop.js +619 -0
- package/dist-public/src/commands/reconcile.d.ts +41 -0
- package/dist-public/src/commands/reconcile.js +292 -0
- package/dist-public/src/commands/runtime.d.ts +1 -0
- package/dist-public/src/commands/runtime.js +36 -0
- package/dist-public/src/commands/scanRedact.d.ts +8 -0
- package/dist-public/src/commands/scanRedact.js +266 -0
- package/dist-public/src/commands/setup.d.ts +28 -0
- package/dist-public/src/commands/setup.js +398 -0
- package/dist-public/src/commands/shared.d.ts +17 -0
- package/dist-public/src/commands/shared.js +147 -0
- package/dist-public/src/commands/source.d.ts +1 -0
- package/dist-public/src/commands/source.js +134 -0
- package/dist-public/src/commands/specCmd.d.ts +24 -0
- package/dist-public/src/commands/specCmd.js +794 -0
- package/dist-public/src/commands/update.d.ts +61 -0
- package/dist-public/src/commands/update.js +244 -0
- package/dist-public/src/comprehensionSignal.d.ts +20 -0
- package/dist-public/src/comprehensionSignal.js +166 -0
- package/dist-public/src/conductor/diversity.d.ts +48 -0
- package/dist-public/src/conductor/diversity.js +423 -0
- package/dist-public/src/conductor/engine.d.ts +7 -0
- package/dist-public/src/conductor/engine.js +295 -0
- package/dist-public/src/conductor/families/ideate.d.ts +2 -0
- package/dist-public/src/conductor/families/ideate.js +255 -0
- package/dist-public/src/conductor/families/interview.d.ts +2 -0
- package/dist-public/src/conductor/families/interview.js +39 -0
- package/dist-public/src/conductor/families/specSwarm.d.ts +2 -0
- package/dist-public/src/conductor/families/specSwarm.js +146 -0
- package/dist-public/src/conductor/familyDelivery.d.ts +6 -0
- package/dist-public/src/conductor/familyDelivery.js +37 -0
- package/dist-public/src/conductor/familyPackArtifact.d.ts +4 -0
- package/dist-public/src/conductor/familyPackArtifact.js +260 -0
- package/dist-public/src/conductor/ideateDecision.d.ts +6 -0
- package/dist-public/src/conductor/ideateDecision.js +237 -0
- package/dist-public/src/conductor/pack.d.ts +26 -0
- package/dist-public/src/conductor/pack.js +75 -0
- package/dist-public/src/conductor/types.d.ts +111 -0
- package/dist-public/src/conductor/types.js +7 -0
- package/dist-public/src/configPath.d.ts +2 -0
- package/dist-public/src/configPath.js +7 -0
- package/dist-public/src/discoveryArtifacts.d.ts +54 -0
- package/dist-public/src/discoveryArtifacts.js +467 -0
- package/dist-public/src/discoveryCommand.d.ts +127 -0
- package/dist-public/src/discoveryCommand.js +2148 -0
- package/dist-public/src/discoveryConnections.d.ts +339 -0
- package/dist-public/src/discoveryConnections.js +613 -0
- package/dist-public/src/discoveryDocs.d.ts +129 -0
- package/dist-public/src/discoveryDocs.js +577 -0
- package/dist-public/src/discoveryEvidence.d.ts +59 -0
- package/dist-public/src/discoveryEvidence.js +198 -0
- package/dist-public/src/discoveryFireflies.d.ts +25 -0
- package/dist-public/src/discoveryFireflies.js +551 -0
- package/dist-public/src/discoveryGmail.d.ts +12 -0
- package/dist-public/src/discoveryGmail.js +466 -0
- package/dist-public/src/discoveryGong.d.ts +12 -0
- package/dist-public/src/discoveryGong.js +491 -0
- package/dist-public/src/discoveryLearningRouting.d.ts +90 -0
- package/dist-public/src/discoveryLearningRouting.js +405 -0
- package/dist-public/src/discoveryMatching.d.ts +26 -0
- package/dist-public/src/discoveryMatching.js +73 -0
- package/dist-public/src/discoveryOutlook.d.ts +12 -0
- package/dist-public/src/discoveryOutlook.js +492 -0
- package/dist-public/src/discoveryProcess.d.ts +221 -0
- package/dist-public/src/discoveryProcess.js +703 -0
- package/dist-public/src/discoveryProof.d.ts +143 -0
- package/dist-public/src/discoveryProof.js +529 -0
- package/dist-public/src/discoveryProviders.d.ts +152 -0
- package/dist-public/src/discoveryProviders.js +756 -0
- package/dist-public/src/discoveryReadiness.d.ts +219 -0
- package/dist-public/src/discoveryReadiness.js +672 -0
- package/dist-public/src/discoveryReconcile.d.ts +57 -0
- package/dist-public/src/discoveryReconcile.js +424 -0
- package/dist-public/src/discoverySlack.d.ts +12 -0
- package/dist-public/src/discoverySlack.js +452 -0
- package/dist-public/src/discoverySources.d.ts +56 -0
- package/dist-public/src/discoverySources.js +322 -0
- package/dist-public/src/discoverySync.d.ts +52 -0
- package/dist-public/src/discoverySync.js +151 -0
- package/dist-public/src/discoverySynthesis.d.ts +57 -0
- package/dist-public/src/discoverySynthesis.js +215 -0
- package/dist-public/src/discoveryTeams.d.ts +12 -0
- package/dist-public/src/discoveryTeams.js +516 -0
- package/dist-public/src/discoveryZoom.d.ts +12 -0
- package/dist-public/src/discoveryZoom.js +523 -0
- package/dist-public/src/elicitationSurface.d.ts +13 -0
- package/dist-public/src/elicitationSurface.js +77 -0
- package/dist-public/src/errorReport.d.ts +99 -0
- package/dist-public/src/errorReport.js +443 -0
- package/dist-public/src/errorTaxonomy.d.ts +84 -0
- package/dist-public/src/errorTaxonomy.js +189 -0
- package/dist-public/src/evalCalibration.d.ts +82 -0
- package/dist-public/src/evalCalibration.js +169 -0
- package/dist-public/src/evalChecks.d.ts +21 -0
- package/dist-public/src/evalChecks.js +295 -0
- package/dist-public/src/evalCompile.d.ts +56 -0
- package/dist-public/src/evalCompile.js +58 -0
- package/dist-public/src/evalImprove.d.ts +60 -0
- package/dist-public/src/evalImprove.js +175 -0
- package/dist-public/src/evalJudge.d.ts +47 -0
- package/dist-public/src/evalJudge.js +143 -0
- package/dist-public/src/evalLabels.d.ts +100 -0
- package/dist-public/src/evalLabels.js +287 -0
- package/dist-public/src/evalRecord.d.ts +68 -0
- package/dist-public/src/evalRecord.js +165 -0
- package/dist-public/src/evalRoast.d.ts +88 -0
- package/dist-public/src/evalRoast.js +249 -0
- package/dist-public/src/evidenceIntake.d.ts +66 -0
- package/dist-public/src/evidenceIntake.js +356 -0
- package/dist-public/src/feedback.d.ts +78 -0
- package/dist-public/src/feedback.js +294 -0
- package/dist-public/src/firefliesClient.d.ts +106 -0
- package/dist-public/src/firefliesClient.js +258 -0
- package/dist-public/src/firstMoveTensions.d.ts +10 -0
- package/dist-public/src/firstMoveTensions.js +93 -0
- package/dist-public/src/gitRun.d.ts +21 -0
- package/dist-public/src/gitRun.js +50 -0
- package/dist-public/src/githubReconcile.d.ts +94 -0
- package/dist-public/src/githubReconcile.js +205 -0
- package/dist-public/src/gmailNango.d.ts +131 -0
- package/dist-public/src/gmailNango.js +329 -0
- package/dist-public/src/gongNango.d.ts +118 -0
- package/dist-public/src/gongNango.js +308 -0
- package/dist-public/src/grammarGate.d.ts +13 -0
- package/dist-public/src/grammarGate.js +72 -0
- package/dist-public/src/harnessGates.d.ts +65 -0
- package/dist-public/src/harnessGates.js +168 -0
- package/dist-public/src/humanSurfaceEval.d.ts +19 -0
- package/dist-public/src/humanSurfaceEval.js +156 -0
- package/dist-public/src/ideate.d.ts +43 -0
- package/dist-public/src/ideate.js +255 -0
- package/dist-public/src/ideateContext.d.ts +11 -0
- package/dist-public/src/ideateContext.js +83 -0
- package/dist-public/src/index.d.ts +2 -0
- package/dist-public/src/index.js +4 -0
- package/dist-public/src/initCommand.d.ts +25 -0
- package/dist-public/src/initCommand.js +558 -0
- package/dist-public/src/interviewGate.d.ts +25 -0
- package/dist-public/src/interviewGate.js +126 -0
- package/dist-public/src/jsonFile.d.ts +2 -0
- package/dist-public/src/jsonFile.js +22 -0
- package/dist-public/src/loopBudget.d.ts +182 -0
- package/dist-public/src/loopBudget.js +494 -0
- package/dist-public/src/loopContracts.d.ts +35 -0
- package/dist-public/src/loopContracts.js +364 -0
- package/dist-public/src/machineState.d.ts +1 -0
- package/dist-public/src/machineState.js +9 -0
- package/dist-public/src/notionNango.d.ts +93 -0
- package/dist-public/src/notionNango.js +279 -0
- package/dist-public/src/orchestrationResult.d.ts +11 -0
- package/dist-public/src/orchestrationResult.js +73 -0
- package/dist-public/src/outlookNango.d.ts +124 -0
- package/dist-public/src/outlookNango.js +327 -0
- package/dist-public/src/packetCorrections.d.ts +40 -0
- package/dist-public/src/packetCorrections.js +172 -0
- package/dist-public/src/packetGlossary.d.ts +6 -0
- package/dist-public/src/packetGlossary.js +42 -0
- package/dist-public/src/packetIndex.d.ts +54 -0
- package/dist-public/src/packetIndex.js +744 -0
- package/dist-public/src/packetIndexEntry.d.ts +3 -0
- package/dist-public/src/packetIndexEntry.js +128 -0
- package/dist-public/src/packetIndexServe.d.ts +13 -0
- package/dist-public/src/packetIndexServe.js +113 -0
- package/dist-public/src/packetIndexWorker.d.ts +7 -0
- package/dist-public/src/packetIndexWorker.js +45 -0
- package/dist-public/src/packetLifecycle.d.ts +30 -0
- package/dist-public/src/packetLifecycle.js +127 -0
- package/dist-public/src/packetReconcile.d.ts +73 -0
- package/dist-public/src/packetReconcile.js +386 -0
- package/dist-public/src/packetStatus.d.ts +125 -0
- package/dist-public/src/packetStatus.js +770 -0
- package/dist-public/src/packetValidation.d.ts +17 -0
- package/dist-public/src/packetValidation.js +333 -0
- package/dist-public/src/packetVerify.d.ts +73 -0
- package/dist-public/src/packetVerify.js +303 -0
- package/dist-public/src/packetWrite.d.ts +52 -0
- package/dist-public/src/packetWrite.js +448 -0
- package/dist-public/src/pitch.d.ts +38 -0
- package/dist-public/src/pitch.js +154 -0
- package/dist-public/src/processMemo.d.ts +8 -0
- package/dist-public/src/processMemo.js +23 -0
- package/dist-public/src/productDetect.d.ts +30 -0
- package/dist-public/src/productDetect.js +376 -0
- package/dist-public/src/profile.d.ts +62 -0
- package/dist-public/src/profile.js +334 -0
- package/dist-public/src/questionModel.d.ts +46 -0
- package/dist-public/src/questionModel.js +74 -0
- package/dist-public/src/questionText.d.ts +7 -0
- package/dist-public/src/questionText.js +38 -0
- package/dist-public/src/redactConfig.d.ts +2 -0
- package/dist-public/src/redactConfig.js +11 -0
- package/dist-public/src/redactEngine.d.ts +59 -0
- package/dist-public/src/redactEngine.js +509 -0
- package/dist-public/src/redactGate.d.ts +63 -0
- package/dist-public/src/redactGate.js +209 -0
- package/dist-public/src/repoRead.d.ts +29 -0
- package/dist-public/src/repoRead.js +160 -0
- package/dist-public/src/research.d.ts +242 -0
- package/dist-public/src/research.js +1314 -0
- package/dist-public/src/researchCompletion.d.ts +34 -0
- package/dist-public/src/researchCompletion.js +123 -0
- package/dist-public/src/researchExecution.d.ts +47 -0
- package/dist-public/src/researchExecution.js +309 -0
- package/dist-public/src/researchFormat.d.ts +21 -0
- package/dist-public/src/researchFormat.js +77 -0
- package/dist-public/src/researchGate.d.ts +86 -0
- package/dist-public/src/researchGate.js +1036 -0
- package/dist-public/src/researchReceipt.d.ts +76 -0
- package/dist-public/src/researchReceipt.js +148 -0
- package/dist-public/src/researchRender.d.ts +2 -0
- package/dist-public/src/researchRender.js +267 -0
- package/dist-public/src/researchSigningKey.d.ts +19 -0
- package/dist-public/src/researchSigningKey.js +95 -0
- package/dist-public/src/riskClassify.d.ts +42 -0
- package/dist-public/src/riskClassify.js +149 -0
- package/dist-public/src/routines.d.ts +42 -0
- package/dist-public/src/routines.js +269 -0
- package/dist-public/src/routingPolicy.d.ts +172 -0
- package/dist-public/src/routingPolicy.js +646 -0
- package/dist-public/src/secretInput.d.ts +8 -0
- package/dist-public/src/secretInput.js +89 -0
- package/dist-public/src/selfCheck.d.ts +7 -0
- package/dist-public/src/selfCheck.js +473 -0
- package/dist-public/src/selfCheckCache.d.ts +29 -0
- package/dist-public/src/selfCheckCache.js +147 -0
- package/dist-public/src/severityClass.d.ts +15 -0
- package/dist-public/src/severityClass.js +22 -0
- package/dist-public/src/skillClientPolicy.d.ts +8 -0
- package/dist-public/src/skillClientPolicy.js +16 -0
- package/dist-public/src/skillLocal.d.ts +98 -0
- package/dist-public/src/skillLocal.js +463 -0
- package/dist-public/src/skillTreeDigest.d.ts +9 -0
- package/dist-public/src/skillTreeDigest.js +64 -0
- package/dist-public/src/slackNango.d.ts +62 -0
- package/dist-public/src/slackNango.js +208 -0
- package/dist-public/src/social/arxiv.d.ts +19 -0
- package/dist-public/src/social/arxiv.js +96 -0
- package/dist-public/src/social/github.d.ts +2 -0
- package/dist-public/src/social/github.js +78 -0
- package/dist-public/src/social/hackernews.d.ts +2 -0
- package/dist-public/src/social/hackernews.js +67 -0
- package/dist-public/src/social/index.d.ts +10 -0
- package/dist-public/src/social/index.js +79 -0
- package/dist-public/src/social/reddit.d.ts +2 -0
- package/dist-public/src/social/reddit.js +125 -0
- package/dist-public/src/social/types.d.ts +73 -0
- package/dist-public/src/social/types.js +61 -0
- package/dist-public/src/social/xml.d.ts +10 -0
- package/dist-public/src/social/xml.js +49 -0
- package/dist-public/src/social/youtube.d.ts +7 -0
- package/dist-public/src/social/youtube.js +217 -0
- package/dist-public/src/sourceIngress.d.ts +488 -0
- package/dist-public/src/sourceIngress.js +1651 -0
- package/dist-public/src/specAfter.d.ts +187 -0
- package/dist-public/src/specAfter.js +814 -0
- package/dist-public/src/specBudget.d.ts +124 -0
- package/dist-public/src/specBudget.js +424 -0
- package/dist-public/src/specDecisionSignals.d.ts +38 -0
- package/dist-public/src/specDecisionSignals.js +121 -0
- package/dist-public/src/specLinkedCommits.d.ts +7 -0
- package/dist-public/src/specLinkedCommits.js +107 -0
- package/dist-public/src/specSections.d.ts +105 -0
- package/dist-public/src/specSections.js +718 -0
- package/dist-public/src/statusGlyphs.d.ts +18 -0
- package/dist-public/src/statusGlyphs.js +75 -0
- package/dist-public/src/swarmCommand.d.ts +10 -0
- package/dist-public/src/swarmCommand.js +96 -0
- package/dist-public/src/teamsNango.d.ts +114 -0
- package/dist-public/src/teamsNango.js +301 -0
- package/dist-public/src/tokenStore.d.ts +10 -0
- package/dist-public/src/tokenStore.js +77 -0
- package/dist-public/src/trustEnvelope.d.ts +78 -0
- package/dist-public/src/trustEnvelope.js +392 -0
- package/dist-public/src/untrustedText.d.ts +6 -0
- package/dist-public/src/untrustedText.js +20 -0
- package/dist-public/src/updateNotice.d.ts +41 -0
- package/dist-public/src/updateNotice.js +290 -0
- package/dist-public/src/vendorYaml.d.ts +1 -0
- package/dist-public/src/vendorYaml.js +7374 -0
- package/dist-public/src/workflowRunActuals.d.ts +67 -0
- package/dist-public/src/workflowRunActuals.js +184 -0
- package/dist-public/src/zendeskDiscovery.d.ts +12 -0
- package/dist-public/src/zendeskDiscovery.js +513 -0
- package/dist-public/src/zendeskNango.d.ts +131 -0
- package/dist-public/src/zendeskNango.js +344 -0
- package/dist-public/src/zoomNango.d.ts +106 -0
- package/dist-public/src/zoomNango.js +351 -0
- package/docs/CHANGELOG.md +32 -0
- package/docs/THIRD_PARTY_NOTICES.md +36 -0
- package/package.json +71 -4
- package/schemas/bug-capsule-receipt.schema.json +54 -0
- package/schemas/bug-capsule.schema.json +189 -0
- package/schemas/discovery-evidence-envelope.schema.json +79 -0
- package/schemas/discovery-processing-receipt.schema.json +71 -0
- package/schemas/discovery-service-contract.schema.json +189 -0
- package/skills/AGENTS.md +32 -0
- package/skills/README.md +287 -0
- package/skills/bug/SKILL.md +49 -0
- package/skills/build-preview-spec/SKILL.md +103 -0
- package/skills/capture-external-artifact/SKILL.md +23 -0
- package/skills/capture-external-artifact/agents/openai.yaml +4 -0
- package/skills/capture-external-artifact/references/extractor-libraries.md +27 -0
- package/skills/check-spec-health/SKILL.md +45 -0
- package/skills/check-spec-health/agents/openai.yaml +4 -0
- package/skills/competitive-positioning/SKILL.md +86 -0
- package/skills/competitive-positioning/agents/openai.yaml +4 -0
- package/skills/cpo-lens/SKILL.md +398 -0
- package/skills/cpo-lens/agents/openai.yaml +4 -0
- package/skills/create-prd/SKILL.md +26 -0
- package/skills/create-prd/agents/openai.yaml +4 -0
- package/skills/customer-discovery/SKILL.md +192 -0
- package/skills/design-system/SKILL.md +49 -0
- package/skills/design-system/agents/openai.yaml +4 -0
- package/skills/discussion-guide/SKILL.md +75 -0
- package/skills/discussion-guide/agents/openai.yaml +4 -0
- package/skills/firecrawl-research-papers/SKILL.md +96 -0
- package/skills/firecrawl-research-papers/agents/openai.yaml +4 -0
- package/skills/foo-roast/SKILL.md +325 -0
- package/skills/generate-gtm-brief/SKILL.md +41 -0
- package/skills/generate-gtm-brief/agents/openai.yaml +4 -0
- package/skills/generate-gtm-brief/references/gtm-brief-template.md +56 -0
- package/skills/gong-quotes/SKILL.md +43 -0
- package/skills/gong-quotes/agents/openai.yaml +4 -0
- package/skills/grill-me/SKILL.md +27 -0
- package/skills/grill-me/agents/openai.yaml +4 -0
- package/skills/ideate/SKILL.md +180 -0
- package/skills/ideate/references/family-packs.md +5 -0
- package/skills/initiative-tracker/SKILL.md +23 -0
- package/skills/initiative-tracker/agents/openai.yaml +4 -0
- package/skills/interop-review/SKILL.md +25 -0
- package/skills/interop-review/agents/openai.yaml +4 -0
- package/skills/interview-me/SKILL.md +404 -0
- package/skills/interview-me/agents/openai.yaml +4 -0
- package/skills/loop-library-audit/SKILL.md +123 -0
- package/skills/pitch/SKILL.md +110 -0
- package/skills/pitch/references/opportunity-assessment.md +136 -0
- package/skills/pitch/references/prfaq-template.md +54 -0
- package/skills/pmm-release-briefing/SKILL.md +27 -0
- package/skills/pmm-release-briefing/agents/openai.yaml +4 -0
- package/skills/pmm-release-briefing/references/variant-generalized.md +16 -0
- package/skills/positioning-messaging/SKILL.md +70 -0
- package/skills/positioning-messaging/agents/openai.yaml +4 -0
- package/skills/positioning-messaging/references/guest-insights.md +1400 -0
- package/skills/preview-swarm/SKILL.md +418 -0
- package/skills/preview-swarm/agents/openai.yaml +4 -0
- package/skills/preview-swarm/references/html-effectiveness-build-previews.md +168 -0
- package/skills/product-copywriting/SKILL.md +127 -0
- package/skills/product-copywriting/agents/openai.yaml +4 -0
- package/skills/product-copywriting/references/foo-voice.md +26 -0
- package/skills/product-shape-interview/SKILL.md +219 -0
- package/skills/product-shape-interview/agents/openai.yaml +4 -0
- package/skills/ready-for-release/SKILL.md +39 -0
- package/skills/ready-for-release/agents/openai.yaml +4 -0
- package/skills/redact-transcripts/SKILL.md +23 -0
- package/skills/redact-transcripts/agents/openai.yaml +4 -0
- package/skills/research-brief/SKILL.md +48 -0
- package/skills/research-brief/agents/openai.yaml +4 -0
- package/skills/research-refresh/SKILL.md +63 -0
- package/skills/research-refresh/references/worked-cases.md +44 -0
- package/skills/review-loop/SKILL.md +200 -0
- package/skills/review-spec/SKILL.md +32 -0
- package/skills/review-spec/agents/openai.yaml +4 -0
- package/skills/rfc-from-research/SKILL.md +42 -0
- package/skills/rfc-from-research/agents/openai.yaml +4 -0
- package/skills/rfc-from-research/references/rfc-pattern.md +69 -0
- package/skills/skill-registry.yaml +810 -0
- package/skills/spec-cleanup/SKILL.md +103 -0
- package/skills/spec-cleanup/agents/openai.yaml +4 -0
- package/skills/spec-swarm/SKILL.md +87 -0
- package/skills/spec-swarm/agents/openai.yaml +4 -0
- package/skills/spec-swarm/template/SKILL.template.md +94 -0
- package/skills/spec-swarm/template/personas/accessibility-inclusion.md +40 -0
- package/skills/spec-swarm/template/personas/ai-technical-pm.md +69 -0
- package/skills/spec-swarm/template/personas/analytics-engineering.md +39 -0
- package/skills/spec-swarm/template/personas/applied-ai-eval.md +64 -0
- package/skills/spec-swarm/template/personas/business-gm-pm.md +67 -0
- package/skills/spec-swarm/template/personas/consumer-craft-pm.md +68 -0
- package/skills/spec-swarm/template/personas/content-design.md +40 -0
- package/skills/spec-swarm/template/personas/cpo.md +42 -0
- package/skills/spec-swarm/template/personas/data-science.md +42 -0
- package/skills/spec-swarm/template/personas/developer-experience.md +65 -0
- package/skills/spec-swarm/template/personas/dx-product.md +70 -0
- package/skills/spec-swarm/template/personas/field.md +43 -0
- package/skills/spec-swarm/template/personas/finance-cfo.md +40 -0
- package/skills/spec-swarm/template/personas/growth-pm.md +67 -0
- package/skills/spec-swarm/template/personas/platform-pm.md +67 -0
- package/skills/spec-swarm/template/personas/pmm.md +43 -0
- package/skills/spec-swarm/template/personas/principal-product-designer.md +42 -0
- package/skills/spec-swarm/template/personas/product-ops-program.md +41 -0
- package/skills/spec-swarm/template/personas/qa-release.md +41 -0
- package/skills/spec-swarm/template/personas/responsible-ai-safety.md +64 -0
- package/skills/spec-swarm/template/personas/security-privacy-legal.md +40 -0
- package/skills/spec-swarm/template/personas/strategy-competitive.md +41 -0
- package/skills/spec-swarm/template/personas/technical-architect.md +42 -0
- package/skills/spec-swarm/template/personas/technical-lead.md +43 -0
- package/skills/spec-swarm/template/personas/user-research.md +41 -0
- package/skills/spec-swarm-accessibility-inclusion/SKILL.md +95 -0
- package/skills/spec-swarm-accessibility-inclusion/agents/openai.yaml +4 -0
- package/skills/spec-swarm-ai-technical-pm/SKILL.md +124 -0
- package/skills/spec-swarm-analytics-engineering/SKILL.md +94 -0
- package/skills/spec-swarm-analytics-engineering/agents/openai.yaml +4 -0
- package/skills/spec-swarm-applied-ai-eval/SKILL.md +120 -0
- package/skills/spec-swarm-business-gm-pm/SKILL.md +122 -0
- package/skills/spec-swarm-consumer-craft-pm/SKILL.md +122 -0
- package/skills/spec-swarm-content-design/SKILL.md +95 -0
- package/skills/spec-swarm-content-design/agents/openai.yaml +4 -0
- package/skills/spec-swarm-cpo/SKILL.md +94 -0
- package/skills/spec-swarm-cpo/agents/openai.yaml +4 -0
- package/skills/spec-swarm-data-science/SKILL.md +95 -0
- package/skills/spec-swarm-data-science/agents/openai.yaml +4 -0
- package/skills/spec-swarm-developer-experience/SKILL.md +121 -0
- package/skills/spec-swarm-dx-product/SKILL.md +126 -0
- package/skills/spec-swarm-field/SKILL.md +96 -0
- package/skills/spec-swarm-field/agents/openai.yaml +4 -0
- package/skills/spec-swarm-finance-cfo/SKILL.md +95 -0
- package/skills/spec-swarm-finance-cfo/agents/openai.yaml +4 -0
- package/skills/spec-swarm-growth-pm/SKILL.md +122 -0
- package/skills/spec-swarm-platform-pm/SKILL.md +122 -0
- package/skills/spec-swarm-pmm/SKILL.md +96 -0
- package/skills/spec-swarm-pmm/agents/openai.yaml +4 -0
- package/skills/spec-swarm-principal-product-designer/SKILL.md +95 -0
- package/skills/spec-swarm-principal-product-designer/agents/openai.yaml +4 -0
- package/skills/spec-swarm-product-ops-program/SKILL.md +96 -0
- package/skills/spec-swarm-product-ops-program/agents/openai.yaml +4 -0
- package/skills/spec-swarm-qa-release/SKILL.md +96 -0
- package/skills/spec-swarm-qa-release/agents/openai.yaml +4 -0
- package/skills/spec-swarm-responsible-ai-safety/SKILL.md +120 -0
- package/skills/spec-swarm-security-privacy-legal/SKILL.md +95 -0
- package/skills/spec-swarm-security-privacy-legal/agents/openai.yaml +4 -0
- package/skills/spec-swarm-strategy-competitive/SKILL.md +96 -0
- package/skills/spec-swarm-strategy-competitive/agents/openai.yaml +4 -0
- package/skills/spec-swarm-technical-architect/SKILL.md +95 -0
- package/skills/spec-swarm-technical-architect/agents/openai.yaml +4 -0
- package/skills/spec-swarm-technical-lead/SKILL.md +96 -0
- package/skills/spec-swarm-technical-lead/agents/openai.yaml +4 -0
- package/skills/spec-swarm-user-research/SKILL.md +95 -0
- package/skills/spec-swarm-user-research/agents/openai.yaml +4 -0
- package/skills/strategy-check/SKILL.md +170 -0
- package/skills/strategy-check/agents/openai.yaml +4 -0
- package/skills/study-digest/SKILL.md +41 -0
- package/skills/synthetic-customer/SKILL.md +68 -0
- package/skills/update-cli-spec/SKILL.md +69 -0
- package/skills/update-cli-spec/agents/openai.yaml +4 -0
- package/skills/voc-researcher/SKILL.md +45 -0
- package/skills/voc-researcher/agents/openai.yaml +4 -0
- package/skills-lock.json +35 -0
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
// evidence-intake-loop-v0 — turn shipped product decisions into enforced,
|
|
2
|
+
// agent-readable standards. A governed, read-only sweep over APPROVED GitHub
|
|
3
|
+
// PRs and Linear issues extracts decision evidence (the *why* living in review
|
|
4
|
+
// comments and issue threads), suggests the narrowest enforcement route per
|
|
5
|
+
// candidate, and emits ONE pending review packet. Automation ends at the
|
|
6
|
+
// packet: no standard changes without a human disposition, and every accepted
|
|
7
|
+
// disposition appends a provenance-carrying decision-log event.
|
|
8
|
+
//
|
|
9
|
+
// Ownership (conflict-1 resolution, 2026-07-06): this module is the single
|
|
10
|
+
// governed-sweep engine; coding-agent-pm-enhancements T-004 (channel-scour /
|
|
11
|
+
// backlog-triage) and T-005 (replay-the-week) are satisfied by routing modes
|
|
12
|
+
// over this engine, not by their own sweeps.
|
|
13
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
import { approvalStates, minimizeSummary, sourceKey } from "./sourceIngress.js";
|
|
16
|
+
import { appendEvent, updateTask } from "./packetWrite.js";
|
|
17
|
+
import { readJson } from "./jsonFile.js";
|
|
18
|
+
import { flagValue, hasFlag } from "./cliArgs.js";
|
|
19
|
+
import { markFailure } from "./errorTaxonomy.js";
|
|
20
|
+
// A malformed evidence invocation returns exit 1 with a usage line (not a throw),
|
|
21
|
+
// so it must mark itself usage_error — otherwise the top-level writer sees a
|
|
22
|
+
// codeless nonzero exit and files it as a command_error crash.
|
|
23
|
+
function usageFail(output) {
|
|
24
|
+
markFailure({ errorClass: "usage_error", errorCode: "E_BAD_FLAG", message: output.trim() });
|
|
25
|
+
return { output, exitCode: 1 };
|
|
26
|
+
}
|
|
27
|
+
// Decision-evidence heuristic: a comment is a candidate when it states a
|
|
28
|
+
// durable rule or decision, not a one-off nit.
|
|
29
|
+
const DECISION_SIGNAL = /\b(?:we decided|going forward|from now on|always|never|must|the rule is|our convention|as a standard|standardize)\b|\bdecisions?:/i;
|
|
30
|
+
// Route the candidate to the NARROWEST enforcement layer (R-002):
|
|
31
|
+
// deterministic-shaped evidence → lint; verifiable-outcome → eval;
|
|
32
|
+
// demonstrable-pattern → example; judgment-shaped → guidance. The route is a
|
|
33
|
+
// signal — inspectable, overridable at disposition, never auto-applied.
|
|
34
|
+
export function suggestRoute(text) {
|
|
35
|
+
if (/\b(regex|naming|prefix|suffix|import order|format(ting)?|casing|file name|must match)\b/i.test(text)) {
|
|
36
|
+
return { route: "lint", rationale: "deterministic-shaped: mechanically checkable pattern (narrowest layer)" };
|
|
37
|
+
}
|
|
38
|
+
if (/\b(test|assert|verif|measure|coverage|benchmark|eval)\b/i.test(text)) {
|
|
39
|
+
return { route: "eval", rationale: "verifiable-shaped: an observable outcome a check can re-run" };
|
|
40
|
+
}
|
|
41
|
+
if (/\b(example|like this|see how|pattern in|reference implementation)\b/i.test(text)) {
|
|
42
|
+
return { route: "example", rationale: "demonstrable-shaped: best taught by a canonical example" };
|
|
43
|
+
}
|
|
44
|
+
if (/\b(prefer|should|tone|wording|judgment|taste|feel|when in doubt)\b/i.test(text)) {
|
|
45
|
+
return { route: "guidance", rationale: "judgment-shaped: needs agent guidance, not a mechanical rule" };
|
|
46
|
+
}
|
|
47
|
+
if (DECISION_SIGNAL.test(text)) {
|
|
48
|
+
return { route: "guidance", rationale: "durable decision without a mechanical shape: default to guidance" };
|
|
49
|
+
}
|
|
50
|
+
return { route: "no-change", rationale: "no durable decision signal — likely a one-off; propose nothing" };
|
|
51
|
+
}
|
|
52
|
+
// The sweep: refuse any unapproved source (fail-closed, same gate as claims),
|
|
53
|
+
// extract decision-shaped comments, minimize, and route.
|
|
54
|
+
export function sweepCandidates(governingPacketDir, sources) {
|
|
55
|
+
const approvals = approvalStates(governingPacketDir);
|
|
56
|
+
const candidates = [];
|
|
57
|
+
const refused = [];
|
|
58
|
+
let n = 0;
|
|
59
|
+
for (const source of sources) {
|
|
60
|
+
const state = approvals.get(sourceKey(source.source_id))?.state ?? "excluded";
|
|
61
|
+
if (state !== "approved") {
|
|
62
|
+
refused.push({ source_id: source.source_id, reason: `source not approved (state: ${state}) — sweep is fail-closed` });
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
for (const comment of source.comments) {
|
|
66
|
+
if (!DECISION_SIGNAL.test(comment))
|
|
67
|
+
continue;
|
|
68
|
+
n += 1;
|
|
69
|
+
const { route, rationale } = suggestRoute(comment);
|
|
70
|
+
candidates.push({
|
|
71
|
+
id: `E-${String(n).padStart(3, "0")}`,
|
|
72
|
+
summary: minimizeSummary(comment).slice(0, 240),
|
|
73
|
+
source_url: source.url,
|
|
74
|
+
source_type: source.source_type,
|
|
75
|
+
suggested_route: route,
|
|
76
|
+
rationale,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return { candidates, refused };
|
|
81
|
+
}
|
|
82
|
+
// Emit the single pending review packet — the TERMINAL state of the automated
|
|
83
|
+
// phase (R-003). Each candidate is a task whose done_when is the human
|
|
84
|
+
// disposition; nothing here applies a standard.
|
|
85
|
+
export function emitPendingPacket(root, name, candidates, at) {
|
|
86
|
+
const relDir = name.includes("/") ? name : path.posix.join("specs", name);
|
|
87
|
+
const packetDir = path.resolve(root, relDir);
|
|
88
|
+
if (existsSync(path.join(packetDir, "spec.md")))
|
|
89
|
+
throw new Error(`refusing to overwrite existing packet: ${relDir}`);
|
|
90
|
+
mkdirSync(packetDir, { recursive: true });
|
|
91
|
+
const specId = path.basename(packetDir).replace(/-/g, "_");
|
|
92
|
+
const isoDate = at.slice(0, 10);
|
|
93
|
+
writeFileSync(path.join(packetDir, "spec.md"), [
|
|
94
|
+
"---",
|
|
95
|
+
`spec_id: ${specId}`,
|
|
96
|
+
`title: Evidence intake — pending review (${isoDate})`,
|
|
97
|
+
"mode: capability",
|
|
98
|
+
"lifecycle: draft",
|
|
99
|
+
"stage: shaping",
|
|
100
|
+
"owner: product",
|
|
101
|
+
"autonomy: human-in-loop",
|
|
102
|
+
`updated: ${isoDate}`,
|
|
103
|
+
"---",
|
|
104
|
+
"",
|
|
105
|
+
`# Evidence intake — pending review (${isoDate})`,
|
|
106
|
+
"",
|
|
107
|
+
"## Intent",
|
|
108
|
+
"",
|
|
109
|
+
"Candidates extracted by the governed evidence sweep. Every suggested route is a signal awaiting YOUR disposition (accept / override / reject) — nothing below is a standard until a human says so.",
|
|
110
|
+
"",
|
|
111
|
+
"## Requirements",
|
|
112
|
+
"",
|
|
113
|
+
...candidates.map((c) => `- ${c.id}: [${c.suggested_route}] ${c.summary} — evidence: ${c.source_url}`),
|
|
114
|
+
...(candidates.length ? [] : ["- (no candidates this sweep)"]),
|
|
115
|
+
"",
|
|
116
|
+
"## Open Questions",
|
|
117
|
+
"",
|
|
118
|
+
"- Disposition each candidate: foo evidence disposition <this-packet> <E-xxx> --action accept|override|reject --by <you>",
|
|
119
|
+
"",
|
|
120
|
+
].join("\n"));
|
|
121
|
+
const due = new Date(new Date(at).getTime() + 7 * 86400000).toISOString().slice(0, 10);
|
|
122
|
+
const taskBlock = (c) => [
|
|
123
|
+
` - id: ${c.id}`,
|
|
124
|
+
` title: ${JSON.stringify(`[${c.suggested_route}] ${c.summary.slice(0, 80)}`)}`,
|
|
125
|
+
" status: todo",
|
|
126
|
+
" agreement: suggested",
|
|
127
|
+
" stage: shaping",
|
|
128
|
+
" refs: []",
|
|
129
|
+
" depends_on: []",
|
|
130
|
+
" owner: product",
|
|
131
|
+
" autonomy: human-in-loop",
|
|
132
|
+
" do:",
|
|
133
|
+
` - ${JSON.stringify(`Disposition: ${c.suggested_route} — ${c.rationale}`)}`,
|
|
134
|
+
` - ${JSON.stringify(`Evidence: ${c.source_url}`)}`,
|
|
135
|
+
" done_when:",
|
|
136
|
+
` - id: C-${c.id.slice(2)}`,
|
|
137
|
+
` text: ${JSON.stringify("A human dispositioned this candidate (accept/override/reject) with provenance.")}`,
|
|
138
|
+
" done: false",
|
|
139
|
+
" proof: null",
|
|
140
|
+
" completed: null",
|
|
141
|
+
" blocked: null",
|
|
142
|
+
" review:",
|
|
143
|
+
" owner: product",
|
|
144
|
+
` due: ${JSON.stringify(due)}`,
|
|
145
|
+
" stale_after_days: 7",
|
|
146
|
+
" extensions: {}",
|
|
147
|
+
];
|
|
148
|
+
writeFileSync(path.join(packetDir, "tasks.yaml"), [
|
|
149
|
+
`schema_version: "0.1"`,
|
|
150
|
+
`spec_id: ${specId}`,
|
|
151
|
+
`spec_ref: ${relDir}/spec.md`,
|
|
152
|
+
`updated: ${JSON.stringify(at)}`,
|
|
153
|
+
"defaults:",
|
|
154
|
+
" autonomy: human-in-loop",
|
|
155
|
+
" stale_after_days:",
|
|
156
|
+
" suggested: 7",
|
|
157
|
+
" discovered: 7",
|
|
158
|
+
"ledger:",
|
|
159
|
+
" segment_order:",
|
|
160
|
+
" - events.jsonl",
|
|
161
|
+
"tasks:",
|
|
162
|
+
...(candidates.length ? candidates.flatMap(taskBlock) : [
|
|
163
|
+
" - id: E-000",
|
|
164
|
+
' title: "No candidates this sweep (clean no-op)"',
|
|
165
|
+
" status: done",
|
|
166
|
+
" agreement: agreed",
|
|
167
|
+
" stage: shaping",
|
|
168
|
+
" refs: []",
|
|
169
|
+
" depends_on: []",
|
|
170
|
+
" owner: product",
|
|
171
|
+
" autonomy: human-in-loop",
|
|
172
|
+
" do:",
|
|
173
|
+
' - "Record the clean sweep."',
|
|
174
|
+
" done_when:",
|
|
175
|
+
" - id: C-000",
|
|
176
|
+
' text: "Sweep ran and found no durable decision candidates."',
|
|
177
|
+
" done: true",
|
|
178
|
+
' proof: "clean sweep"',
|
|
179
|
+
" completed:",
|
|
180
|
+
` at: ${JSON.stringify(at)}`,
|
|
181
|
+
' by: "foo-evidence-sweep"',
|
|
182
|
+
' summary: "clean no-op"',
|
|
183
|
+
" event: null",
|
|
184
|
+
" blocked: null",
|
|
185
|
+
" review:",
|
|
186
|
+
" owner: product",
|
|
187
|
+
" due: null",
|
|
188
|
+
" stale_after_days: 7",
|
|
189
|
+
" extensions: {}",
|
|
190
|
+
]),
|
|
191
|
+
"",
|
|
192
|
+
].join("\n"));
|
|
193
|
+
const actor = { type: "agent", id: "foo-cli", provider: "foo", model: "deterministic", persona: "tool", skills: [], adapter: "cli", mode: "human-in-loop" };
|
|
194
|
+
const sweepEvent = {
|
|
195
|
+
specversion: "0.1",
|
|
196
|
+
id: `evt_evidence_sweep_${Date.now()}`,
|
|
197
|
+
source: "agent://foo/evidence-intake",
|
|
198
|
+
type: "com.adaptivespec.evidence.sweep_emitted",
|
|
199
|
+
subject: `packet:${relDir}`,
|
|
200
|
+
time: at,
|
|
201
|
+
actor,
|
|
202
|
+
data: { candidates: candidates.length, terminal: "pending-review packet — automation ends here" },
|
|
203
|
+
extensions: {},
|
|
204
|
+
};
|
|
205
|
+
// One suggested-task event per candidate: a suggested task without ledger
|
|
206
|
+
// provenance is invalid by the packet contract.
|
|
207
|
+
const suggestedEvents = candidates.map((c, i) => ({
|
|
208
|
+
specversion: "0.1",
|
|
209
|
+
id: `evt_evidence_candidate_${Date.now()}_${i}`,
|
|
210
|
+
source: "agent://foo/evidence-intake",
|
|
211
|
+
type: "com.adaptivespec.task.suggested",
|
|
212
|
+
subject: `task:${c.id}`,
|
|
213
|
+
time: at,
|
|
214
|
+
actor,
|
|
215
|
+
data: { suggested_route: c.suggested_route, rationale: c.rationale, evidence_url: c.source_url },
|
|
216
|
+
extensions: {},
|
|
217
|
+
}));
|
|
218
|
+
writeFileSync(path.join(packetDir, "events.jsonl"), [sweepEvent, ...suggestedEvents].map((e) => JSON.stringify(e)).join("\n") + "\n");
|
|
219
|
+
return packetDir;
|
|
220
|
+
}
|
|
221
|
+
export function suggestTriage(text) {
|
|
222
|
+
if (/\b(blocker|blocking|urgent|sev-?[01]|outage|regression|broken|security)\b/i.test(text)) {
|
|
223
|
+
return { bucket: "now", rationale: "urgency signal: blocking/regression/security language" };
|
|
224
|
+
}
|
|
225
|
+
if (/\b(customer|deal|revenue|churn|committed|deadline|launch)\b/i.test(text)) {
|
|
226
|
+
return { bucket: "next", rationale: "commitment signal: customer/revenue/deadline language" };
|
|
227
|
+
}
|
|
228
|
+
return { bucket: "later", rationale: "no urgency or commitment signal — default to later" };
|
|
229
|
+
}
|
|
230
|
+
export function replayWindow(packetDir, since) {
|
|
231
|
+
const file = path.join(packetDir, "events.jsonl");
|
|
232
|
+
const lines = existsSync(file) ? readFileSync(file, "utf8").split("\n").filter((l) => l.trim()) : [];
|
|
233
|
+
const byType = {};
|
|
234
|
+
const decisions = [];
|
|
235
|
+
const proofs = [];
|
|
236
|
+
let count = 0;
|
|
237
|
+
for (const line of lines) {
|
|
238
|
+
let evt;
|
|
239
|
+
try {
|
|
240
|
+
evt = JSON.parse(line);
|
|
241
|
+
}
|
|
242
|
+
catch {
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
const time = String(evt.time ?? "");
|
|
246
|
+
if (time < since)
|
|
247
|
+
continue;
|
|
248
|
+
count += 1;
|
|
249
|
+
const type = String(evt.type ?? "unknown");
|
|
250
|
+
byType[type] = (byType[type] ?? 0) + 1;
|
|
251
|
+
const data = (evt.data ?? {});
|
|
252
|
+
if (type.includes("decision")) {
|
|
253
|
+
decisions.push({ at: time, by: String(evt.actor?.id ?? "unknown"), summary: String(data.summary ?? data.question ?? "").slice(0, 160) });
|
|
254
|
+
}
|
|
255
|
+
if (type.includes("task") && String(data.to ?? "") === "done") {
|
|
256
|
+
proofs.push({ at: time, task: String(data.task ?? evt.subject ?? "") });
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return { schema_version: "0.1", packet: path.basename(packetDir), since, events: count, by_type: byType, decisions, proofs };
|
|
260
|
+
}
|
|
261
|
+
// The human disposition (R-003): attributed, appended to the ledger with the
|
|
262
|
+
// evidence back-link. Accept (or override-with-route) proves the task; reject
|
|
263
|
+
// drops it. Overriding the route is first-class — the suggestion is a signal.
|
|
264
|
+
export function recordDisposition(packetDir, candidateId, opts) {
|
|
265
|
+
if (!opts.by.trim())
|
|
266
|
+
throw new Error("a disposition needs --by <who>");
|
|
267
|
+
if (opts.action === "override" && !opts.route)
|
|
268
|
+
throw new Error("override needs --route guidance|lint|example|eval|no-change");
|
|
269
|
+
const tasks = readFileSync(path.join(packetDir, "tasks.yaml"), "utf8");
|
|
270
|
+
const literalId = candidateId.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
271
|
+
const evidence = tasks.match(new RegExp(`id: ${literalId}[\\s\\S]*?Evidence: ([^\\\\"]+)`))?.[1] ?? "unknown";
|
|
272
|
+
appendEvent({
|
|
273
|
+
packetDir,
|
|
274
|
+
type: "com.adaptivespec.evidence.disposition",
|
|
275
|
+
actor: { type: "human", id: opts.by },
|
|
276
|
+
data: {
|
|
277
|
+
candidate: candidateId,
|
|
278
|
+
action: opts.action,
|
|
279
|
+
route: opts.route ?? null,
|
|
280
|
+
evidence_url: evidence,
|
|
281
|
+
},
|
|
282
|
+
});
|
|
283
|
+
updateTask({
|
|
284
|
+
packetDir,
|
|
285
|
+
taskId: candidateId,
|
|
286
|
+
status: opts.action === "reject" ? "dropped" : "done",
|
|
287
|
+
proof: opts.action === "reject" ? undefined : `human disposition: ${opts.action}${opts.route ? ` → ${opts.route}` : ""} by ${opts.by}; evidence: ${evidence}`,
|
|
288
|
+
reason: opts.action === "reject" ? `rejected by ${opts.by}` : undefined,
|
|
289
|
+
actor: { type: "human", id: opts.by },
|
|
290
|
+
});
|
|
291
|
+
return { action: opts.action, route: opts.route };
|
|
292
|
+
}
|
|
293
|
+
// --- CLI ------------------------------------------------------------------------
|
|
294
|
+
export function runEvidenceCommand(root, args) {
|
|
295
|
+
const sub = args[0];
|
|
296
|
+
const json = hasFlag(args, "--json");
|
|
297
|
+
const flag = (name) => flagValue(args, name);
|
|
298
|
+
if (sub === "sweep") {
|
|
299
|
+
const governing = args[1];
|
|
300
|
+
const fixture = flag("--fixture");
|
|
301
|
+
if (!governing || !fixture)
|
|
302
|
+
return usageFail("usage: foo evidence sweep <governing-packet-dir> --fixture <sources.json> [--out <packet-name>] [--json]\n");
|
|
303
|
+
const sources = readJson(path.resolve(root, fixture));
|
|
304
|
+
const governingDir = path.resolve(root, governing);
|
|
305
|
+
const mode = flag("--mode") ?? "standards";
|
|
306
|
+
let { candidates, refused } = sweepCandidates(governingDir, sources);
|
|
307
|
+
if (mode === "triage") {
|
|
308
|
+
// cpe T-004 routing mode: priority buckets instead of enforcement layers.
|
|
309
|
+
candidates = candidates
|
|
310
|
+
.map((c) => {
|
|
311
|
+
const t = suggestTriage(c.summary);
|
|
312
|
+
return { ...c, suggested_route: c.suggested_route, rationale: `[${t.bucket}] ${t.rationale}`, summary: `(${t.bucket}) ${c.summary}` };
|
|
313
|
+
})
|
|
314
|
+
.sort((a, b) => a.summary.localeCompare(b.summary));
|
|
315
|
+
}
|
|
316
|
+
const at = new Date().toISOString();
|
|
317
|
+
const outName = flag("--out") ?? `evidence-review-${at.slice(0, 10)}`;
|
|
318
|
+
const packetDir = emitPendingPacket(root, outName, candidates, at);
|
|
319
|
+
if (json)
|
|
320
|
+
return { output: `${JSON.stringify({ schema_version: "0.1", candidates, refused, packet: path.relative(root, packetDir) }, null, 2)}\n`, exitCode: 0 };
|
|
321
|
+
const lines = [
|
|
322
|
+
`evidence sweep — ${candidates.length} candidate(s), ${refused.length} source(s) refused (fail-closed)`,
|
|
323
|
+
...candidates.map((c) => ` ${c.id} [${c.suggested_route}] ${c.summary.slice(0, 90)} — ${c.source_url}`),
|
|
324
|
+
...refused.map((r) => ` refused: ${r.source_id.provider}/${r.source_id.connection_id} — ${r.reason}`),
|
|
325
|
+
`Pending review packet: ${path.relative(root, packetDir)} (automation ends here — disposition each candidate)`,
|
|
326
|
+
];
|
|
327
|
+
return { output: `${lines.join("\n")}\n`, exitCode: 0 };
|
|
328
|
+
}
|
|
329
|
+
if (sub === "replay") {
|
|
330
|
+
const packet = args[1];
|
|
331
|
+
if (!packet)
|
|
332
|
+
return usageFail("usage: foo evidence replay <packet-dir> [--since <iso-date>] [--json]\n");
|
|
333
|
+
const since = flag("--since") ?? new Date(Date.now() - 7 * 86400000).toISOString();
|
|
334
|
+
const report = replayWindow(path.resolve(root, packet), since);
|
|
335
|
+
if (json)
|
|
336
|
+
return { output: `${JSON.stringify(report, null, 2)}\n`, exitCode: 0 };
|
|
337
|
+
const lines = [
|
|
338
|
+
`replay — ${report.packet} since ${report.since.slice(0, 10)}: ${report.events} event(s)`,
|
|
339
|
+
...Object.entries(report.by_type).map(([t, n]) => ` ${n}× ${t}`),
|
|
340
|
+
...report.decisions.map((d) => ` decision (${d.by}, ${d.at.slice(0, 10)}): ${d.summary}`),
|
|
341
|
+
...report.proofs.map((p) => ` proven: ${p.task} (${p.at.slice(0, 10)})`),
|
|
342
|
+
];
|
|
343
|
+
return { output: `${lines.join("\n")}\n`, exitCode: 0 };
|
|
344
|
+
}
|
|
345
|
+
if (sub === "disposition") {
|
|
346
|
+
const packet = args[1];
|
|
347
|
+
const candidate = args[2];
|
|
348
|
+
const action = flag("--action");
|
|
349
|
+
const by = flag("--by") ?? "";
|
|
350
|
+
if (!packet || !candidate || !action)
|
|
351
|
+
return usageFail("usage: foo evidence disposition <pending-packet> <E-xxx> --action accept|override|reject [--route r] --by <who>\n");
|
|
352
|
+
const result = recordDisposition(path.resolve(root, packet), candidate, { action, route: flag("--route"), by });
|
|
353
|
+
return { output: `Dispositioned ${candidate}: ${result.action}${result.route ? ` → ${result.route}` : ""} (attributed to ${by}; provenance on the ledger).\n`, exitCode: 0 };
|
|
354
|
+
}
|
|
355
|
+
return usageFail(`unknown evidence subcommand: ${sub ?? "(none)"}. Try: sweep [--mode standards|triage] | replay | disposition\n`);
|
|
356
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export type FeedbackSignal = "revealed" | "solicited" | "friction";
|
|
2
|
+
export type FeedbackEvent = {
|
|
3
|
+
schema_version: "0.1";
|
|
4
|
+
event_type: "feedback";
|
|
5
|
+
id: string;
|
|
6
|
+
timestamp: string;
|
|
7
|
+
signal: FeedbackSignal;
|
|
8
|
+
kind: string;
|
|
9
|
+
domain?: string;
|
|
10
|
+
command?: string;
|
|
11
|
+
rating?: number;
|
|
12
|
+
reason_code?: string;
|
|
13
|
+
error_class?: string;
|
|
14
|
+
note?: string;
|
|
15
|
+
redactions?: number;
|
|
16
|
+
tester_id?: string;
|
|
17
|
+
packet_slug?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function feedbackEnabled(root: string, env?: NodeJS.ProcessEnv): boolean;
|
|
20
|
+
export declare function redactNote(note: string): {
|
|
21
|
+
text: string;
|
|
22
|
+
redactions: number;
|
|
23
|
+
};
|
|
24
|
+
export declare function recordFeedback(root: string, event: Omit<FeedbackEvent, "schema_version" | "event_type" | "id" | "timestamp" | "tester_id">, env?: NodeJS.ProcessEnv): FeedbackEvent | null;
|
|
25
|
+
export declare function recordRevealed(root: string, kind: "handoff" | "abandon" | "override" | "kept", ctx?: {
|
|
26
|
+
domain?: string;
|
|
27
|
+
command?: string;
|
|
28
|
+
packet_slug?: string;
|
|
29
|
+
}, env?: NodeJS.ProcessEnv): FeedbackEvent | null;
|
|
30
|
+
export declare function recordRating(root: string, rating: number, ctx?: {
|
|
31
|
+
domain?: string;
|
|
32
|
+
command?: string;
|
|
33
|
+
packet_slug?: string;
|
|
34
|
+
}, env?: NodeJS.ProcessEnv): FeedbackEvent | null;
|
|
35
|
+
export declare function recordSpontaneous(root: string, note: string, env?: NodeJS.ProcessEnv): FeedbackEvent | null;
|
|
36
|
+
export declare function classifyDecision(recordText: string): "override" | "kept" | "undecided" | null;
|
|
37
|
+
export declare function recordIdeateDecision(root: string, recordPath: string, env?: NodeJS.ProcessEnv): "override" | "kept" | null;
|
|
38
|
+
export declare const TRANSIENT_ERROR_CLASSES: ReadonlySet<string>;
|
|
39
|
+
export type Sampler = () => number;
|
|
40
|
+
export declare function shouldPromptOnError(errorClass: string, opts?: {
|
|
41
|
+
sampleRate?: number;
|
|
42
|
+
sampler?: Sampler;
|
|
43
|
+
}): boolean;
|
|
44
|
+
export declare const ERROR_REASON_CODES: readonly ["too_slow", "wrong", "crashed", "other"];
|
|
45
|
+
export type ErrorReasonCode = (typeof ERROR_REASON_CODES)[number];
|
|
46
|
+
export declare function recordErrorFeedback(root: string, input: {
|
|
47
|
+
reason_code: ErrorReasonCode;
|
|
48
|
+
error_class?: string;
|
|
49
|
+
note?: string;
|
|
50
|
+
domain?: string;
|
|
51
|
+
command?: string;
|
|
52
|
+
}, env?: NodeJS.ProcessEnv): FeedbackEvent | null;
|
|
53
|
+
export declare function renderErrorPrompt(): string;
|
|
54
|
+
export declare function reasonForKey(key: string): ErrorReasonCode | null;
|
|
55
|
+
export declare function feedbackIsOfflineDurable(): boolean;
|
|
56
|
+
export declare function readEvalConsent(root: string): boolean;
|
|
57
|
+
export declare function setEvalConsent(root: string, optedIn: boolean): void;
|
|
58
|
+
export type EvalTriple = {
|
|
59
|
+
idea: string;
|
|
60
|
+
record: string;
|
|
61
|
+
label: string;
|
|
62
|
+
};
|
|
63
|
+
export type EvalCaptureMeta = {
|
|
64
|
+
id: string;
|
|
65
|
+
captured_at: string;
|
|
66
|
+
expires_at: string;
|
|
67
|
+
label: string;
|
|
68
|
+
redactions: number;
|
|
69
|
+
};
|
|
70
|
+
export declare function captureForEval(root: string, triple: EvalTriple, opts?: {
|
|
71
|
+
ttlMs?: number;
|
|
72
|
+
now?: number;
|
|
73
|
+
}): string | null;
|
|
74
|
+
export declare function listEvalCaptures(root: string): EvalCaptureMeta[];
|
|
75
|
+
export declare function deleteEvalCapture(root: string, id: string): boolean;
|
|
76
|
+
export declare function forgetAllEvalCaptures(root: string): number;
|
|
77
|
+
export declare function pruneExpiredEvalCaptures(root: string, now?: number): number;
|
|
78
|
+
export declare function readEvalCapture(root: string, id: string, now?: number): EvalTriple | null;
|