agentera 3.0.0-dev.2 → 3.0.0-dev.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -6
- package/bundle/.agentera-npx-bundle.json +1 -1
- package/bundle/.codex-plugin/plugin.json +92 -0
- package/bundle/.cursor/agents/agentera.md +7 -0
- package/bundle/.cursor/hooks.json +32 -0
- package/bundle/.cursor-plugin/plugin.json +34 -0
- package/bundle/.github/hooks/postToolUse.json +9 -0
- package/bundle/.github/hooks/preToolUse.json +8 -0
- package/bundle/.github/hooks/sessionEnd.json +8 -0
- package/bundle/.github/hooks/sessionStart.json +8 -0
- package/bundle/.github/plugin/plugin.json +7 -0
- package/bundle/.opencode/agents/agentera.md +12 -0
- package/bundle/.opencode/commands/agentera.md +5 -0
- package/bundle/.opencode/package.json +31 -0
- package/bundle/.opencode/plugins/agentera.js +820 -0
- package/bundle/CHANGELOG.md +1108 -0
- package/bundle/DESIGN.md +233 -0
- package/bundle/LICENSE +201 -0
- package/bundle/README.md +141 -0
- package/bundle/UPGRADE.md +227 -0
- package/bundle/agents/openai.yaml +87 -0
- package/bundle/extract-corpus-parity.json +21 -0
- package/bundle/hooks/codex-hooks.json +31 -0
- package/bundle/hooks/codex-plugin-hooks.json +31 -0
- package/bundle/plugin.json +13 -0
- package/bundle/references/adapters/cursor.md +53 -42
- package/bundle/references/adapters/opencode.md +46 -47
- package/bundle/references/adapters/package-manifest-interface-model.yaml +32 -43
- package/bundle/references/adapters/package-registry.yaml +19 -53
- package/bundle/references/adapters/package-surface-characterization.md +61 -48
- package/bundle/references/adapters/runtime-adapter-characterization.md +44 -79
- package/bundle/references/adapters/runtime-adapter-registry.yaml +21 -182
- package/bundle/references/adapters/runtime-feature-parity.md +114 -174
- package/bundle/references/adapters/runtime-lifecycle-adapters.yaml +288 -0
- package/bundle/references/adapters/runtime-lifecycle-authority.yaml +90 -0
- package/bundle/references/adapters/runtime-lifecycle-operation-contract.yaml +84 -0
- package/bundle/references/adapters/runtime-retired-resources.yaml +33 -0
- package/bundle/references/analysis/benchmark.md +6 -6
- package/bundle/references/analysis/startup-measurement-contract.yaml +37 -26
- package/bundle/references/artifacts/artifact-registry-interface-model.yaml +6 -5
- package/bundle/references/cli/agent-ready-state-contract.yaml +26 -23
- package/bundle/references/cli/app-lifecycle-vocabulary.yaml +4 -4
- package/bundle/references/cli/audience-namespace-cli-migration.yaml +40 -26
- package/bundle/references/cli/bundle-skill-vocabulary.yaml +4 -32
- package/bundle/references/cli/capability-instruction-contract.yaml +98 -57
- package/bundle/references/cli/capability-instruction-structure.md +144 -0
- package/bundle/references/cli/capability-tool-classification.yaml +12 -12
- package/bundle/references/cli/coexistence-probe.yaml +13 -0
- package/bundle/references/cli/parity-expected-actual-template.md +30 -0
- package/bundle/references/cli/routing-execution-vocabulary.yaml +12 -12
- package/bundle/references/cli/routing-model.md +94 -0
- package/bundle/references/cli/single-name-protocol.yaml +42 -0
- package/bundle/references/cli/trigger-schema-enrichment.md +136 -0
- package/bundle/references/cli/update-channels.yaml +43 -7
- package/bundle/references/cli/upgrade-repair-wording.md +45 -0
- package/bundle/references/cli/v3-handoff-manifest.schema.yaml +98 -0
- package/bundle/references/cli/vocabulary-index.yaml +20 -15
- package/bundle/references/cli/vocabulary.md +342 -326
- package/bundle/references/meta/documentation-inventory.md +9 -3
- package/bundle/registry.json +14 -14
- package/bundle/skills/agentera/SKILL.md +136 -408
- package/bundle/skills/agentera/agents/audit.toml +6 -0
- package/bundle/skills/agentera/agents/build.toml +6 -0
- package/bundle/skills/agentera/agents/design.toml +6 -0
- package/bundle/skills/agentera/agents/discuss.toml +6 -0
- package/bundle/skills/agentera/agents/document.toml +6 -0
- package/bundle/skills/agentera/agents/optimize.toml +6 -0
- package/bundle/skills/agentera/agents/orchestrate.toml +6 -0
- package/bundle/skills/agentera/agents/plan.toml +6 -0
- package/bundle/skills/agentera/agents/profile.toml +6 -0
- package/bundle/skills/agentera/agents/research.toml +6 -0
- package/bundle/skills/agentera/agents/status.toml +6 -0
- package/bundle/skills/agentera/agents/vision.toml +6 -0
- package/bundle/skills/agentera/capabilities/{inspektera → audit}/schemas/artifacts.yaml +10 -10
- package/bundle/skills/agentera/capabilities/{inspektera → audit}/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/{inspektera → audit}/schemas/triggers.yaml +15 -6
- package/bundle/skills/agentera/capabilities/{inspektera → audit}/schemas/validation.yaml +13 -12
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/artifacts.yaml +12 -12
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/exit.yaml +3 -3
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/triggers.yaml +13 -3
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/validation.yaml +11 -11
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/artifacts.yaml +6 -6
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/exit.yaml +5 -5
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/triggers.yaml +15 -3
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/validation.yaml +7 -7
- package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/artifacts.yaml +12 -11
- package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/triggers.yaml +11 -3
- package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/validation.yaml +9 -8
- package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/artifacts.yaml +10 -10
- package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/triggers.yaml +14 -4
- package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/validation.yaml +8 -8
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/artifacts.yaml +9 -9
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/triggers.yaml +11 -3
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/validation.yaml +9 -9
- package/bundle/skills/agentera/capabilities/{orkestrera → orchestrate}/schemas/artifacts.yaml +12 -11
- package/bundle/skills/agentera/capabilities/{orkestrera → orchestrate}/schemas/exit.yaml +7 -6
- package/bundle/skills/agentera/capabilities/{orkestrera → orchestrate}/schemas/triggers.yaml +16 -3
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/validation.yaml +120 -0
- package/bundle/skills/agentera/capabilities/plan/schemas/artifacts.yaml +63 -0
- package/bundle/skills/agentera/capabilities/{planera → plan}/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/{planera → plan}/schemas/triggers.yaml +15 -3
- package/bundle/skills/agentera/capabilities/plan/schemas/validation.yaml +89 -0
- package/bundle/skills/agentera/capabilities/{profilera → profile}/schemas/artifacts.yaml +2 -2
- package/bundle/skills/agentera/capabilities/{profilera → profile}/schemas/exit.yaml +3 -3
- package/bundle/skills/agentera/capabilities/{profilera → profile}/schemas/triggers.yaml +7 -3
- package/bundle/skills/agentera/capabilities/{profilera → profile}/schemas/validation.yaml +2 -2
- package/bundle/skills/agentera/capabilities/research/schemas/artifacts.yaml +24 -0
- package/bundle/skills/agentera/capabilities/{inspirera → research}/schemas/triggers.yaml +9 -3
- package/bundle/skills/agentera/capabilities/{inspirera → research}/schemas/validation.yaml +2 -2
- package/bundle/skills/agentera/capabilities/{hej → status}/schemas/artifacts.yaml +14 -11
- package/bundle/skills/agentera/capabilities/{hej → status}/schemas/triggers.yaml +12 -8
- package/bundle/skills/agentera/capabilities/{hej → status}/schemas/validation.yaml +5 -5
- package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/artifacts.yaml +8 -8
- package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/exit.yaml +7 -6
- package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/triggers.yaml +19 -5
- package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/validation.yaml +18 -20
- package/bundle/skills/agentera/capability_schema_contract.yaml +201 -38
- package/bundle/skills/agentera/protocol.yaml +29 -29
- package/bundle/skills/agentera/references/contract.md +338 -322
- package/bundle/skills/agentera/schemas/artifacts/changelog.yaml +4 -4
- package/bundle/skills/agentera/schemas/artifacts/decisions.yaml +10 -10
- package/bundle/skills/agentera/schemas/artifacts/design.yaml +4 -4
- package/bundle/skills/agentera/schemas/artifacts/docs.yaml +8 -7
- package/bundle/skills/agentera/schemas/artifacts/experiments.yaml +5 -5
- package/bundle/skills/agentera/schemas/artifacts/health.yaml +5 -5
- package/bundle/skills/agentera/schemas/artifacts/objective.yaml +4 -4
- package/bundle/skills/agentera/schemas/artifacts/plan.yaml +263 -11
- package/bundle/skills/agentera/schemas/artifacts/progress.yaml +20 -41
- package/bundle/skills/agentera/schemas/artifacts/todo.yaml +43 -24
- package/bundle/skills/agentera/schemas/artifacts/vision.yaml +3 -3
- package/dist/analytics/extractCorpus/cli.js +163 -0
- package/dist/analytics/extractCorpus/cli.js.map +1 -0
- package/dist/analytics/extractCorpus/copilotSessions.js +276 -0
- package/dist/analytics/extractCorpus/copilotSessions.js.map +1 -0
- package/dist/analytics/extractCorpus/core.js +393 -0
- package/dist/analytics/extractCorpus/core.js.map +1 -0
- package/dist/analytics/extractCorpus/corpus.js +168 -0
- package/dist/analytics/extractCorpus/corpus.js.map +1 -0
- package/dist/analytics/extractCorpus/coverageAudit.js +261 -0
- package/dist/analytics/extractCorpus/coverageAudit.js.map +1 -0
- package/dist/analytics/extractCorpus/cursorSessions.js +426 -0
- package/dist/analytics/extractCorpus/cursorSessions.js.map +1 -0
- package/dist/analytics/extractCorpus/extractCorpusParity.js +105 -0
- package/dist/analytics/extractCorpus/extractCorpusParity.js.map +1 -0
- package/dist/analytics/extractCorpus/filesystemSources.js +119 -0
- package/dist/analytics/extractCorpus/filesystemSources.js.map +1 -0
- package/dist/analytics/extractCorpus/index.js +12 -0
- package/dist/analytics/extractCorpus/index.js.map +1 -0
- package/dist/analytics/extractCorpus/jsonlSessions.js +205 -0
- package/dist/analytics/extractCorpus/jsonlSessions.js.map +1 -0
- package/dist/analytics/extractCorpus/sqliteCaps.js +44 -0
- package/dist/analytics/extractCorpus/sqliteCaps.js.map +1 -0
- package/dist/analytics/extractCorpus/sqliteSessions.js +368 -0
- package/dist/analytics/extractCorpus/sqliteSessions.js.map +1 -0
- package/dist/analytics/extractCorpus.js +2 -1790
- package/dist/analytics/extractCorpus.js.map +1 -1
- package/dist/analytics/usageStats.js +93 -27
- package/dist/analytics/usageStats.js.map +1 -1
- package/dist/bin/agentera.js +3 -1
- package/dist/bin/agentera.js.map +1 -1
- package/dist/capabilities/audit/instructions.js +4 -0
- package/dist/capabilities/audit/instructions.js.map +1 -0
- package/dist/capabilities/build/instructions.js +5 -0
- package/dist/capabilities/build/instructions.js.map +1 -0
- package/dist/capabilities/design/instructions.js +5 -0
- package/dist/capabilities/design/instructions.js.map +1 -0
- package/dist/capabilities/discuss/instructions.js +6 -0
- package/dist/capabilities/discuss/instructions.js.map +1 -0
- package/dist/capabilities/document/instructions.js +4 -0
- package/dist/capabilities/document/instructions.js.map +1 -0
- package/dist/capabilities/index.js +38 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/optimize/instructions.js +5 -0
- package/dist/capabilities/optimize/instructions.js.map +1 -0
- package/dist/capabilities/orchestrate/instructions.js +10 -0
- package/dist/capabilities/orchestrate/instructions.js.map +1 -0
- package/dist/capabilities/plan/instructions.js +6 -0
- package/dist/capabilities/plan/instructions.js.map +1 -0
- package/dist/capabilities/profile/instructions.js +5 -0
- package/dist/capabilities/profile/instructions.js.map +1 -0
- package/dist/capabilities/research/instructions.js +6 -0
- package/dist/capabilities/research/instructions.js.map +1 -0
- package/dist/capabilities/status/instructions.js +5 -0
- package/dist/capabilities/status/instructions.js.map +1 -0
- package/dist/capabilities/vision/instructions.js +5 -0
- package/dist/capabilities/vision/instructions.js.map +1 -0
- package/dist/cli/appContext.js +16 -17
- package/dist/cli/appContext.js.map +1 -1
- package/dist/cli/capabilityContext/benchmark.js +564 -0
- package/dist/cli/capabilityContext/benchmark.js.map +1 -0
- package/dist/cli/capabilityContext/bespoke.js +36 -0
- package/dist/cli/capabilityContext/bespoke.js.map +1 -0
- package/dist/cli/capabilityContext/build.js +190 -0
- package/dist/cli/capabilityContext/build.js.map +1 -0
- package/dist/cli/capabilityContext/closeout.js +230 -0
- package/dist/cli/capabilityContext/closeout.js.map +1 -0
- package/dist/cli/capabilityContext/contract.js +190 -0
- package/dist/cli/capabilityContext/contract.js.map +1 -0
- package/dist/cli/capabilityContext/evidence.js +456 -0
- package/dist/cli/capabilityContext/evidence.js.map +1 -0
- package/dist/cli/capabilityContext/index.js +4 -0
- package/dist/cli/capabilityContext/index.js.map +1 -0
- package/dist/cli/capabilityContext/orchestration.js +117 -0
- package/dist/cli/capabilityContext/orchestration.js.map +1 -0
- package/dist/cli/capabilityContext/planState.js +279 -0
- package/dist/cli/capabilityContext/planState.js.map +1 -0
- package/dist/cli/capabilityContext/progress.js +138 -0
- package/dist/cli/capabilityContext/progress.js.map +1 -0
- package/dist/cli/capabilityContext/shared.js +94 -0
- package/dist/cli/capabilityContext/shared.js.map +1 -0
- package/dist/cli/capabilityContext/slim.js +108 -0
- package/dist/cli/capabilityContext/slim.js.map +1 -0
- package/dist/cli/capabilityContext/startup.js +217 -0
- package/dist/cli/capabilityContext/startup.js.map +1 -0
- package/dist/cli/capabilityContext/types.js +41 -0
- package/dist/cli/capabilityContext/types.js.map +1 -0
- package/dist/cli/capabilityContext.js +1 -2420
- package/dist/cli/capabilityContext.js.map +1 -1
- package/dist/cli/commands/appHome.js +23 -0
- package/dist/cli/commands/appHome.js.map +1 -0
- package/dist/cli/commands/capability.js +3 -10
- package/dist/cli/commands/capability.js.map +1 -1
- package/dist/cli/commands/compact.js +1 -1
- package/dist/cli/commands/compact.js.map +1 -1
- package/dist/cli/commands/doctor.js +116 -96
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/lint.js +16 -41
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/prime/bundleStatus.js +185 -0
- package/dist/cli/commands/prime/bundleStatus.js.map +1 -0
- package/dist/cli/commands/prime/collectOrientationState.js +179 -0
- package/dist/cli/commands/prime/collectOrientationState.js.map +1 -0
- package/dist/cli/commands/prime/orientationOutput.js +233 -0
- package/dist/cli/commands/prime/orientationOutput.js.map +1 -0
- package/dist/cli/commands/prime/types.js +2 -0
- package/dist/cli/commands/prime/types.js.map +1 -0
- package/dist/cli/commands/prime/v1Migration.js +39 -0
- package/dist/cli/commands/prime/v1Migration.js.map +1 -0
- package/dist/cli/commands/prime.js +11 -519
- package/dist/cli/commands/prime.js.map +1 -1
- package/dist/cli/commands/query.js +5 -2
- package/dist/cli/commands/query.js.map +1 -1
- package/dist/cli/commands/report.js +50 -14
- package/dist/cli/commands/report.js.map +1 -1
- package/dist/cli/commands/schema.js +113 -24
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/state/decisions.js +403 -0
- package/dist/cli/commands/state/decisions.js.map +1 -0
- package/dist/cli/commands/state/docs.js +97 -0
- package/dist/cli/commands/state/docs.js.map +1 -0
- package/dist/cli/commands/state/experiments.js +68 -0
- package/dist/cli/commands/state/experiments.js.map +1 -0
- package/dist/cli/commands/state/health.js +116 -0
- package/dist/cli/commands/state/health.js.map +1 -0
- package/dist/cli/commands/state/index.js +51 -0
- package/dist/cli/commands/state/index.js.map +1 -0
- package/dist/cli/commands/state/objective.js +69 -0
- package/dist/cli/commands/state/objective.js.map +1 -0
- package/dist/cli/commands/state/plan.js +274 -0
- package/dist/cli/commands/state/plan.js.map +1 -0
- package/dist/cli/commands/state/progress.js +47 -0
- package/dist/cli/commands/state/progress.js.map +1 -0
- package/dist/cli/commands/state/shared.js +15 -0
- package/dist/cli/commands/state/shared.js.map +1 -0
- package/dist/cli/commands/state/todo.js +121 -0
- package/dist/cli/commands/state/todo.js.map +1 -0
- package/dist/cli/commands/state/write.js +341 -0
- package/dist/cli/commands/state/write.js.map +1 -0
- package/dist/cli/commands/upgrade.js +79 -1
- package/dist/cli/commands/upgrade.js.map +1 -1
- package/dist/cli/commands/upgradeVerify.js +81 -0
- package/dist/cli/commands/upgradeVerify.js.map +1 -0
- package/dist/cli/commands/validate.js +56 -96
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/commands/verify.js +13 -7
- package/dist/cli/commands/verify.js.map +1 -1
- package/dist/cli/contracts/bundleStatus.js +2 -0
- package/dist/cli/contracts/bundleStatus.js.map +1 -0
- package/dist/cli/contracts/orientationState.js +2 -0
- package/dist/cli/contracts/orientationState.js.map +1 -0
- package/dist/cli/dispatch/argvParser.js +33 -0
- package/dist/cli/dispatch/argvParser.js.map +1 -0
- package/dist/cli/dispatch/check.js +328 -0
- package/dist/cli/dispatch/check.js.map +1 -0
- package/dist/cli/dispatch/commands.js +27 -0
- package/dist/cli/dispatch/commands.js.map +1 -0
- package/dist/cli/dispatch/index.js +183 -0
- package/dist/cli/dispatch/index.js.map +1 -0
- package/dist/cli/dispatch/lifecycle.js +671 -0
- package/dist/cli/dispatch/lifecycle.js.map +1 -0
- package/dist/cli/dispatch/prime.js +104 -0
- package/dist/cli/dispatch/prime.js.map +1 -0
- package/dist/cli/dispatch/shared.js +64 -0
- package/dist/cli/dispatch/shared.js.map +1 -0
- package/dist/cli/dispatch/state.js +148 -0
- package/dist/cli/dispatch/state.js.map +1 -0
- package/dist/cli/dispatch.js +1 -957
- package/dist/cli/dispatch.js.map +1 -1
- package/dist/cli/errors.js +54 -0
- package/dist/cli/errors.js.map +1 -0
- package/dist/cli/help.js +262 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/orientation/attention.js +163 -0
- package/dist/cli/orientation/attention.js.map +1 -0
- package/dist/cli/orientation/corpusCoverage.js +71 -0
- package/dist/cli/orientation/corpusCoverage.js.map +1 -0
- package/dist/cli/orientation.js +194 -114
- package/dist/cli/orientation.js.map +1 -1
- package/dist/cli/planArtifacts.js +172 -0
- package/dist/cli/planArtifacts.js.map +1 -0
- package/dist/cli/planEvidence.js +158 -0
- package/dist/cli/planEvidence.js.map +1 -0
- package/dist/cli/planLifecycleState.js +34 -0
- package/dist/cli/planLifecycleState.js.map +1 -0
- package/dist/cli/prime-blob.js +68 -2
- package/dist/cli/prime-blob.js.map +1 -1
- package/dist/cli/startupCompletenessContract.js +56 -0
- package/dist/cli/startupCompletenessContract.js.map +1 -0
- package/dist/cli/stateQuery.js +17 -2
- package/dist/cli/stateQuery.js.map +1 -1
- package/dist/cli/todoMarkdown.js +33 -0
- package/dist/cli/todoMarkdown.js.map +1 -0
- package/dist/cli/todoSeverity.js +19 -0
- package/dist/cli/todoSeverity.js.map +1 -0
- package/dist/core/atomicWriter.js +21 -0
- package/dist/core/atomicWriter.js.map +1 -0
- package/dist/core/envPaths.js +21 -0
- package/dist/core/envPaths.js.map +1 -0
- package/dist/core/jsonValue.js +6 -0
- package/dist/core/jsonValue.js.map +1 -0
- package/dist/core/pyjson.js +67 -2
- package/dist/core/pyjson.js.map +1 -1
- package/dist/core/yaml.js +8 -0
- package/dist/core/yaml.js.map +1 -1
- package/dist/eval/evalSkills.js +30 -25
- package/dist/eval/evalSkills.js.map +1 -1
- package/dist/eval/semanticEval.js +43 -19
- package/dist/eval/semanticEval.js.map +1 -1
- package/dist/eval/semanticFixtures.js +16 -4
- package/dist/eval/semanticFixtures.js.map +1 -1
- package/dist/hooks/common.js +9 -26
- package/dist/hooks/common.js.map +1 -1
- package/dist/hooks/compaction/apply.js +269 -0
- package/dist/hooks/compaction/apply.js.map +1 -0
- package/dist/hooks/compaction/dryRun.js +183 -0
- package/dist/hooks/compaction/dryRun.js.map +1 -0
- package/dist/hooks/compaction/index.js +23 -0
- package/dist/hooks/compaction/index.js.map +1 -0
- package/dist/hooks/compaction/parse.js +258 -0
- package/dist/hooks/compaction/parse.js.map +1 -0
- package/dist/hooks/compaction/retention.js +202 -0
- package/dist/hooks/compaction/retention.js.map +1 -0
- package/dist/hooks/compaction/status.js +243 -0
- package/dist/hooks/compaction/status.js.map +1 -0
- package/dist/hooks/compaction/types.js +6 -0
- package/dist/hooks/compaction/types.js.map +1 -0
- package/dist/hooks/cursorPreToolUse.js +1 -1
- package/dist/hooks/cursorPreToolUse.js.map +1 -1
- package/dist/hooks/cursorSessionStart.js +10 -2
- package/dist/hooks/cursorSessionStart.js.map +1 -1
- package/dist/hooks/sessionStart.js +18 -11
- package/dist/hooks/sessionStart.js.map +1 -1
- package/dist/hooks/sessionStop.js +8 -14
- package/dist/hooks/sessionStop.js.map +1 -1
- package/dist/hooks/validateArtifact/agentFacing.js +10 -0
- package/dist/hooks/validateArtifact/agentFacing.js.map +1 -0
- package/dist/hooks/validateArtifact/index.js +151 -0
- package/dist/hooks/validateArtifact/index.js.map +1 -0
- package/dist/hooks/validateArtifact/markdown.js +146 -0
- package/dist/hooks/validateArtifact/markdown.js.map +1 -0
- package/dist/hooks/validateArtifact/runtime.js +86 -0
- package/dist/hooks/validateArtifact/runtime.js.map +1 -0
- package/dist/hooks/validateArtifact/schema.js +541 -0
- package/dist/hooks/validateArtifact/schema.js.map +1 -0
- package/dist/hooks/validateArtifact/traversal.js +106 -0
- package/dist/hooks/validateArtifact/traversal.js.map +1 -0
- package/dist/hooks/validateArtifact/violations.js +108 -0
- package/dist/hooks/validateArtifact/violations.js.map +1 -0
- package/dist/migrate/v2HandoffManifest.js +455 -0
- package/dist/migrate/v2HandoffManifest.js.map +1 -0
- package/dist/registries/artifactProtocolIds.js +77 -0
- package/dist/registries/artifactProtocolIds.js.map +1 -0
- package/dist/registries/artifactRegistry.js +62 -15
- package/dist/registries/artifactRegistry.js.map +1 -1
- package/dist/registries/capabilityContract.js +156 -12
- package/dist/registries/capabilityContract.js.map +1 -1
- package/dist/registries/evaluatorHandoffContract.js +171 -0
- package/dist/registries/evaluatorHandoffContract.js.map +1 -0
- package/dist/registries/packageRegistry.js +40 -6
- package/dist/registries/packageRegistry.js.map +1 -1
- package/dist/registries/runtimeAdapterRegistry.js +30 -21
- package/dist/registries/runtimeAdapterRegistry.js.map +1 -1
- package/dist/registries/triggerLoader.js +211 -0
- package/dist/registries/triggerLoader.js.map +1 -0
- package/dist/release/releaseMetadata.js +235 -0
- package/dist/release/releaseMetadata.js.map +1 -0
- package/dist/runtime/lifecycleAdapterContract.js +458 -0
- package/dist/runtime/lifecycleAdapterContract.js.map +1 -0
- package/dist/runtime/lifecycleAdapters.js +766 -0
- package/dist/runtime/lifecycleAdapters.js.map +1 -0
- package/dist/runtime/lifecycleAuthority.js +493 -0
- package/dist/runtime/lifecycleAuthority.js.map +1 -0
- package/dist/runtime/lifecycleOperationContract.js +113 -0
- package/dist/runtime/lifecycleOperationContract.js.map +1 -0
- package/dist/runtime/lifecycleOperations.js +635 -0
- package/dist/runtime/lifecycleOperations.js.map +1 -0
- package/dist/runtime/lifecycleOwnershipJournal.js +623 -0
- package/dist/runtime/lifecycleOwnershipJournal.js.map +1 -0
- package/dist/runtime/lifecyclePublication.js +395 -0
- package/dist/runtime/lifecyclePublication.js.map +1 -0
- package/dist/runtime/lifecycleSnapshot.js +439 -0
- package/dist/runtime/lifecycleSnapshot.js.map +1 -0
- package/dist/runtime/retiredRuntimeCleanup.js +238 -0
- package/dist/runtime/retiredRuntimeCleanup.js.map +1 -0
- package/dist/setup/codex/agents.js +96 -0
- package/dist/setup/codex/agents.js.map +1 -0
- package/dist/setup/codex/cli.js +161 -0
- package/dist/setup/codex/cli.js.map +1 -0
- package/dist/setup/codex/configToml.js +639 -0
- package/dist/setup/codex/configToml.js.map +1 -0
- package/dist/setup/codex/constants.js +29 -0
- package/dist/setup/codex/constants.js.map +1 -0
- package/dist/setup/codex/installRoot.js +64 -0
- package/dist/setup/codex/installRoot.js.map +1 -0
- package/dist/setup/codex/state.js +270 -0
- package/dist/setup/codex/state.js.map +1 -0
- package/dist/setup/codex.js +11 -1055
- package/dist/setup/codex.js.map +1 -1
- package/dist/setup/copilot.js +1 -1
- package/dist/setup/copilot.js.map +1 -1
- package/dist/setup/cursor.js +7 -5
- package/dist/setup/cursor.js.map +1 -1
- package/dist/setup/cursorSurfaces.js +67 -0
- package/dist/setup/cursorSurfaces.js.map +1 -0
- package/dist/setup/doctor/core.js +296 -0
- package/dist/setup/doctor/core.js.map +1 -0
- package/dist/setup/doctor/diagnostics.js +201 -0
- package/dist/setup/doctor/diagnostics.js.map +1 -0
- package/dist/setup/doctor/opencode.js +301 -0
- package/dist/setup/doctor/opencode.js.map +1 -0
- package/dist/setup/doctor/report.js +425 -0
- package/dist/setup/doctor/report.js.map +1 -0
- package/dist/setup/doctor.js +9 -1275
- package/dist/setup/doctor.js.map +1 -1
- package/dist/setup/opencode.js +13 -0
- package/dist/setup/opencode.js.map +1 -0
- package/dist/setup/opencodeConstants.js +2 -0
- package/dist/setup/opencodeConstants.js.map +1 -0
- package/dist/setup/smokeChecks.js +109 -0
- package/dist/setup/smokeChecks.js.map +1 -0
- package/dist/state/installRoot.js +64 -24
- package/dist/state/installRoot.js.map +1 -1
- package/dist/state/startupAnalysis/benchmark.js +371 -0
- package/dist/state/startupAnalysis/benchmark.js.map +1 -0
- package/dist/state/startupAnalysis/contract.js +126 -0
- package/dist/state/startupAnalysis/contract.js.map +1 -0
- package/dist/state/startupAnalysis/helpers.js +287 -0
- package/dist/state/startupAnalysis/helpers.js.map +1 -0
- package/dist/state/startupAnalysis/index.js +7 -0
- package/dist/state/startupAnalysis/index.js.map +1 -0
- package/dist/state/startupAnalysis/metrics.js +341 -0
- package/dist/state/startupAnalysis/metrics.js.map +1 -0
- package/dist/state/startupAnalysis/records.js +199 -0
- package/dist/state/startupAnalysis/records.js.map +1 -0
- package/dist/state/startupAnalysis/report.js +112 -0
- package/dist/state/startupAnalysis/report.js.map +1 -0
- package/dist/state/startupAnalysis/threshold.js +500 -0
- package/dist/state/startupAnalysis/threshold.js.map +1 -0
- package/dist/state/startupAnalysis.js +2 -1952
- package/dist/state/startupAnalysis.js.map +1 -1
- package/dist/state/write/assign.js +21 -0
- package/dist/state/write/assign.js.map +1 -0
- package/dist/state/write/errors.js +12 -0
- package/dist/state/write/errors.js.map +1 -0
- package/dist/state/write/explain.js +155 -0
- package/dist/state/write/explain.js.map +1 -0
- package/dist/state/write/fields.js +62 -0
- package/dist/state/write/fields.js.map +1 -0
- package/dist/state/write/index.js +11 -0
- package/dist/state/write/index.js.map +1 -0
- package/dist/state/write/input.js +22 -0
- package/dist/state/write/input.js.map +1 -0
- package/dist/state/write/lock.js +108 -0
- package/dist/state/write/lock.js.map +1 -0
- package/dist/state/write/operations.js +220 -0
- package/dist/state/write/operations.js.map +1 -0
- package/dist/state/write/serialize.js +2 -0
- package/dist/state/write/serialize.js.map +1 -0
- package/dist/state/write/transaction.js +787 -0
- package/dist/state/write/transaction.js.map +1 -0
- package/dist/state/write/validate.js +8 -0
- package/dist/state/write/validate.js.map +1 -0
- package/dist/upgrade/appContentRefresh.js +374 -0
- package/dist/upgrade/appContentRefresh.js.map +1 -0
- package/dist/upgrade/appModel.js +11 -6
- package/dist/upgrade/appModel.js.map +1 -1
- package/dist/upgrade/atomicWriter.js +2 -0
- package/dist/upgrade/atomicWriter.js.map +1 -0
- package/dist/upgrade/bundleEvidence.js +34 -0
- package/dist/upgrade/bundleEvidence.js.map +1 -0
- package/dist/upgrade/channels.js +27 -7
- package/dist/upgrade/channels.js.map +1 -1
- package/dist/upgrade/coexistenceProbe.js +105 -0
- package/dist/upgrade/coexistenceProbe.js.map +1 -0
- package/dist/upgrade/compatibility.js +52 -16
- package/dist/upgrade/compatibility.js.map +1 -1
- package/dist/upgrade/doctor.js +195 -193
- package/dist/upgrade/doctor.js.map +1 -1
- package/dist/upgrade/doctorClassifier.js +188 -0
- package/dist/upgrade/doctorClassifier.js.map +1 -0
- package/dist/upgrade/installedHooksRetirement.js +190 -0
- package/dist/upgrade/installedHooksRetirement.js.map +1 -0
- package/dist/upgrade/legacyAgentCleanup.js +183 -0
- package/dist/upgrade/legacyAgentCleanup.js.map +1 -0
- package/dist/upgrade/lifecycleUpgrade.js +427 -0
- package/dist/upgrade/lifecycleUpgrade.js.map +1 -0
- package/dist/upgrade/migrateArtifactsV1ToV2.js +568 -0
- package/dist/upgrade/migrateArtifactsV1ToV2.js.map +1 -0
- package/dist/upgrade/migrateArtifactsV2ToV3.js +273 -144
- package/dist/upgrade/migrateArtifactsV2ToV3.js.map +1 -1
- package/dist/upgrade/nextMajorDoctor.js +156 -0
- package/dist/upgrade/nextMajorDoctor.js.map +1 -0
- package/dist/upgrade/npxPlatformStatus.js +23 -0
- package/dist/upgrade/npxPlatformStatus.js.map +1 -0
- package/dist/upgrade/projectIntegration.js +259 -104
- package/dist/upgrade/projectIntegration.js.map +1 -1
- package/dist/upgrade/projectIntegrationDecision.js +141 -0
- package/dist/upgrade/projectIntegrationDecision.js.map +1 -0
- package/dist/upgrade/runtimeMigration.js +342 -89
- package/dist/upgrade/runtimeMigration.js.map +1 -1
- package/dist/upgrade/upgradeCommands.js +8 -0
- package/dist/upgrade/upgradeCommands.js.map +1 -1
- package/dist/upgrade/upgradeLock.js +54 -0
- package/dist/upgrade/upgradeLock.js.map +1 -0
- package/dist/upgrade/upgradeOrchestrator.js +170 -46
- package/dist/upgrade/upgradeOrchestrator.js.map +1 -1
- package/dist/upgrade/upgradeSnapshot.js +93 -0
- package/dist/upgrade/upgradeSnapshot.js.map +1 -0
- package/dist/upgrade/v3CapabilitySurface.js +15 -0
- package/dist/upgrade/v3CapabilitySurface.js.map +1 -0
- package/dist/upgrade/versionResolution.js +12 -4
- package/dist/upgrade/versionResolution.js.map +1 -1
- package/dist/validate/appHomeContract.js +5 -5
- package/dist/validate/appHomeContract.js.map +1 -1
- package/dist/validate/capability.js +135 -14
- package/dist/validate/capability.js.map +1 -1
- package/dist/validate/crossCapability.js +1 -1
- package/dist/validate/crossCapability.js.map +1 -1
- package/dist/validate/lifecycleAdapters/legacyPythonParity.js +93 -0
- package/dist/validate/lifecycleAdapters/legacyPythonParity.js.map +1 -0
- package/dist/validate/lifecycleAdapters/nodeFormChecks.js +481 -0
- package/dist/validate/lifecycleAdapters/nodeFormChecks.js.map +1 -0
- package/dist/validate/lifecycleAdapters/shared.js +198 -0
- package/dist/validate/lifecycleAdapters/shared.js.map +1 -0
- package/dist/validate/lifecycleAdapters.js +91 -702
- package/dist/validate/lifecycleAdapters.js.map +1 -1
- package/dist/validate/selfAudit.js +63 -21
- package/dist/validate/selfAudit.js.map +1 -1
- package/dist/validate/vocabularyAuthority.js +303 -0
- package/dist/validate/vocabularyAuthority.js.map +1 -0
- package/package.json +30 -27
- package/bundle/references/v1-section-mapping.md +0 -47
- package/bundle/skills/agentera/.claude-plugin/plugin.json +0 -27
- package/bundle/skills/agentera/agents/dokumentera.toml +0 -6
- package/bundle/skills/agentera/agents/hej.toml +0 -6
- package/bundle/skills/agentera/agents/inspektera.toml +0 -6
- package/bundle/skills/agentera/agents/inspirera.toml +0 -6
- package/bundle/skills/agentera/agents/optimera.toml +0 -6
- package/bundle/skills/agentera/agents/orkestrera.toml +0 -6
- package/bundle/skills/agentera/agents/planera.toml +0 -6
- package/bundle/skills/agentera/agents/profilera.toml +0 -6
- package/bundle/skills/agentera/agents/realisera.toml +0 -6
- package/bundle/skills/agentera/agents/resonera.toml +0 -6
- package/bundle/skills/agentera/agents/visionera.toml +0 -6
- package/bundle/skills/agentera/agents/visualisera.toml +0 -6
- package/bundle/skills/agentera/capabilities/dokumentera/instructions.md +0 -428
- package/bundle/skills/agentera/capabilities/hej/instructions.md +0 -331
- package/bundle/skills/agentera/capabilities/inspektera/instructions.md +0 -514
- package/bundle/skills/agentera/capabilities/inspirera/instructions.md +0 -280
- package/bundle/skills/agentera/capabilities/inspirera/schemas/artifacts.yaml +0 -24
- package/bundle/skills/agentera/capabilities/optimera/instructions.md +0 -437
- package/bundle/skills/agentera/capabilities/orkestrera/instructions.md +0 -433
- package/bundle/skills/agentera/capabilities/orkestrera/schemas/validation.yaml +0 -107
- package/bundle/skills/agentera/capabilities/planera/instructions.md +0 -368
- package/bundle/skills/agentera/capabilities/planera/schemas/artifacts.yaml +0 -62
- package/bundle/skills/agentera/capabilities/planera/schemas/validation.yaml +0 -61
- package/bundle/skills/agentera/capabilities/profilera/instructions.md +0 -419
- package/bundle/skills/agentera/capabilities/realisera/instructions.md +0 -403
- package/bundle/skills/agentera/capabilities/resonera/instructions.md +0 -329
- package/bundle/skills/agentera/capabilities/visionera/instructions.md +0 -309
- package/bundle/skills/agentera/capabilities/visualisera/instructions.md +0 -400
- package/bundle/skills/hej/.claude-plugin/plugin.json +0 -6
- package/bundle/skills/hej/SKILL.md +0 -69
- package/bundle/skills/hej/agents/hej.toml +0 -11
- package/bundle/skills/hej/agents/openai.yaml +0 -8
- package/dist/cli/commands/backfill.js +0 -84
- package/dist/cli/commands/backfill.js.map +0 -1
- package/dist/cli/commands/state.js +0 -1012
- package/dist/cli/commands/state.js.map +0 -1
- package/dist/core/git.js +0 -43
- package/dist/core/git.js.map +0 -1
- package/dist/hooks/compaction.js +0 -935
- package/dist/hooks/compaction.js.map +0 -1
- package/dist/hooks/validateArtifact.js +0 -933
- package/dist/hooks/validateArtifact.js.map +0 -1
- package/dist/state/progressCommit.js +0 -289
- package/dist/state/progressCommit.js.map +0 -1
- /package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{inspirera → research}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{hej → status}/schemas/exit.yaml +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { corpusTooLargeReason } from "../../analytics/usageStats.js";
|
|
3
|
+
import { statsCorpusPath } from "../commands/report.js";
|
|
4
|
+
function emptyCoverageSummary(path, status) {
|
|
5
|
+
return {
|
|
6
|
+
path,
|
|
7
|
+
status,
|
|
8
|
+
available_runtimes: [],
|
|
9
|
+
selected_runtimes: [],
|
|
10
|
+
available_but_not_selected: [],
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function parseCoverageGap(value) {
|
|
14
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
15
|
+
return null;
|
|
16
|
+
const item = value;
|
|
17
|
+
const runtime = item.runtime;
|
|
18
|
+
const reason = item.reason;
|
|
19
|
+
if (typeof runtime !== "string" || typeof reason !== "string")
|
|
20
|
+
return null;
|
|
21
|
+
const gap = { runtime, reason };
|
|
22
|
+
if (typeof item.store_path === "string")
|
|
23
|
+
gap.store_path = item.store_path;
|
|
24
|
+
return gap;
|
|
25
|
+
}
|
|
26
|
+
export function corpusCoverageSummary(env = process.env, platform = process.platform) {
|
|
27
|
+
const corpusPath = statsCorpusPath(env, platform);
|
|
28
|
+
if (!fs.existsSync(corpusPath))
|
|
29
|
+
return emptyCoverageSummary(corpusPath, "missing");
|
|
30
|
+
const tooLarge = corpusTooLargeReason(corpusPath);
|
|
31
|
+
if (tooLarge)
|
|
32
|
+
return emptyCoverageSummary(corpusPath, "too_large");
|
|
33
|
+
let data;
|
|
34
|
+
try {
|
|
35
|
+
data = JSON.parse(fs.readFileSync(corpusPath, "utf8"));
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return emptyCoverageSummary(corpusPath, "unreadable");
|
|
39
|
+
}
|
|
40
|
+
const metadata = data && typeof data === "object" && !Array.isArray(data) && "metadata" in data
|
|
41
|
+
? data.metadata
|
|
42
|
+
: null;
|
|
43
|
+
if (!metadata || typeof metadata !== "object" || Array.isArray(metadata)) {
|
|
44
|
+
return emptyCoverageSummary(corpusPath, "unreadable");
|
|
45
|
+
}
|
|
46
|
+
const md = metadata;
|
|
47
|
+
const availableRuntimes = Array.isArray(md.available_runtimes)
|
|
48
|
+
? md.available_runtimes.filter((item) => typeof item === "string")
|
|
49
|
+
: [];
|
|
50
|
+
const selectedRuntimes = Array.isArray(md.selected_runtimes)
|
|
51
|
+
? md.selected_runtimes.filter((item) => typeof item === "string")
|
|
52
|
+
: [];
|
|
53
|
+
const skipped = Array.isArray(md.available_but_not_selected)
|
|
54
|
+
? md.available_but_not_selected.map(parseCoverageGap).filter((item) => item !== null)
|
|
55
|
+
: [];
|
|
56
|
+
return {
|
|
57
|
+
path: corpusPath,
|
|
58
|
+
status: "loaded",
|
|
59
|
+
available_runtimes: availableRuntimes,
|
|
60
|
+
selected_runtimes: selectedRuntimes,
|
|
61
|
+
available_but_not_selected: skipped,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export function corpusCoverageAttention(summary) {
|
|
65
|
+
if (summary.available_but_not_selected.length === 0)
|
|
66
|
+
return null;
|
|
67
|
+
const skipped = summary.available_but_not_selected.map((item) => `${item.runtime} (${item.reason})`).join(", ");
|
|
68
|
+
return (`flagged: corpus coverage loss (EX2): available runtimes skipped (${skipped}); ` +
|
|
69
|
+
"suggest running profile stats refresh without --no-* flags");
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=corpusCoverage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corpusCoverage.js","sourceRoot":"","sources":["../../../src/cli/orientation/corpusCoverage.ts"],"names":[],"mappings":"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"}
|
package/dist/cli/orientation.js
CHANGED
|
@@ -2,39 +2,33 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { resolveArtifactPath, } from "../registries/artifactRegistry.js";
|
|
4
4
|
import { activeObjectiveName, artifactPath, loadRegistryForSchemas, } from "./appContext.js";
|
|
5
|
-
import { asList, extractEntries, firstPresent, loadArtifact, recentCycles, truncate, } from "./stateQuery.js";
|
|
6
|
-
import { decisionContextEntry, latestHealthAudit, normalizeSeverity } from "./commands/state.js";
|
|
5
|
+
import { asList, extractEntries, firstPresent, loadArtifact, progressEntriesForOutput, recentCycles, truncate, } from "./stateQuery.js";
|
|
6
|
+
import { decisionContextEntry, latestHealthAudit, normalizeSeverity } from "./commands/state/index.js";
|
|
7
|
+
import { isResolvedTodoMarkdownStatus, parseTodoMarkdownListItem } from "./todoMarkdown.js";
|
|
8
|
+
import { TODO_SEVERITY_ORDER, TODO_SEVERITY_ORDER_KEYS } from "./todoSeverity.js";
|
|
9
|
+
import { capabilityStartupComplete } from "./startupCompletenessContract.js";
|
|
10
|
+
import { discoverPlanArtifacts, planCatalogEntry, planDocumentParts } from "./planArtifacts.js";
|
|
11
|
+
import { planLifecycleState } from "./planLifecycleState.js";
|
|
12
|
+
import { dependencyReadyTasks } from "./capabilityContext/planState.js";
|
|
13
|
+
/**
|
|
14
|
+
* Orientation summaries layer for prime/status. Faithful port of the
|
|
15
|
+
* scripts/agentera `_*_summary`, `_load_todo_items`, `_issue_counts`,
|
|
16
|
+
* `_decision_*`, `_select_status_next_action`, and staleness helpers.
|
|
17
|
+
*/
|
|
7
18
|
export const DONE_STATUSES = new Set(["complete", "completed", "closed", "done", "resolved", "retired"]);
|
|
8
19
|
export const BLOCKED_STATUSES = new Set(["blocked", "stuck"]);
|
|
9
20
|
export const DECISION_ATTENTION_MAX_ENTRIES = 3;
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
critical: 0,
|
|
13
|
-
degraded: 1,
|
|
14
|
-
warning: 1,
|
|
15
|
-
normal: 2,
|
|
16
|
-
info: 3,
|
|
17
|
-
annoying: 3,
|
|
18
|
-
};
|
|
19
|
-
const TODO_SECTION_SEVERITIES = {
|
|
20
|
-
critical: "critical",
|
|
21
|
-
degraded: "degraded",
|
|
22
|
-
warning: "warning",
|
|
23
|
-
normal: "normal",
|
|
24
|
-
info: "info",
|
|
25
|
-
annoying: "annoying",
|
|
26
|
-
};
|
|
27
|
-
const TODO_ITEM_RE = /^- \[([^\]]+)\]\s+(.*)/;
|
|
28
|
-
const TODO_PLANERA_SIGNALS = new Set([
|
|
21
|
+
const TODO_SECTION_SEVERITIES = Object.fromEntries(TODO_SEVERITY_ORDER_KEYS.map((key) => [key, key]));
|
|
22
|
+
const TODO_PLAN_SIGNALS = new Set([
|
|
29
23
|
"acceptance", "artifact", "capability", "capability-context", "compatibility", "contract",
|
|
30
24
|
"cross-capability", "docs", "metadata", "migration", "schema", "startup", "surface", "test", "validation",
|
|
31
25
|
]);
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
26
|
+
const PROFILE_STALE_DAYS_ENV = "AGENTERA_PROFILE_MAX_AGE_DAYS";
|
|
27
|
+
const DEFAULT_PROFILE_STALE_DAYS = 7;
|
|
28
|
+
const AUDIT_STALE_DAYS_ENV = "AGENTERA_AUDIT_MAX_AGE_DAYS";
|
|
29
|
+
const DEFAULT_AUDIT_STALE_DAYS = 30;
|
|
30
|
+
const AUDIT_STALE_CYCLES_ENV = "AGENTERA_AUDIT_MAX_CYCLES";
|
|
31
|
+
const DEFAULT_AUDIT_STALE_CYCLES = 10;
|
|
38
32
|
function intEnv(env, key, def) {
|
|
39
33
|
const raw = env[key] ?? String(def);
|
|
40
34
|
const n = parseInt(raw, 10);
|
|
@@ -77,14 +71,35 @@ export function loadNamedArtifact(schemas, name) {
|
|
|
77
71
|
return null;
|
|
78
72
|
return loadArtifact(artifactPath(info, name));
|
|
79
73
|
}
|
|
80
|
-
export function registryArtifactPath(artifactId, schemasDir) {
|
|
74
|
+
export function registryArtifactPath(artifactId, schemasDir, env = process.env) {
|
|
81
75
|
const record = loadRegistryForSchemas(schemasDir).get(artifactId);
|
|
82
76
|
if (record === undefined)
|
|
83
77
|
throw new Error(`artifact registry does not define '${artifactId}'`);
|
|
84
|
-
return resolveArtifactPath(record, process.cwd(), activeObjectiveName());
|
|
78
|
+
return resolveArtifactPath(record, process.cwd(), activeObjectiveName(), env);
|
|
85
79
|
}
|
|
86
80
|
// ── staleness ───────────────────────────────────────────────────────
|
|
87
|
-
|
|
81
|
+
const PROFILE_GENERATED_RE = /<!-- Generated:\s*(\d{4}-\d{2}-\d{2})/;
|
|
82
|
+
const PROFILE_VALIDATED_RE = /Validated:\s*(\d{4}-\d{2}-\d{2})/;
|
|
83
|
+
export function parseProfileHeaderDates(text) {
|
|
84
|
+
const genMatch = PROFILE_GENERATED_RE.exec(text);
|
|
85
|
+
const generatedDate = genMatch ? genMatch[1] : null;
|
|
86
|
+
const generatedUtc = generatedDate ? dateFromIso(generatedDate) : null;
|
|
87
|
+
const valMatch = PROFILE_VALIDATED_RE.exec(text);
|
|
88
|
+
const validatedDate = valMatch ? valMatch[1] : null;
|
|
89
|
+
const validatedUtc = validatedDate ? dateFromIso(validatedDate) : null;
|
|
90
|
+
return { generatedDate, validatedDate, generatedUtc, validatedUtc };
|
|
91
|
+
}
|
|
92
|
+
function profileRefreshAnchorUtc(text) {
|
|
93
|
+
const { generatedUtc, validatedUtc } = parseProfileHeaderDates(text);
|
|
94
|
+
if (generatedUtc === null && validatedUtc === null)
|
|
95
|
+
return null;
|
|
96
|
+
if (generatedUtc === null)
|
|
97
|
+
return validatedUtc;
|
|
98
|
+
if (validatedUtc === null)
|
|
99
|
+
return generatedUtc;
|
|
100
|
+
return Math.max(generatedUtc, validatedUtc);
|
|
101
|
+
}
|
|
102
|
+
export function checkProfileStaleness(profilePath, env = process.env) {
|
|
88
103
|
if (!fs.existsSync(profilePath))
|
|
89
104
|
return null;
|
|
90
105
|
let text;
|
|
@@ -95,14 +110,11 @@ export function checkProfileraStaleness(profilePath, env = process.env) {
|
|
|
95
110
|
process.stderr.write(`warning: failed to read profile path ${profilePath}: ${exc.message}\n`);
|
|
96
111
|
return null;
|
|
97
112
|
}
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
113
|
+
const anchor = profileRefreshAnchorUtc(text);
|
|
114
|
+
if (anchor === null)
|
|
100
115
|
return null;
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
return null;
|
|
104
|
-
const staleDays = intEnv(env, PROFILERA_STALE_DAYS_ENV, DEFAULT_PROFILERA_STALE_DAYS);
|
|
105
|
-
const since = daysSince(gen);
|
|
116
|
+
const staleDays = intEnv(env, PROFILE_STALE_DAYS_ENV, DEFAULT_PROFILE_STALE_DAYS);
|
|
117
|
+
const since = daysSince(anchor);
|
|
106
118
|
return [since >= staleDays, since, staleDays];
|
|
107
119
|
}
|
|
108
120
|
export function healthAuditDate(entry) {
|
|
@@ -139,11 +151,11 @@ function cyclesSinceHealthAudit(schemas, auditDate) {
|
|
|
139
151
|
}
|
|
140
152
|
return count;
|
|
141
153
|
}
|
|
142
|
-
function
|
|
154
|
+
function checkAuditStaleness(schemas, latest, auditDate, env = process.env) {
|
|
143
155
|
if (latest === null || auditDate === null)
|
|
144
156
|
return null;
|
|
145
|
-
const staleDaysThreshold = intEnv(env,
|
|
146
|
-
const staleCyclesThreshold = intEnv(env,
|
|
157
|
+
const staleDaysThreshold = intEnv(env, AUDIT_STALE_DAYS_ENV, DEFAULT_AUDIT_STALE_DAYS);
|
|
158
|
+
const staleCyclesThreshold = intEnv(env, AUDIT_STALE_CYCLES_ENV, DEFAULT_AUDIT_STALE_CYCLES);
|
|
147
159
|
const since = daysSince(auditDate);
|
|
148
160
|
const cyclesSince = cyclesSinceHealthAudit(schemas, auditDate);
|
|
149
161
|
const timeStale = since >= staleDaysThreshold;
|
|
@@ -168,7 +180,7 @@ function checkInspekteraAuditStaleness(schemas, latest, auditDate, env = process
|
|
|
168
180
|
if (cyclesSince !== null)
|
|
169
181
|
result.cycles_since_audit = cyclesSince;
|
|
170
182
|
if (isStale)
|
|
171
|
-
result.suggested_action = "Run
|
|
183
|
+
result.suggested_action = "Run audit to refresh health audit";
|
|
172
184
|
return result;
|
|
173
185
|
}
|
|
174
186
|
// ── todo items + issue counts ───────────────────────────────────────
|
|
@@ -217,9 +229,12 @@ export function loadTodoItems(schemas) {
|
|
|
217
229
|
continue;
|
|
218
230
|
}
|
|
219
231
|
if (currentSeverity) {
|
|
220
|
-
const
|
|
221
|
-
if (
|
|
222
|
-
|
|
232
|
+
const parsed = parseTodoMarkdownListItem(stripped);
|
|
233
|
+
if (!parsed || isResolvedTodoMarkdownStatus(parsed.status))
|
|
234
|
+
continue;
|
|
235
|
+
if (!parsed.description)
|
|
236
|
+
continue;
|
|
237
|
+
items.push({ severity: currentSeverity, status: parsed.status, text: parsed.description });
|
|
223
238
|
}
|
|
224
239
|
}
|
|
225
240
|
return items;
|
|
@@ -239,72 +254,95 @@ export function issueCounts(todoItems) {
|
|
|
239
254
|
}
|
|
240
255
|
return counts;
|
|
241
256
|
}
|
|
242
|
-
function
|
|
257
|
+
function todoNeedsPlan(item) {
|
|
243
258
|
const text = item.text.toLowerCase();
|
|
244
259
|
let signalCount = 0;
|
|
245
|
-
for (const signal of
|
|
260
|
+
for (const signal of TODO_PLAN_SIGNALS)
|
|
246
261
|
if (text.includes(signal))
|
|
247
262
|
signalCount += 1;
|
|
248
263
|
return signalCount >= 2 || (signalCount >= 1 && text.length > 180);
|
|
249
264
|
}
|
|
250
265
|
// ── per-artifact summaries ──────────────────────────────────────────
|
|
251
266
|
export function planSummary(schemas) {
|
|
252
|
-
const
|
|
253
|
-
if (!
|
|
254
|
-
|
|
267
|
+
const info = schemas.plan;
|
|
268
|
+
if (!info) {
|
|
269
|
+
const summary = {
|
|
255
270
|
exists: false,
|
|
256
271
|
active: false,
|
|
257
272
|
tasks: [],
|
|
258
273
|
status: "absent",
|
|
259
274
|
title: "",
|
|
275
|
+
active_path: "",
|
|
260
276
|
absence_reason: "No active plan artifact is available from agentera plan.",
|
|
261
277
|
};
|
|
278
|
+
summary.lifecycle_state = planLifecycleState(summary);
|
|
279
|
+
return summary;
|
|
262
280
|
}
|
|
263
|
-
const
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
281
|
+
const discovery = discoverPlanArtifacts(artifactPath(info, "plan"));
|
|
282
|
+
const activeDiagnostics = discovery.diagnostics.filter((diagnostic) => diagnostic.path === discovery.activePath && diagnostic.category !== "legacy");
|
|
283
|
+
const archivedPlans = discovery.archived.map((artifact) => planCatalogEntry(artifact, discovery.activePath));
|
|
284
|
+
if (!discovery.active) {
|
|
285
|
+
const summary = {
|
|
286
|
+
exists: activeDiagnostics.length === 0 && archivedPlans.length > 0,
|
|
287
|
+
active: false,
|
|
288
|
+
tasks: [],
|
|
289
|
+
status: activeDiagnostics.length > 0 ? "invalid" : archivedPlans.length > 0 ? "archived" : "absent",
|
|
290
|
+
title: "",
|
|
291
|
+
active_path: discovery.activePath,
|
|
292
|
+
absence_reason: activeDiagnostics.length > 0
|
|
293
|
+
? "Current plan artifact is invalid; see diagnostics."
|
|
294
|
+
: archivedPlans.length > 0
|
|
295
|
+
? "No active plan artifact is available; archived plan state is history only."
|
|
296
|
+
: "No active plan artifact is available from agentera plan.",
|
|
297
|
+
complete: 0,
|
|
298
|
+
total: 0,
|
|
299
|
+
complete_plan: false,
|
|
300
|
+
first_pending: null,
|
|
301
|
+
archived_plans: archivedPlans,
|
|
302
|
+
archive_count: archivedPlans.length,
|
|
303
|
+
invalid_archive_paths: discovery.invalidArchivePaths,
|
|
304
|
+
...(activeDiagnostics.length > 0 ? { invalid_path: discovery.activePath } : {}),
|
|
305
|
+
diagnostics: discovery.diagnostics,
|
|
306
|
+
};
|
|
307
|
+
summary.lifecycle_state = planLifecycleState(summary);
|
|
308
|
+
return summary;
|
|
278
309
|
}
|
|
310
|
+
const d = discovery.active.data;
|
|
311
|
+
const parts = planDocumentParts(d);
|
|
312
|
+
const tasks = parts.tasks;
|
|
313
|
+
const status = parts.legacyEntries ? entryStatusPy(tasks[0], "") : parts.status;
|
|
314
|
+
const title = parts.legacyEntries
|
|
315
|
+
? String(firstPresent(tasks[0] ?? {}, ["title", "name"], ""))
|
|
316
|
+
: parts.title;
|
|
279
317
|
const complete = tasks.filter((task) => DONE_STATUSES.has(entryStatusPy(task, ""))).length;
|
|
280
318
|
const total = tasks.length;
|
|
281
319
|
const completePlan = DONE_STATUSES.has(status.toLowerCase()) && complete === total;
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
if (DONE_STATUSES.has(ts) || BLOCKED_STATUSES.has(ts))
|
|
287
|
-
continue;
|
|
288
|
-
firstPending = task;
|
|
289
|
-
break;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
return {
|
|
320
|
+
const firstPending = completePlan
|
|
321
|
+
? null
|
|
322
|
+
: dependencyReadyTasks(tasks).find((task) => entryStatusPy(task, "pending") === "pending") ?? null;
|
|
323
|
+
const summary = {
|
|
293
324
|
exists: true,
|
|
294
325
|
status,
|
|
295
326
|
title,
|
|
327
|
+
active_path: discovery.activePath,
|
|
296
328
|
constraints: d.constraints ?? null,
|
|
297
329
|
scope: d.scope ?? null,
|
|
298
330
|
design: d.design ?? null,
|
|
299
331
|
tasks,
|
|
300
332
|
complete,
|
|
301
333
|
total,
|
|
302
|
-
active:
|
|
334
|
+
active: true,
|
|
303
335
|
complete_plan: completePlan,
|
|
304
336
|
first_pending: firstPending,
|
|
337
|
+
archived_plans: archivedPlans,
|
|
338
|
+
archive_count: archivedPlans.length,
|
|
339
|
+
invalid_archive_paths: discovery.invalidArchivePaths,
|
|
340
|
+
diagnostics: discovery.diagnostics,
|
|
305
341
|
};
|
|
342
|
+
summary.lifecycle_state = planLifecycleState(summary);
|
|
343
|
+
return summary;
|
|
306
344
|
}
|
|
307
|
-
export function docsSummary(schemas) {
|
|
345
|
+
export function docsSummary(schemas, startupInput = {}) {
|
|
308
346
|
const data = loadNamedArtifact(schemas, "docs");
|
|
309
347
|
if (!data || typeof data !== "object" || Array.isArray(data)) {
|
|
310
348
|
return { exists: false, status: "absent", absence_reason: "No docs mapping artifact is available from agentera docs." };
|
|
@@ -323,13 +361,13 @@ export function docsSummary(schemas) {
|
|
|
323
361
|
mapping_entries: mapping.length,
|
|
324
362
|
coverage,
|
|
325
363
|
source_contract: {
|
|
326
|
-
capability_startup_complete:
|
|
364
|
+
capability_startup_complete: capabilityStartupComplete(startupInput),
|
|
327
365
|
raw_artifact_reads_required: false,
|
|
328
366
|
state_families: [
|
|
329
367
|
"plan task details, dependencies, acceptance criteria, and evidence summaries",
|
|
330
368
|
"docs artifact mapping and source-contract completeness metadata",
|
|
331
|
-
"latest progress verification metadata needed for
|
|
332
|
-
"
|
|
369
|
+
"latest progress verification metadata needed for Orchestrate evaluation",
|
|
370
|
+
"Document closeout context metadata for docs/TODO/changelog/progress synchronization",
|
|
333
371
|
],
|
|
334
372
|
},
|
|
335
373
|
indexed_documents: index.length,
|
|
@@ -341,7 +379,7 @@ export function progressSummary(schemas) {
|
|
|
341
379
|
if (entries.length === 0) {
|
|
342
380
|
return { exists: false, status: "absent", absence_reason: "No progress cycles are available from agentera progress." };
|
|
343
381
|
}
|
|
344
|
-
const latest = recentCycles(entries, 1)[0];
|
|
382
|
+
const latest = progressEntriesForOutput(recentCycles(entries, 1))[0];
|
|
345
383
|
return {
|
|
346
384
|
exists: true,
|
|
347
385
|
status: "available",
|
|
@@ -370,18 +408,20 @@ export function healthSummary(schemas, env = process.env) {
|
|
|
370
408
|
const trajectory = String(latest.trajectory ?? "");
|
|
371
409
|
const auditDate = healthAuditDate(latest);
|
|
372
410
|
const dateStr = auditDate !== null ? isoFromUtc(auditDate) : null;
|
|
411
|
+
const latestNumber = typeof latest.number === "string" || typeof latest.number === "number" ? latest.number : "?";
|
|
412
|
+
const latestTimestamp = typeof latest.timestamp === "string" ? latest.timestamp : null;
|
|
373
413
|
const summary = {
|
|
374
414
|
exists: true,
|
|
375
|
-
number:
|
|
415
|
+
number: latestNumber,
|
|
376
416
|
date: dateStr,
|
|
377
|
-
timestamp: dateStr ??
|
|
417
|
+
timestamp: dateStr ?? latestTimestamp,
|
|
378
418
|
trajectory,
|
|
379
419
|
grade: worst ? worst[1] : "",
|
|
380
420
|
worst,
|
|
381
421
|
degrading: ["degrading", "declining", "worse"].includes(trajectory.toLowerCase()) ||
|
|
382
422
|
(worst !== null && worst[2] >= gradeRank.D),
|
|
383
423
|
};
|
|
384
|
-
const staleness =
|
|
424
|
+
const staleness = checkAuditStaleness(schemas, latest, auditDate, env);
|
|
385
425
|
if (staleness !== null)
|
|
386
426
|
Object.assign(summary, staleness);
|
|
387
427
|
return summary;
|
|
@@ -399,7 +439,7 @@ function objectiveStatus(data) {
|
|
|
399
439
|
return String(firstPresent(header, ["status"], data.status ?? objective.status ?? "") || "").toLowerCase();
|
|
400
440
|
}
|
|
401
441
|
export function activeObjectiveSummary() {
|
|
402
|
-
const root = path.join(process.cwd(), ".agentera", "
|
|
442
|
+
const root = path.join(process.cwd(), ".agentera", "optimize");
|
|
403
443
|
let isDir = false;
|
|
404
444
|
try {
|
|
405
445
|
isDir = fs.statSync(root).isDirectory();
|
|
@@ -462,7 +502,11 @@ export function statePresence(plan, docs, progress, health, objective) {
|
|
|
462
502
|
objective: Boolean(objective.exists),
|
|
463
503
|
};
|
|
464
504
|
const absence = {};
|
|
465
|
-
for (const [name, summary] of [
|
|
505
|
+
for (const [name, summary] of [
|
|
506
|
+
["plan", plan],
|
|
507
|
+
["docs", docs],
|
|
508
|
+
["progress", progress],
|
|
509
|
+
]) {
|
|
466
510
|
if (!summary.exists && summary.absence_reason)
|
|
467
511
|
absence[name] = summary.absence_reason;
|
|
468
512
|
}
|
|
@@ -481,11 +525,11 @@ export function decisionFollowUp(schemas) {
|
|
|
481
525
|
for (const rawEntry of extractEntries(data)) {
|
|
482
526
|
const entry = decisionContextEntry(rawEntry);
|
|
483
527
|
const satisfaction = entry.satisfaction;
|
|
484
|
-
if (!satisfaction || typeof satisfaction !== "object" || !satisfaction.review_needed)
|
|
528
|
+
if (!satisfaction || typeof satisfaction !== "object" || Array.isArray(satisfaction) || !satisfaction.review_needed)
|
|
485
529
|
continue;
|
|
486
|
-
const number = entry.number
|
|
530
|
+
const number = typeof entry.number === "string" || typeof entry.number === "number" ? entry.number : "?";
|
|
487
531
|
const title = firstPresent(entry, ["question", "choice"], "decision follow-up");
|
|
488
|
-
return { object: `DECISION ${number} follow-up`, title };
|
|
532
|
+
return { object: `DECISION ${number} follow-up`, title: String(title) };
|
|
489
533
|
}
|
|
490
534
|
return null;
|
|
491
535
|
}
|
|
@@ -495,7 +539,7 @@ function decisionAttentionState(satisfaction) {
|
|
|
495
539
|
return "missing";
|
|
496
540
|
if (state === "user_confirmed_satisfied" && satisfaction.review_needed)
|
|
497
541
|
return "unconfirmed_user_confirmed_satisfied";
|
|
498
|
-
if (["open", "provisionally_satisfied", "review_needed"].includes(state))
|
|
542
|
+
if (["open", "provisionally_satisfied", "review_needed"].includes(String(state)))
|
|
499
543
|
return String(state);
|
|
500
544
|
if (state === "user_confirmed_satisfied")
|
|
501
545
|
return "user_confirmed_satisfied";
|
|
@@ -508,12 +552,12 @@ export function decisionReviewAttention(schemas) {
|
|
|
508
552
|
for (const rawEntry of extractEntries(data)) {
|
|
509
553
|
const entry = decisionContextEntry(rawEntry);
|
|
510
554
|
const satisfaction = entry.satisfaction;
|
|
511
|
-
if (!satisfaction || typeof satisfaction !== "object" || !satisfaction.review_needed)
|
|
555
|
+
if (!satisfaction || typeof satisfaction !== "object" || Array.isArray(satisfaction) || !satisfaction.review_needed)
|
|
512
556
|
continue;
|
|
513
557
|
const state = decisionAttentionState(satisfaction);
|
|
514
558
|
stateCounts[state] = (stateCounts[state] ?? 0) + 1;
|
|
515
559
|
reviewEntries.push({
|
|
516
|
-
number: entry.number
|
|
560
|
+
number: typeof entry.number === "string" || typeof entry.number === "number" ? entry.number : "?",
|
|
517
561
|
title: truncate(firstPresent(entry, ["question", "choice", "summary"], "decision review"), 80),
|
|
518
562
|
state,
|
|
519
563
|
source: satisfaction.source ?? null,
|
|
@@ -541,55 +585,91 @@ export function decisionReviewAttention(schemas) {
|
|
|
541
585
|
}
|
|
542
586
|
export function formatNextAction(action) {
|
|
543
587
|
if (!action)
|
|
544
|
-
return "object=VISION refresh | capability=
|
|
545
|
-
|
|
588
|
+
return "object=VISION refresh | capability=vision | reason=no executable follow-up | phase=envision";
|
|
589
|
+
const phase = "phase" in action && action.phase ? ` | phase=${action.phase}` : "";
|
|
590
|
+
return `object=${truncate(action.object)} | capability=${action.capability} | reason=${action.reason}${phase}`;
|
|
546
591
|
}
|
|
547
|
-
|
|
592
|
+
/**
|
|
593
|
+
* Evolved state-readiness hint (Decision 76). Evaluates every cascade branch
|
|
594
|
+
* (no early-return); each candidate carries a protocol.yaml phase tag (PH1
|
|
595
|
+
* envision → PH5 audit). Position 1 (`recommended`) is the branch that would
|
|
596
|
+
* have won under the legacy early-return cascade.
|
|
597
|
+
*/
|
|
598
|
+
export function selectStatusReadiness(plan, health, objective, todoItems, decision, savedContext) {
|
|
599
|
+
const candidates = [];
|
|
548
600
|
const pending = plan.first_pending;
|
|
549
601
|
if (pending && typeof pending === "object" && !Array.isArray(pending)) {
|
|
550
602
|
const number = pending.number ?? "?";
|
|
551
603
|
const title = firstPresent(pending, ["name", "title"], "pending task");
|
|
552
|
-
|
|
604
|
+
candidates.push({
|
|
605
|
+
object: `PLAN Task ${number}: ${title}`,
|
|
606
|
+
capability: "orchestrate",
|
|
607
|
+
reason: "first pending plan task",
|
|
608
|
+
phase: "build",
|
|
609
|
+
});
|
|
553
610
|
}
|
|
554
611
|
if (health.degrading) {
|
|
555
612
|
const worst = health.worst;
|
|
556
613
|
const target = worst ? `${worst[0]}:${worst[1]}` : "degrading health";
|
|
557
|
-
|
|
614
|
+
candidates.push({
|
|
615
|
+
object: `HEALTH: ${target}`,
|
|
616
|
+
capability: "audit",
|
|
617
|
+
reason: "critical or degrading health",
|
|
618
|
+
phase: "audit",
|
|
619
|
+
});
|
|
558
620
|
}
|
|
559
621
|
if (objective.active) {
|
|
560
|
-
|
|
622
|
+
candidates.push({
|
|
561
623
|
object: `OBJECTIVE: ${objective.metric || objective.title}`,
|
|
562
|
-
capability: "
|
|
624
|
+
capability: "optimize",
|
|
563
625
|
reason: "active non-closed objective",
|
|
564
|
-
|
|
626
|
+
phase: "build",
|
|
627
|
+
});
|
|
565
628
|
}
|
|
566
629
|
if (todoItems.length > 0) {
|
|
567
630
|
const item = [...todoItems].sort((a, b) => (TODO_SEVERITY_ORDER[a.severity] ?? 2) - (TODO_SEVERITY_ORDER[b.severity] ?? 2))[0];
|
|
568
|
-
if (
|
|
569
|
-
|
|
631
|
+
if (todoNeedsPlan(item)) {
|
|
632
|
+
candidates.push({ object: `TODO: ${item.text}`, capability: "plan", reason: "complex TODO needs planning", phase: "plan" });
|
|
633
|
+
}
|
|
634
|
+
else {
|
|
635
|
+
candidates.push({ object: `TODO: ${item.text}`, capability: "build", reason: "highest-priority open TODO", phase: "build" });
|
|
570
636
|
}
|
|
571
|
-
return { object: `TODO: ${item.text}`, capability: "realisera", reason: "highest-priority open TODO" };
|
|
572
637
|
}
|
|
573
638
|
if (health.stale && !health.degrading) {
|
|
574
|
-
|
|
639
|
+
candidates.push({
|
|
575
640
|
object: `HEALTH: Audit ${health.number ?? "?"} stale`,
|
|
576
|
-
capability: "
|
|
641
|
+
capability: "audit",
|
|
577
642
|
reason: "stale health audit",
|
|
578
|
-
|
|
643
|
+
phase: "audit",
|
|
644
|
+
});
|
|
579
645
|
}
|
|
580
646
|
if (decision) {
|
|
581
|
-
|
|
647
|
+
candidates.push({
|
|
648
|
+
object: String(decision.object),
|
|
649
|
+
capability: "discuss",
|
|
650
|
+
reason: "unresolved decision follow-up",
|
|
651
|
+
phase: "deliberate",
|
|
652
|
+
});
|
|
582
653
|
}
|
|
583
654
|
const visionExists = fs.existsSync(path.join(process.cwd(), ".agentera", "vision.yaml"));
|
|
584
|
-
if (plan.exists && !plan.complete_plan) {
|
|
585
|
-
|
|
655
|
+
if ((plan.exists && !plan.complete_plan) || visionExists) {
|
|
656
|
+
candidates.push({ object: "VISION refresh", capability: "plan", reason: "no executable follow-up", phase: "envision" });
|
|
586
657
|
}
|
|
587
|
-
if (visionExists) {
|
|
588
|
-
|
|
658
|
+
if (savedContext && !visionExists) {
|
|
659
|
+
candidates.push({ object: "Direction clarification", capability: "discuss", reason: "saved context without vision", phase: "envision" });
|
|
589
660
|
}
|
|
590
|
-
|
|
591
|
-
|
|
661
|
+
candidates.push({ object: "VISION refresh", capability: "vision", reason: "fresh project direction", phase: "envision" });
|
|
662
|
+
// Guarantee at least one alternative so the hint never collapses to a single entry.
|
|
663
|
+
if (candidates.length < 2) {
|
|
664
|
+
candidates.push({ object: "Direction clarification", capability: "discuss", reason: "clarify project direction", phase: "envision" });
|
|
592
665
|
}
|
|
593
|
-
|
|
666
|
+
const [recommended, ...alternatives] = candidates;
|
|
667
|
+
return { recommended, alternatives };
|
|
668
|
+
}
|
|
669
|
+
/** Legacy single-entry projection of {@link selectStatusReadiness}: the
|
|
670
|
+
* top-priority candidate as `{object, capability, reason}` (no `phase`). */
|
|
671
|
+
export function selectStatusNextAction(plan, health, objective, todoItems, decision, savedContext) {
|
|
672
|
+
const { recommended } = selectStatusReadiness(plan, health, objective, todoItems, decision, savedContext);
|
|
673
|
+
return { object: recommended.object, capability: recommended.capability, reason: recommended.reason };
|
|
594
674
|
}
|
|
595
675
|
//# sourceMappingURL=orientation.js.map
|