agentera 3.0.0-dev.2 → 3.0.0-dev.21
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 +84 -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 +1101 -0
- package/bundle/DESIGN.md +233 -0
- package/bundle/LICENSE +201 -0
- package/bundle/README.md +158 -0
- package/bundle/UPGRADE.md +265 -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 +55 -35
- 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 +9 -8
- package/bundle/references/artifacts/state-storage-authority.yaml +1446 -0
- package/bundle/references/cli/agent-ready-state-contract.yaml +37 -62
- package/bundle/references/cli/app-lifecycle-vocabulary.yaml +4 -4
- package/bundle/references/cli/audience-namespace-cli-migration.yaml +57 -28
- 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 +10 -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/audit/schemas/artifacts.yaml +84 -0
- 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 +20 -19
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/artifacts.yaml +22 -17
- 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/discuss/schemas/artifacts.yaml +49 -0
- 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 +23 -16
- package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/triggers.yaml +14 -4
- package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/validation.yaml +18 -18
- 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/orchestrate/schemas/artifacts.yaml +71 -0
- 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 +387 -329
- package/bundle/skills/agentera/schemas/artifacts/changelog.yaml +4 -4
- package/bundle/skills/agentera/schemas/artifacts/decisions.yaml +25 -20
- 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 +139 -8
- package/bundle/skills/agentera/schemas/artifacts/health.yaml +21 -15
- package/bundle/skills/agentera/schemas/artifacts/objective.yaml +22 -8
- package/bundle/skills/agentera/schemas/artifacts/plan.yaml +285 -11
- package/bundle/skills/agentera/schemas/artifacts/progress.yaml +36 -51
- package/bundle/skills/agentera/schemas/artifacts/todo.yaml +77 -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 +30 -23
- 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 +38 -0
- package/dist/cli/capabilityContext/bespoke.js.map +1 -0
- package/dist/cli/capabilityContext/build.js +191 -0
- package/dist/cli/capabilityContext/build.js.map +1 -0
- package/dist/cli/capabilityContext/closeout.js +231 -0
- package/dist/cli/capabilityContext/closeout.js.map +1 -0
- package/dist/cli/capabilityContext/contract.js +219 -0
- package/dist/cli/capabilityContext/contract.js.map +1 -0
- package/dist/cli/capabilityContext/evidence.js +457 -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 +118 -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 +143 -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 +139 -0
- package/dist/cli/capabilityContext/slim.js.map +1 -0
- package/dist/cli/capabilityContext/startup.js +241 -0
- package/dist/cli/capabilityContext/startup.js.map +1 -0
- package/dist/cli/capabilityContext/types.js +51 -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/backfill.js +186 -76
- package/dist/cli/commands/backfill.js.map +1 -1
- package/dist/cli/commands/capability.js +3 -10
- package/dist/cli/commands/capability.js.map +1 -1
- package/dist/cli/commands/compact.js +41 -12
- 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/durability.js +85 -0
- package/dist/cli/commands/durability.js.map +1 -0
- package/dist/cli/commands/lint.js +16 -41
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/migrate.js +677 -0
- package/dist/cli/commands/migrate.js.map +1 -0
- 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 +202 -0
- package/dist/cli/commands/prime/collectOrientationState.js.map +1 -0
- package/dist/cli/commands/prime/orientationOutput.js +235 -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 +25 -4
- 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 +343 -76
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/state/decisions.js +421 -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/experimentRecords.js +156 -0
- package/dist/cli/commands/state/experimentRecords.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/get.js +141 -0
- package/dist/cli/commands/state/get.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/list.js +159 -0
- package/dist/cli/commands/state/list.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 +379 -0
- package/dist/cli/commands/state/plan.js.map +1 -0
- package/dist/cli/commands/state/planTasks.js +164 -0
- package/dist/cli/commands/state/planTasks.js.map +1 -0
- package/dist/cli/commands/state/plans.js +154 -0
- package/dist/cli/commands/state/plans.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 +346 -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 +395 -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 +201 -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 +168 -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 +53 -0
- package/dist/cli/errors.js.map +1 -0
- package/dist/cli/help.js +421 -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 +336 -144
- package/dist/cli/orientation.js.map +1 -1
- package/dist/cli/planArtifacts.js +201 -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 +69 -2
- package/dist/cli/prime-blob.js.map +1 -1
- package/dist/cli/startupCompletenessContract.js +57 -0
- package/dist/cli/startupCompletenessContract.js.map +1 -0
- package/dist/cli/stateQuery.js +22 -5
- 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/text.js +11 -0
- package/dist/core/text.js.map +1 -0
- 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 +447 -0
- package/dist/hooks/compaction/apply.js.map +1 -0
- package/dist/hooks/compaction/dryRun.js +185 -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 +326 -0
- package/dist/hooks/compaction/parse.js.map +1 -0
- package/dist/hooks/compaction/retention.js +203 -0
- package/dist/hooks/compaction/retention.js.map +1 -0
- package/dist/hooks/compaction/status.js +336 -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 +57 -18
- 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 +108 -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 +203 -53
- 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 +329 -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/archiveDiscovery.js +589 -0
- package/dist/state/archiveDiscovery.js.map +1 -0
- package/dist/state/archivePublication.js +225 -0
- package/dist/state/archivePublication.js.map +1 -0
- package/dist/state/archiveRecovery.js +238 -0
- package/dist/state/archiveRecovery.js.map +1 -0
- package/dist/state/archiveReplay.js +54 -0
- package/dist/state/archiveReplay.js.map +1 -0
- package/dist/state/decisionOverlay.js +255 -0
- package/dist/state/decisionOverlay.js.map +1 -0
- package/dist/state/directRetrieval.js +322 -0
- package/dist/state/directRetrieval.js.map +1 -0
- package/dist/state/durability.js +451 -0
- package/dist/state/durability.js.map +1 -0
- package/dist/state/experimentArchive.js +64 -0
- package/dist/state/experimentArchive.js.map +1 -0
- package/dist/state/experimentIdentity.js +191 -0
- package/dist/state/experimentIdentity.js.map +1 -0
- package/dist/state/experimentRetrieval.js +447 -0
- package/dist/state/experimentRetrieval.js.map +1 -0
- package/dist/state/gitBackfill.js +561 -0
- package/dist/state/gitBackfill.js.map +1 -0
- package/dist/state/gitBackfillAuthority.js +141 -0
- package/dist/state/gitBackfillAuthority.js.map +1 -0
- package/dist/state/gitBackfillHistory.js +278 -0
- package/dist/state/gitBackfillHistory.js.map +1 -0
- package/dist/state/gitBackfillOutput.js +209 -0
- package/dist/state/gitBackfillOutput.js.map +1 -0
- package/dist/state/healthRepair.js +70 -0
- package/dist/state/healthRepair.js.map +1 -0
- package/dist/state/installRoot.js +64 -24
- package/dist/state/installRoot.js.map +1 -1
- package/dist/state/legacyIdentity.js +48 -0
- package/dist/state/legacyIdentity.js.map +1 -0
- package/dist/state/legacyMigration.js +516 -0
- package/dist/state/legacyMigration.js.map +1 -0
- package/dist/state/legacyMigrationParser.js +489 -0
- package/dist/state/legacyMigrationParser.js.map +1 -0
- package/dist/state/listAccounting.js +55 -0
- package/dist/state/listAccounting.js.map +1 -0
- package/dist/state/listClassification.js +18 -0
- package/dist/state/listClassification.js.map +1 -0
- package/dist/state/listRetrieval.js +782 -0
- package/dist/state/listRetrieval.js.map +1 -0
- package/dist/state/migrationAuthority.js +413 -0
- package/dist/state/migrationAuthority.js.map +1 -0
- package/dist/state/migrationEnrichment.js +35 -0
- package/dist/state/migrationEnrichment.js.map +1 -0
- package/dist/state/planIdentity.js +45 -0
- package/dist/state/planIdentity.js.map +1 -0
- package/dist/state/planRetrieval.js +314 -0
- package/dist/state/planRetrieval.js.map +1 -0
- package/dist/state/planTaskRetrieval.js +285 -0
- package/dist/state/planTaskRetrieval.js.map +1 -0
- package/dist/state/projectionPolicy.js +184 -0
- package/dist/state/projectionPolicy.js.map +1 -0
- package/dist/state/retrievalAuthority.js +326 -0
- package/dist/state/retrievalAuthority.js.map +1 -0
- 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/startupProjection.js +498 -0
- package/dist/state/startupProjection.js.map +1 -0
- 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/experimentPublication.js +193 -0
- package/dist/state/write/experimentPublication.js.map +1 -0
- package/dist/state/write/explain.js +169 -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/helpers.js +8 -0
- package/dist/state/write/helpers.js.map +1 -0
- package/dist/state/write/index.js +12 -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 +131 -0
- package/dist/state/write/lock.js.map +1 -0
- package/dist/state/write/mutation.js +190 -0
- package/dist/state/write/mutation.js.map +1 -0
- package/dist/state/write/operations.js +254 -0
- package/dist/state/write/operations.js.map +1 -0
- package/dist/state/write/planPublication.js +172 -0
- package/dist/state/write/planPublication.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 +800 -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 +10 -7
- 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/inspektera/schemas/artifacts.yaml +0 -76
- 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/artifacts.yaml +0 -64
- 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/resonera/schemas/artifacts.yaml +0 -47
- 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/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
package/dist/cli/orientation.js
CHANGED
|
@@ -1,40 +1,38 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { resolveArtifactPath, } from "../registries/artifactRegistry.js";
|
|
4
|
-
import { activeObjectiveName, artifactPath,
|
|
3
|
+
import { loadArtifactRecord, resolveArtifactPath, } from "../registries/artifactRegistry.js";
|
|
4
|
+
import { activeObjectiveName, artifactPath, resolveRegistryModelPath, } from "./appContext.js";
|
|
5
5
|
import { asList, extractEntries, firstPresent, loadArtifact, recentCycles, truncate, } from "./stateQuery.js";
|
|
6
|
-
import {
|
|
6
|
+
import { normalizeSeverity } from "./commands/state/index.js";
|
|
7
|
+
import { isResolvedTodoMarkdownStatus, parseTodoMarkdownListItem } from "./todoMarkdown.js";
|
|
8
|
+
import { truncateCodePoints } from "../core/text.js";
|
|
9
|
+
import { TODO_SEVERITY_ORDER, TODO_SEVERITY_ORDER_KEYS } from "./todoSeverity.js";
|
|
10
|
+
import { capabilityStartupComplete } from "./startupCompletenessContract.js";
|
|
11
|
+
import { discoverPlanArtifacts, planCatalogEntry, planDocumentParts } from "./planArtifacts.js";
|
|
12
|
+
import { planLifecycleState } from "./planLifecycleState.js";
|
|
13
|
+
import { dependencyReadyTasks } from "./capabilityContext/planState.js";
|
|
14
|
+
import { resolveSourceRoot } from "../core/sourceRoot.js";
|
|
15
|
+
import { scanYamlCollection } from "../state/startupProjection.js";
|
|
16
|
+
import { numberedArchiveContract } from "../state/archiveDiscovery.js";
|
|
17
|
+
/**
|
|
18
|
+
* Orientation summaries layer for prime/status. Faithful port of the
|
|
19
|
+
* scripts/agentera `_*_summary`, `_load_todo_items`, `_issue_counts`,
|
|
20
|
+
* `_decision_*`, `_select_status_next_action`, and staleness helpers.
|
|
21
|
+
*/
|
|
7
22
|
export const DONE_STATUSES = new Set(["complete", "completed", "closed", "done", "resolved", "retired"]);
|
|
8
23
|
export const BLOCKED_STATUSES = new Set(["blocked", "stuck"]);
|
|
9
24
|
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([
|
|
25
|
+
const TODO_SECTION_SEVERITIES = Object.fromEntries(TODO_SEVERITY_ORDER_KEYS.map((key) => [key, key]));
|
|
26
|
+
const TODO_PLAN_SIGNALS = new Set([
|
|
29
27
|
"acceptance", "artifact", "capability", "capability-context", "compatibility", "contract",
|
|
30
28
|
"cross-capability", "docs", "metadata", "migration", "schema", "startup", "surface", "test", "validation",
|
|
31
29
|
]);
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
30
|
+
const PROFILE_STALE_DAYS_ENV = "AGENTERA_PROFILE_MAX_AGE_DAYS";
|
|
31
|
+
const DEFAULT_PROFILE_STALE_DAYS = 7;
|
|
32
|
+
const AUDIT_STALE_DAYS_ENV = "AGENTERA_AUDIT_MAX_AGE_DAYS";
|
|
33
|
+
const DEFAULT_AUDIT_STALE_DAYS = 30;
|
|
34
|
+
const AUDIT_STALE_CYCLES_ENV = "AGENTERA_AUDIT_MAX_CYCLES";
|
|
35
|
+
const DEFAULT_AUDIT_STALE_CYCLES = 10;
|
|
38
36
|
function intEnv(env, key, def) {
|
|
39
37
|
const raw = env[key] ?? String(def);
|
|
40
38
|
const n = parseInt(raw, 10);
|
|
@@ -77,14 +75,47 @@ export function loadNamedArtifact(schemas, name) {
|
|
|
77
75
|
return null;
|
|
78
76
|
return loadArtifact(artifactPath(info, name));
|
|
79
77
|
}
|
|
80
|
-
export function registryArtifactPath(artifactId, schemasDir) {
|
|
81
|
-
|
|
78
|
+
export function registryArtifactPath(artifactId, schemasDir, env = process.env) {
|
|
79
|
+
// Targeted lookup: resolving a single identity (e.g. `profile` against a
|
|
80
|
+
// v2-shaped install) must not walk the full registry and warn about every
|
|
81
|
+
// required schema that happens to be absent from this install. Only the
|
|
82
|
+
// requested identity is inspected; model/schemas authority is shared with the
|
|
83
|
+
// full loader via `resolveRegistryModelPath`.
|
|
84
|
+
let record;
|
|
85
|
+
try {
|
|
86
|
+
record = loadArtifactRecord(artifactId, schemasDir, resolveRegistryModelPath(schemasDir));
|
|
87
|
+
}
|
|
88
|
+
catch (exc) {
|
|
89
|
+
process.stderr.write(`warning: failed to load artifact registry for schemas: ${exc.message}\n`);
|
|
90
|
+
record = undefined;
|
|
91
|
+
}
|
|
82
92
|
if (record === undefined)
|
|
83
93
|
throw new Error(`artifact registry does not define '${artifactId}'`);
|
|
84
|
-
return resolveArtifactPath(record, process.cwd(), activeObjectiveName());
|
|
94
|
+
return resolveArtifactPath(record, process.cwd(), activeObjectiveName(), env);
|
|
85
95
|
}
|
|
86
96
|
// ── staleness ───────────────────────────────────────────────────────
|
|
87
|
-
|
|
97
|
+
const PROFILE_GENERATED_RE = /<!-- Generated:\s*(\d{4}-\d{2}-\d{2})/;
|
|
98
|
+
const PROFILE_VALIDATED_RE = /Validated:\s*(\d{4}-\d{2}-\d{2})/;
|
|
99
|
+
export function parseProfileHeaderDates(text) {
|
|
100
|
+
const genMatch = PROFILE_GENERATED_RE.exec(text);
|
|
101
|
+
const generatedDate = genMatch ? genMatch[1] : null;
|
|
102
|
+
const generatedUtc = generatedDate ? dateFromIso(generatedDate) : null;
|
|
103
|
+
const valMatch = PROFILE_VALIDATED_RE.exec(text);
|
|
104
|
+
const validatedDate = valMatch ? valMatch[1] : null;
|
|
105
|
+
const validatedUtc = validatedDate ? dateFromIso(validatedDate) : null;
|
|
106
|
+
return { generatedDate, validatedDate, generatedUtc, validatedUtc };
|
|
107
|
+
}
|
|
108
|
+
function profileRefreshAnchorUtc(text) {
|
|
109
|
+
const { generatedUtc, validatedUtc } = parseProfileHeaderDates(text);
|
|
110
|
+
if (generatedUtc === null && validatedUtc === null)
|
|
111
|
+
return null;
|
|
112
|
+
if (generatedUtc === null)
|
|
113
|
+
return validatedUtc;
|
|
114
|
+
if (validatedUtc === null)
|
|
115
|
+
return generatedUtc;
|
|
116
|
+
return Math.max(generatedUtc, validatedUtc);
|
|
117
|
+
}
|
|
118
|
+
export function checkProfileStaleness(profilePath, env = process.env) {
|
|
88
119
|
if (!fs.existsSync(profilePath))
|
|
89
120
|
return null;
|
|
90
121
|
let text;
|
|
@@ -95,14 +126,11 @@ export function checkProfileraStaleness(profilePath, env = process.env) {
|
|
|
95
126
|
process.stderr.write(`warning: failed to read profile path ${profilePath}: ${exc.message}\n`);
|
|
96
127
|
return null;
|
|
97
128
|
}
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
129
|
+
const anchor = profileRefreshAnchorUtc(text);
|
|
130
|
+
if (anchor === null)
|
|
100
131
|
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);
|
|
132
|
+
const staleDays = intEnv(env, PROFILE_STALE_DAYS_ENV, DEFAULT_PROFILE_STALE_DAYS);
|
|
133
|
+
const since = daysSince(anchor);
|
|
106
134
|
return [since >= staleDays, since, staleDays];
|
|
107
135
|
}
|
|
108
136
|
export function healthAuditDate(entry) {
|
|
@@ -127,8 +155,25 @@ function progressEntryDate(entry) {
|
|
|
127
155
|
}
|
|
128
156
|
return null;
|
|
129
157
|
}
|
|
158
|
+
function scanSchemaArtifact(schemas, artifactId) {
|
|
159
|
+
const info = schemas[artifactId];
|
|
160
|
+
const contract = numberedArchiveContract(artifactId, resolveSourceRoot());
|
|
161
|
+
const currentPath = info ? artifactPath(info, artifactId) : path.join(process.cwd(), ".agentera", `${artifactId}.yaml`);
|
|
162
|
+
const primary = scanYamlCollection(currentPath, contract.entryCollection, artifactId, contract.entryNumberField);
|
|
163
|
+
const active = artifactId === "progress" && !primary.collection_found
|
|
164
|
+
? scanYamlCollection(currentPath, "progress", artifactId, contract.entryNumberField)
|
|
165
|
+
: primary;
|
|
166
|
+
return {
|
|
167
|
+
active,
|
|
168
|
+
archive: scanYamlCollection(currentPath, "archive", artifactId, contract.entryNumberField),
|
|
169
|
+
};
|
|
170
|
+
}
|
|
130
171
|
function cyclesSinceHealthAudit(schemas, auditDate) {
|
|
131
|
-
const
|
|
172
|
+
const info = schemas.progress;
|
|
173
|
+
if (!info)
|
|
174
|
+
return null;
|
|
175
|
+
const scan = scanSchemaArtifact(schemas, "progress").active;
|
|
176
|
+
const entries = scan.entries.map((entry) => entry.fields);
|
|
132
177
|
if (entries.length === 0)
|
|
133
178
|
return null;
|
|
134
179
|
let count = 0;
|
|
@@ -139,11 +184,11 @@ function cyclesSinceHealthAudit(schemas, auditDate) {
|
|
|
139
184
|
}
|
|
140
185
|
return count;
|
|
141
186
|
}
|
|
142
|
-
function
|
|
187
|
+
function checkAuditStaleness(schemas, latest, auditDate, env = process.env) {
|
|
143
188
|
if (latest === null || auditDate === null)
|
|
144
189
|
return null;
|
|
145
|
-
const staleDaysThreshold = intEnv(env,
|
|
146
|
-
const staleCyclesThreshold = intEnv(env,
|
|
190
|
+
const staleDaysThreshold = intEnv(env, AUDIT_STALE_DAYS_ENV, DEFAULT_AUDIT_STALE_DAYS);
|
|
191
|
+
const staleCyclesThreshold = intEnv(env, AUDIT_STALE_CYCLES_ENV, DEFAULT_AUDIT_STALE_CYCLES);
|
|
147
192
|
const since = daysSince(auditDate);
|
|
148
193
|
const cyclesSince = cyclesSinceHealthAudit(schemas, auditDate);
|
|
149
194
|
const timeStale = since >= staleDaysThreshold;
|
|
@@ -168,7 +213,7 @@ function checkInspekteraAuditStaleness(schemas, latest, auditDate, env = process
|
|
|
168
213
|
if (cyclesSince !== null)
|
|
169
214
|
result.cycles_since_audit = cyclesSince;
|
|
170
215
|
if (isStale)
|
|
171
|
-
result.suggested_action = "Run
|
|
216
|
+
result.suggested_action = "Run audit to refresh health audit";
|
|
172
217
|
return result;
|
|
173
218
|
}
|
|
174
219
|
// ── todo items + issue counts ───────────────────────────────────────
|
|
@@ -217,9 +262,12 @@ export function loadTodoItems(schemas) {
|
|
|
217
262
|
continue;
|
|
218
263
|
}
|
|
219
264
|
if (currentSeverity) {
|
|
220
|
-
const
|
|
221
|
-
if (
|
|
222
|
-
|
|
265
|
+
const parsed = parseTodoMarkdownListItem(stripped);
|
|
266
|
+
if (!parsed || isResolvedTodoMarkdownStatus(parsed.status))
|
|
267
|
+
continue;
|
|
268
|
+
if (!parsed.description)
|
|
269
|
+
continue;
|
|
270
|
+
items.push({ severity: currentSeverity, status: parsed.status, text: parsed.description });
|
|
223
271
|
}
|
|
224
272
|
}
|
|
225
273
|
return items;
|
|
@@ -239,123 +287,220 @@ export function issueCounts(todoItems) {
|
|
|
239
287
|
}
|
|
240
288
|
return counts;
|
|
241
289
|
}
|
|
242
|
-
function
|
|
290
|
+
function todoNeedsPlan(item) {
|
|
243
291
|
const text = item.text.toLowerCase();
|
|
244
292
|
let signalCount = 0;
|
|
245
|
-
for (const signal of
|
|
293
|
+
for (const signal of TODO_PLAN_SIGNALS)
|
|
246
294
|
if (text.includes(signal))
|
|
247
295
|
signalCount += 1;
|
|
248
296
|
return signalCount >= 2 || (signalCount >= 1 && text.length > 180);
|
|
249
297
|
}
|
|
250
298
|
// ── per-artifact summaries ──────────────────────────────────────────
|
|
251
299
|
export function planSummary(schemas) {
|
|
252
|
-
const
|
|
253
|
-
if (!
|
|
254
|
-
|
|
300
|
+
const info = schemas.plan;
|
|
301
|
+
if (!info) {
|
|
302
|
+
const summary = {
|
|
255
303
|
exists: false,
|
|
256
304
|
active: false,
|
|
257
305
|
tasks: [],
|
|
258
306
|
status: "absent",
|
|
259
307
|
title: "",
|
|
308
|
+
active_path: "",
|
|
260
309
|
absence_reason: "No active plan artifact is available from agentera plan.",
|
|
261
310
|
};
|
|
311
|
+
summary.lifecycle_state = planLifecycleState(summary);
|
|
312
|
+
return summary;
|
|
262
313
|
}
|
|
263
|
-
const
|
|
264
|
-
const
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
314
|
+
const discovery = discoverPlanArtifacts(artifactPath(info, "plan"));
|
|
315
|
+
const activeDiagnostics = discovery.diagnostics.filter((diagnostic) => diagnostic.path === discovery.activePath && diagnostic.category !== "legacy");
|
|
316
|
+
const archivedPlans = discovery.archived.map((artifact) => planCatalogEntry(artifact, discovery.activePath));
|
|
317
|
+
if (!discovery.active) {
|
|
318
|
+
const summary = {
|
|
319
|
+
exists: activeDiagnostics.length === 0 && archivedPlans.length > 0,
|
|
320
|
+
active: false,
|
|
321
|
+
tasks: [],
|
|
322
|
+
status: activeDiagnostics.length > 0 ? "invalid" : archivedPlans.length > 0 ? "archived" : "absent",
|
|
323
|
+
title: "",
|
|
324
|
+
active_path: discovery.activePath,
|
|
325
|
+
absence_reason: activeDiagnostics.length > 0
|
|
326
|
+
? "Current plan artifact is invalid; see diagnostics."
|
|
327
|
+
: archivedPlans.length > 0
|
|
328
|
+
? "No active plan artifact is available; archived plan state is history only."
|
|
329
|
+
: "No active plan artifact is available from agentera plan.",
|
|
330
|
+
complete: 0,
|
|
331
|
+
total: 0,
|
|
332
|
+
complete_plan: false,
|
|
333
|
+
first_pending: null,
|
|
334
|
+
archived_plans: archivedPlans,
|
|
335
|
+
archive_count: archivedPlans.length,
|
|
336
|
+
invalid_archive_paths: discovery.invalidArchivePaths,
|
|
337
|
+
...(activeDiagnostics.length > 0 ? { invalid_path: discovery.activePath } : {}),
|
|
338
|
+
diagnostics: discovery.diagnostics,
|
|
339
|
+
};
|
|
340
|
+
summary.lifecycle_state = planLifecycleState(summary);
|
|
341
|
+
return summary;
|
|
278
342
|
}
|
|
343
|
+
const d = discovery.active.data;
|
|
344
|
+
const parts = planDocumentParts(d);
|
|
345
|
+
const tasks = parts.tasks;
|
|
346
|
+
const status = parts.legacyEntries ? entryStatusPy(tasks[0], "") : parts.status;
|
|
347
|
+
const title = parts.legacyEntries
|
|
348
|
+
? String(firstPresent(tasks[0] ?? {}, ["title", "name"], ""))
|
|
349
|
+
: parts.title;
|
|
279
350
|
const complete = tasks.filter((task) => DONE_STATUSES.has(entryStatusPy(task, ""))).length;
|
|
280
351
|
const total = tasks.length;
|
|
281
352
|
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 {
|
|
353
|
+
const firstPending = completePlan
|
|
354
|
+
? null
|
|
355
|
+
: dependencyReadyTasks(tasks).find((task) => entryStatusPy(task, "pending") === "pending") ?? null;
|
|
356
|
+
const summary = {
|
|
293
357
|
exists: true,
|
|
294
358
|
status,
|
|
295
359
|
title,
|
|
360
|
+
active_path: discovery.activePath,
|
|
296
361
|
constraints: d.constraints ?? null,
|
|
297
362
|
scope: d.scope ?? null,
|
|
298
363
|
design: d.design ?? null,
|
|
299
364
|
tasks,
|
|
300
365
|
complete,
|
|
301
366
|
total,
|
|
302
|
-
active:
|
|
367
|
+
active: true,
|
|
303
368
|
complete_plan: completePlan,
|
|
304
369
|
first_pending: firstPending,
|
|
370
|
+
archived_plans: archivedPlans,
|
|
371
|
+
archive_count: archivedPlans.length,
|
|
372
|
+
invalid_archive_paths: discovery.invalidArchivePaths,
|
|
373
|
+
diagnostics: discovery.diagnostics,
|
|
305
374
|
};
|
|
375
|
+
summary.lifecycle_state = planLifecycleState(summary);
|
|
376
|
+
return summary;
|
|
306
377
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
378
|
+
/** Startup keeps plan routing metadata, not the full active plan body. */
|
|
379
|
+
export function startupPlanSummary(plan) {
|
|
380
|
+
const tasks = asList(plan.tasks).filter((task) => task && typeof task === "object" && !Array.isArray(task));
|
|
381
|
+
const boundedTasks = tasks.slice(0, 10).map((task) => {
|
|
382
|
+
const item = {};
|
|
383
|
+
for (const key of ["number", "name", "title", "status", "depends_on", "acceptance_summary", "evidence_summary", "blocked_reasons", "evaluation_state"]) {
|
|
384
|
+
if (!(key in task))
|
|
385
|
+
continue;
|
|
386
|
+
if (key === "acceptance_summary" || key === "evidence_summary") {
|
|
387
|
+
const summary = task[key];
|
|
388
|
+
item[key] = summary && typeof summary === "object" && !Array.isArray(summary)
|
|
389
|
+
? { count: summary.count ?? asList(summary.items).length }
|
|
390
|
+
: null;
|
|
391
|
+
}
|
|
392
|
+
else if (key === "evaluation_state") {
|
|
393
|
+
const evaluation = task[key];
|
|
394
|
+
item[key] = evaluation && typeof evaluation === "object" && !Array.isArray(evaluation)
|
|
395
|
+
? Object.fromEntries(Object.entries(evaluation).filter(([name]) => ["attempt_count", "failure_count", "last_verdict"].includes(name)))
|
|
396
|
+
: null;
|
|
397
|
+
}
|
|
398
|
+
else if (key === "depends_on") {
|
|
399
|
+
item[key] = asList(task[key]).slice(0, 20);
|
|
400
|
+
}
|
|
401
|
+
else if (key === "blocked_reasons") {
|
|
402
|
+
item[key] = asList(task[key]).slice(0, 3).map((reason) => truncateCodePoints(String(reason), 160));
|
|
403
|
+
}
|
|
404
|
+
else {
|
|
405
|
+
item[key] = typeof task[key] === "string" ? truncateCodePoints(task[key], 256) : task[key];
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
return item;
|
|
409
|
+
});
|
|
410
|
+
const archived = asList(plan.archived_plans).slice(0, 10);
|
|
411
|
+
const diagnostics = asList(plan.diagnostics).slice(0, 10);
|
|
412
|
+
return {
|
|
413
|
+
exists: Boolean(plan.exists),
|
|
414
|
+
active: Boolean(plan.active),
|
|
415
|
+
status: plan.status,
|
|
416
|
+
title: plan.title ?? "",
|
|
417
|
+
complete: plan.complete ?? 0,
|
|
418
|
+
total: plan.total ?? tasks.length,
|
|
419
|
+
complete_plan: Boolean(plan.complete_plan),
|
|
420
|
+
first_pending: plan.first_pending && typeof plan.first_pending === "object" && !Array.isArray(plan.first_pending)
|
|
421
|
+
? { number: plan.first_pending.number ?? null, name: plan.first_pending.name ?? plan.first_pending.title ?? "", status: plan.first_pending.status ?? "pending" }
|
|
422
|
+
: null,
|
|
423
|
+
tasks: boundedTasks,
|
|
424
|
+
task_count: tasks.length,
|
|
425
|
+
omitted_task_count: Math.max(0, tasks.length - boundedTasks.length),
|
|
426
|
+
archived_plans: archived,
|
|
427
|
+
archive_count: plan.archive_count ?? archived.length,
|
|
428
|
+
omitted_archive_count: Math.max(0, Number(plan.archive_count ?? archived.length) - archived.length),
|
|
429
|
+
invalid_archive_paths: (plan.invalid_archive_paths ?? []).slice(0, 10),
|
|
430
|
+
diagnostics,
|
|
431
|
+
omitted_diagnostic_count: Math.max(0, (plan.diagnostics ?? []).length - diagnostics.length),
|
|
432
|
+
source_contract: {
|
|
433
|
+
detail_availability: tasks.length > boundedTasks.length ? "summary" : "full",
|
|
434
|
+
retrieval: "agentera state plan --format json",
|
|
435
|
+
raw_archive_records: false,
|
|
436
|
+
},
|
|
437
|
+
lifecycle_state: plan.lifecycle_state ?? null,
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
export function docsSummary(schemas, startupInput = {}) {
|
|
441
|
+
const info = schemas.docs;
|
|
442
|
+
if (!info) {
|
|
310
443
|
return { exists: false, status: "absent", absence_reason: "No docs mapping artifact is available from agentera docs." };
|
|
311
444
|
}
|
|
312
|
-
const
|
|
313
|
-
const mapping =
|
|
314
|
-
const index =
|
|
315
|
-
const
|
|
316
|
-
const
|
|
445
|
+
const docsPath = artifactPath(info, "docs");
|
|
446
|
+
const mapping = scanYamlCollection(docsPath, "mapping", "docs", "artifact");
|
|
447
|
+
const index = scanYamlCollection(docsPath, "index", "docs", "artifact");
|
|
448
|
+
const exists = fs.existsSync(docsPath);
|
|
449
|
+
const header = exists ? truncateCodePoints(fs.readFileSync(docsPath, "utf8"), 4096) : "";
|
|
450
|
+
const lastAudit = /^last_audit:\s*(.+)$/m.exec(header)?.[1]?.trim().replace(/^['"]|['"]$/g, "") ?? null;
|
|
317
451
|
return {
|
|
318
|
-
exists
|
|
452
|
+
exists,
|
|
319
453
|
status: "available",
|
|
320
|
-
last_audit:
|
|
321
|
-
conventions,
|
|
322
|
-
mapping,
|
|
323
|
-
mapping_entries: mapping.length,
|
|
324
|
-
coverage,
|
|
454
|
+
last_audit: lastAudit,
|
|
455
|
+
conventions: {},
|
|
456
|
+
mapping: mapping.entries.slice(0, 10).map((entry) => entry.fields),
|
|
457
|
+
mapping_entries: mapping.entries.length,
|
|
458
|
+
coverage: {},
|
|
325
459
|
source_contract: {
|
|
326
|
-
capability_startup_complete:
|
|
460
|
+
capability_startup_complete: capabilityStartupComplete(startupInput),
|
|
327
461
|
raw_artifact_reads_required: false,
|
|
328
462
|
state_families: [
|
|
329
463
|
"plan task details, dependencies, acceptance criteria, and evidence summaries",
|
|
330
464
|
"docs artifact mapping and source-contract completeness metadata",
|
|
331
|
-
"latest progress verification metadata needed for
|
|
332
|
-
"
|
|
465
|
+
"latest progress verification metadata needed for Orchestrate evaluation",
|
|
466
|
+
"Document closeout context metadata for docs/TODO/changelog/progress synchronization",
|
|
333
467
|
],
|
|
334
468
|
},
|
|
335
|
-
indexed_documents: index.length,
|
|
469
|
+
indexed_documents: index.entries.length,
|
|
336
470
|
};
|
|
337
471
|
}
|
|
338
472
|
export function progressSummary(schemas) {
|
|
339
|
-
const
|
|
340
|
-
|
|
473
|
+
const info = schemas.progress;
|
|
474
|
+
if (!info)
|
|
475
|
+
return { exists: false, status: "absent", absence_reason: "No progress cycles are available from agentera progress." };
|
|
476
|
+
const scan = scanSchemaArtifact(schemas, "progress").active;
|
|
477
|
+
const entries = scan.entries.map((entry) => entry.fields);
|
|
341
478
|
if (entries.length === 0) {
|
|
342
479
|
return { exists: false, status: "absent", absence_reason: "No progress cycles are available from agentera progress." };
|
|
343
480
|
}
|
|
344
|
-
const latest = recentCycles(entries, 1)[0];
|
|
481
|
+
const latest = recentCycles(entries, 1)[0] ?? {};
|
|
482
|
+
const latestCycle = {};
|
|
483
|
+
for (const key of ["number", "timestamp", "type", "phase", "what", "status"]) {
|
|
484
|
+
if (key in latest)
|
|
485
|
+
latestCycle[key] = latest[key];
|
|
486
|
+
}
|
|
345
487
|
return {
|
|
346
488
|
exists: true,
|
|
347
489
|
status: "available",
|
|
348
|
-
latest,
|
|
349
|
-
latest_verification: latest.
|
|
490
|
+
latest: latestCycle,
|
|
491
|
+
latest_verification: latest.verified_present ? { present: true } : null,
|
|
350
492
|
cycle_count: entries.length,
|
|
351
493
|
};
|
|
352
494
|
}
|
|
353
495
|
export function healthSummary(schemas, env = process.env) {
|
|
354
|
-
const
|
|
355
|
-
|
|
496
|
+
const info = schemas.health;
|
|
497
|
+
if (!info)
|
|
498
|
+
return { exists: false };
|
|
499
|
+
const scan = scanSchemaArtifact(schemas, "health").active;
|
|
500
|
+
const entries = scan.entries.map((entry) => entry.fields);
|
|
356
501
|
if (entries.length === 0)
|
|
357
502
|
return { exists: false };
|
|
358
|
-
const latest =
|
|
503
|
+
const latest = [...entries].sort((left, right) => Number(right.number ?? 0) - Number(left.number ?? 0))[0] ?? null;
|
|
359
504
|
if (!latest)
|
|
360
505
|
return { exists: false };
|
|
361
506
|
const grades = latest.grades && typeof latest.grades === "object" && !Array.isArray(latest.grades) ? latest.grades : {};
|
|
@@ -370,18 +515,20 @@ export function healthSummary(schemas, env = process.env) {
|
|
|
370
515
|
const trajectory = String(latest.trajectory ?? "");
|
|
371
516
|
const auditDate = healthAuditDate(latest);
|
|
372
517
|
const dateStr = auditDate !== null ? isoFromUtc(auditDate) : null;
|
|
518
|
+
const latestNumber = typeof latest.number === "string" || typeof latest.number === "number" ? latest.number : "?";
|
|
519
|
+
const latestTimestamp = typeof latest.timestamp === "string" ? latest.timestamp : null;
|
|
373
520
|
const summary = {
|
|
374
521
|
exists: true,
|
|
375
|
-
number:
|
|
522
|
+
number: latestNumber,
|
|
376
523
|
date: dateStr,
|
|
377
|
-
timestamp: dateStr ??
|
|
524
|
+
timestamp: dateStr ?? latestTimestamp,
|
|
378
525
|
trajectory,
|
|
379
526
|
grade: worst ? worst[1] : "",
|
|
380
527
|
worst,
|
|
381
528
|
degrading: ["degrading", "declining", "worse"].includes(trajectory.toLowerCase()) ||
|
|
382
529
|
(worst !== null && worst[2] >= gradeRank.D),
|
|
383
530
|
};
|
|
384
|
-
const staleness =
|
|
531
|
+
const staleness = checkAuditStaleness(schemas, latest, auditDate, env);
|
|
385
532
|
if (staleness !== null)
|
|
386
533
|
Object.assign(summary, staleness);
|
|
387
534
|
return summary;
|
|
@@ -399,7 +546,7 @@ function objectiveStatus(data) {
|
|
|
399
546
|
return String(firstPresent(header, ["status"], data.status ?? objective.status ?? "") || "").toLowerCase();
|
|
400
547
|
}
|
|
401
548
|
export function activeObjectiveSummary() {
|
|
402
|
-
const root = path.join(process.cwd(), ".agentera", "
|
|
549
|
+
const root = path.join(process.cwd(), ".agentera", "optimize");
|
|
403
550
|
let isDir = false;
|
|
404
551
|
try {
|
|
405
552
|
isDir = fs.statSync(root).isDirectory();
|
|
@@ -462,7 +609,11 @@ export function statePresence(plan, docs, progress, health, objective) {
|
|
|
462
609
|
objective: Boolean(objective.exists),
|
|
463
610
|
};
|
|
464
611
|
const absence = {};
|
|
465
|
-
for (const [name, summary] of [
|
|
612
|
+
for (const [name, summary] of [
|
|
613
|
+
["plan", plan],
|
|
614
|
+
["docs", docs],
|
|
615
|
+
["progress", progress],
|
|
616
|
+
]) {
|
|
466
617
|
if (!summary.exists && summary.absence_reason)
|
|
467
618
|
absence[name] = summary.absence_reason;
|
|
468
619
|
}
|
|
@@ -477,43 +628,48 @@ export function statePresence(plan, docs, progress, health, objective) {
|
|
|
477
628
|
}
|
|
478
629
|
// ── decisions follow-up + attention ─────────────────────────────────
|
|
479
630
|
export function decisionFollowUp(schemas) {
|
|
480
|
-
const
|
|
481
|
-
for (const rawEntry of extractEntries(data)) {
|
|
482
|
-
const entry = decisionContextEntry(rawEntry);
|
|
631
|
+
for (const entry of startupDecisionEntries(schemas)) {
|
|
483
632
|
const satisfaction = entry.satisfaction;
|
|
484
|
-
if (!satisfaction || typeof satisfaction !== "object" || !satisfaction.review_needed)
|
|
633
|
+
if (!satisfaction || typeof satisfaction !== "object" || Array.isArray(satisfaction) || !satisfaction.review_needed)
|
|
485
634
|
continue;
|
|
486
|
-
const number = entry.number
|
|
635
|
+
const number = typeof entry.number === "string" || typeof entry.number === "number" ? entry.number : "?";
|
|
487
636
|
const title = firstPresent(entry, ["question", "choice"], "decision follow-up");
|
|
488
|
-
return { object: `DECISION ${number} follow-up`, title };
|
|
637
|
+
return { object: `DECISION ${number} follow-up`, title: String(title) };
|
|
489
638
|
}
|
|
490
639
|
return null;
|
|
491
640
|
}
|
|
641
|
+
export function startupDecisionEntries(schemas) {
|
|
642
|
+
if (!schemas.decisions)
|
|
643
|
+
return [];
|
|
644
|
+
const scans = scanSchemaArtifact(schemas, "decisions");
|
|
645
|
+
return [...scans.active.entries, ...scans.archive.entries].map((candidate) => ({
|
|
646
|
+
...candidate.fields,
|
|
647
|
+
...(candidate.identity.number !== null && candidate.fields.number === undefined ? { number: candidate.identity.number } : {}),
|
|
648
|
+
}));
|
|
649
|
+
}
|
|
492
650
|
function decisionAttentionState(satisfaction) {
|
|
493
651
|
const state = satisfaction.state;
|
|
494
652
|
if (state === null || state === undefined || state === "")
|
|
495
653
|
return "missing";
|
|
496
654
|
if (state === "user_confirmed_satisfied" && satisfaction.review_needed)
|
|
497
655
|
return "unconfirmed_user_confirmed_satisfied";
|
|
498
|
-
if (["open", "provisionally_satisfied", "review_needed"].includes(state))
|
|
656
|
+
if (["open", "provisionally_satisfied", "review_needed"].includes(String(state)))
|
|
499
657
|
return String(state);
|
|
500
658
|
if (state === "user_confirmed_satisfied")
|
|
501
659
|
return "user_confirmed_satisfied";
|
|
502
660
|
return "unrecognized";
|
|
503
661
|
}
|
|
504
662
|
export function decisionReviewAttention(schemas) {
|
|
505
|
-
const data = loadNamedArtifact(schemas, "decisions");
|
|
506
663
|
const reviewEntries = [];
|
|
507
664
|
const stateCounts = {};
|
|
508
|
-
for (const
|
|
509
|
-
const entry = decisionContextEntry(rawEntry);
|
|
665
|
+
for (const entry of startupDecisionEntries(schemas)) {
|
|
510
666
|
const satisfaction = entry.satisfaction;
|
|
511
|
-
if (!satisfaction || typeof satisfaction !== "object" || !satisfaction.review_needed)
|
|
667
|
+
if (!satisfaction || typeof satisfaction !== "object" || Array.isArray(satisfaction) || !satisfaction.review_needed)
|
|
512
668
|
continue;
|
|
513
669
|
const state = decisionAttentionState(satisfaction);
|
|
514
670
|
stateCounts[state] = (stateCounts[state] ?? 0) + 1;
|
|
515
671
|
reviewEntries.push({
|
|
516
|
-
number: entry.number
|
|
672
|
+
number: typeof entry.number === "string" || typeof entry.number === "number" ? entry.number : "?",
|
|
517
673
|
title: truncate(firstPresent(entry, ["question", "choice", "summary"], "decision review"), 80),
|
|
518
674
|
state,
|
|
519
675
|
source: satisfaction.source ?? null,
|
|
@@ -541,55 +697,91 @@ export function decisionReviewAttention(schemas) {
|
|
|
541
697
|
}
|
|
542
698
|
export function formatNextAction(action) {
|
|
543
699
|
if (!action)
|
|
544
|
-
return "object=VISION refresh | capability=
|
|
545
|
-
|
|
700
|
+
return "object=VISION refresh | capability=vision | reason=no executable follow-up | phase=envision";
|
|
701
|
+
const phase = "phase" in action && action.phase ? ` | phase=${action.phase}` : "";
|
|
702
|
+
return `object=${truncate(action.object)} | capability=${action.capability} | reason=${action.reason}${phase}`;
|
|
546
703
|
}
|
|
547
|
-
|
|
704
|
+
/**
|
|
705
|
+
* Evolved state-readiness hint (Decision 76). Evaluates every cascade branch
|
|
706
|
+
* (no early-return); each candidate carries a protocol.yaml phase tag (PH1
|
|
707
|
+
* envision → PH5 audit). Position 1 (`recommended`) is the branch that would
|
|
708
|
+
* have won under the legacy early-return cascade.
|
|
709
|
+
*/
|
|
710
|
+
export function selectStatusReadiness(plan, health, objective, todoItems, decision, savedContext) {
|
|
711
|
+
const candidates = [];
|
|
548
712
|
const pending = plan.first_pending;
|
|
549
713
|
if (pending && typeof pending === "object" && !Array.isArray(pending)) {
|
|
550
714
|
const number = pending.number ?? "?";
|
|
551
715
|
const title = firstPresent(pending, ["name", "title"], "pending task");
|
|
552
|
-
|
|
716
|
+
candidates.push({
|
|
717
|
+
object: `PLAN Task ${number}: ${title}`,
|
|
718
|
+
capability: "orchestrate",
|
|
719
|
+
reason: "first pending plan task",
|
|
720
|
+
phase: "build",
|
|
721
|
+
});
|
|
553
722
|
}
|
|
554
723
|
if (health.degrading) {
|
|
555
724
|
const worst = health.worst;
|
|
556
725
|
const target = worst ? `${worst[0]}:${worst[1]}` : "degrading health";
|
|
557
|
-
|
|
726
|
+
candidates.push({
|
|
727
|
+
object: `HEALTH: ${target}`,
|
|
728
|
+
capability: "audit",
|
|
729
|
+
reason: "critical or degrading health",
|
|
730
|
+
phase: "audit",
|
|
731
|
+
});
|
|
558
732
|
}
|
|
559
733
|
if (objective.active) {
|
|
560
|
-
|
|
734
|
+
candidates.push({
|
|
561
735
|
object: `OBJECTIVE: ${objective.metric || objective.title}`,
|
|
562
|
-
capability: "
|
|
736
|
+
capability: "optimize",
|
|
563
737
|
reason: "active non-closed objective",
|
|
564
|
-
|
|
738
|
+
phase: "build",
|
|
739
|
+
});
|
|
565
740
|
}
|
|
566
741
|
if (todoItems.length > 0) {
|
|
567
742
|
const item = [...todoItems].sort((a, b) => (TODO_SEVERITY_ORDER[a.severity] ?? 2) - (TODO_SEVERITY_ORDER[b.severity] ?? 2))[0];
|
|
568
|
-
if (
|
|
569
|
-
|
|
743
|
+
if (todoNeedsPlan(item)) {
|
|
744
|
+
candidates.push({ object: `TODO: ${item.text}`, capability: "plan", reason: "complex TODO needs planning", phase: "plan" });
|
|
745
|
+
}
|
|
746
|
+
else {
|
|
747
|
+
candidates.push({ object: `TODO: ${item.text}`, capability: "build", reason: "highest-priority open TODO", phase: "build" });
|
|
570
748
|
}
|
|
571
|
-
return { object: `TODO: ${item.text}`, capability: "realisera", reason: "highest-priority open TODO" };
|
|
572
749
|
}
|
|
573
750
|
if (health.stale && !health.degrading) {
|
|
574
|
-
|
|
751
|
+
candidates.push({
|
|
575
752
|
object: `HEALTH: Audit ${health.number ?? "?"} stale`,
|
|
576
|
-
capability: "
|
|
753
|
+
capability: "audit",
|
|
577
754
|
reason: "stale health audit",
|
|
578
|
-
|
|
755
|
+
phase: "audit",
|
|
756
|
+
});
|
|
579
757
|
}
|
|
580
758
|
if (decision) {
|
|
581
|
-
|
|
759
|
+
candidates.push({
|
|
760
|
+
object: String(decision.object),
|
|
761
|
+
capability: "discuss",
|
|
762
|
+
reason: "unresolved decision follow-up",
|
|
763
|
+
phase: "deliberate",
|
|
764
|
+
});
|
|
582
765
|
}
|
|
583
766
|
const visionExists = fs.existsSync(path.join(process.cwd(), ".agentera", "vision.yaml"));
|
|
584
|
-
if (plan.exists && !plan.complete_plan) {
|
|
585
|
-
|
|
767
|
+
if ((plan.exists && !plan.complete_plan) || visionExists) {
|
|
768
|
+
candidates.push({ object: "VISION refresh", capability: "plan", reason: "no executable follow-up", phase: "envision" });
|
|
586
769
|
}
|
|
587
|
-
if (visionExists) {
|
|
588
|
-
|
|
770
|
+
if (savedContext && !visionExists) {
|
|
771
|
+
candidates.push({ object: "Direction clarification", capability: "discuss", reason: "saved context without vision", phase: "envision" });
|
|
589
772
|
}
|
|
590
|
-
|
|
591
|
-
|
|
773
|
+
candidates.push({ object: "VISION refresh", capability: "vision", reason: "fresh project direction", phase: "envision" });
|
|
774
|
+
// Guarantee at least one alternative so the hint never collapses to a single entry.
|
|
775
|
+
if (candidates.length < 2) {
|
|
776
|
+
candidates.push({ object: "Direction clarification", capability: "discuss", reason: "clarify project direction", phase: "envision" });
|
|
592
777
|
}
|
|
593
|
-
|
|
778
|
+
const [recommended, ...alternatives] = candidates;
|
|
779
|
+
return { recommended, alternatives };
|
|
780
|
+
}
|
|
781
|
+
/** Legacy single-entry projection of {@link selectStatusReadiness}: the
|
|
782
|
+
* top-priority candidate as `{object, capability, reason}` (no `phase`). */
|
|
783
|
+
export function selectStatusNextAction(plan, health, objective, todoItems, decision, savedContext) {
|
|
784
|
+
const { recommended } = selectStatusReadiness(plan, health, objective, todoItems, decision, savedContext);
|
|
785
|
+
return { object: recommended.object, capability: recommended.capability, reason: recommended.reason };
|
|
594
786
|
}
|
|
595
787
|
//# sourceMappingURL=orientation.js.map
|