agentera 3.0.0-dev.5 → 3.0.0-dev.7
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 +4 -3
- package/bundle/extract-corpus-parity.json +23 -0
- package/bundle/references/adapters/cursor.md +10 -9
- package/bundle/references/adapters/opencode.md +26 -26
- package/bundle/references/adapters/package-registry.yaml +0 -1
- package/bundle/references/adapters/package-surface-characterization.md +1 -2
- package/bundle/references/adapters/runtime-adapter-characterization.md +1 -1
- package/bundle/references/adapters/runtime-adapter-registry.yaml +16 -10
- package/bundle/references/adapters/runtime-feature-parity.md +2 -2
- package/bundle/references/analysis/benchmark.md +1 -1
- package/bundle/references/analysis/startup-measurement-contract.yaml +18 -18
- package/bundle/references/artifacts/artifact-registry-interface-model.yaml +4 -3
- package/bundle/references/cli/agent-ready-state-contract.yaml +6 -6
- 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 +1 -29
- 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 +6 -6
- package/bundle/references/cli/routing-model.md +96 -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 +16 -0
- 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 +17 -12
- package/bundle/references/cli/vocabulary.md +316 -309
- package/bundle/references/meta/documentation-inventory.md +9 -3
- package/bundle/registry.json +13 -13
- package/bundle/skills/agentera/.claude-plugin/plugin.json +13 -13
- package/bundle/skills/agentera/SKILL.md +99 -415
- 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/{planera.toml → discuss.toml} +3 -3
- package/bundle/skills/agentera/agents/{resonera.toml → document.toml} +3 -3
- package/bundle/skills/agentera/agents/{optimera.toml → optimize.toml} +2 -2
- 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/triggers.yaml +15 -6
- package/bundle/skills/agentera/capabilities/{inspektera → audit}/schemas/validation.yaml +9 -9
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/artifacts.yaml +11 -11
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/triggers.yaml +13 -3
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/validation.yaml +7 -7
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/artifacts.yaml +6 -6
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/triggers.yaml +15 -3
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/validation.yaml +5 -5
- package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/artifacts.yaml +6 -6
- package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/triggers.yaml +11 -3
- package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/validation.yaml +4 -4
- package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/artifacts.yaml +10 -10
- package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/triggers.yaml +14 -3
- package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/validation.yaml +8 -8
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/artifacts.yaml +8 -8
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/triggers.yaml +11 -3
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/validation.yaml +7 -7
- package/bundle/skills/agentera/capabilities/{orkestrera → orchestrate}/schemas/artifacts.yaml +10 -10
- package/bundle/skills/agentera/capabilities/{orkestrera → orchestrate}/schemas/triggers.yaml +16 -3
- package/bundle/skills/agentera/capabilities/{orkestrera → orchestrate}/schemas/validation.yaml +27 -27
- package/bundle/skills/agentera/capabilities/{planera → plan}/schemas/artifacts.yaml +8 -8
- 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/{planera → plan}/schemas/validation.yaml +3 -3
- package/bundle/skills/agentera/capabilities/{profilera → profile}/schemas/artifacts.yaml +2 -2
- package/bundle/skills/agentera/capabilities/{profilera → profile}/schemas/exit.yaml +2 -1
- 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/{inspirera → research}/schemas/artifacts.yaml +5 -5
- 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 +10 -4
- 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/triggers.yaml +17 -3
- package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/validation.yaml +7 -7
- package/bundle/skills/agentera/capability_schema_contract.yaml +178 -34
- package/bundle/skills/agentera/protocol.yaml +29 -29
- package/bundle/skills/agentera/references/contract.md +328 -319
- package/bundle/skills/agentera/schemas/artifacts/changelog.yaml +4 -4
- package/bundle/skills/agentera/schemas/artifacts/decisions.yaml +9 -9
- 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 +5 -5
- package/bundle/skills/agentera/schemas/artifacts/progress.yaml +5 -5
- package/bundle/skills/agentera/schemas/artifacts/todo.yaml +40 -35
- package/bundle/skills/agentera/schemas/artifacts/vision.yaml +3 -3
- package/dist/analytics/extractCorpus/cli.js +149 -0
- package/dist/analytics/extractCorpus/cli.js.map +1 -0
- package/dist/analytics/extractCorpus/copilotSessions.js +273 -0
- package/dist/analytics/extractCorpus/copilotSessions.js.map +1 -0
- package/dist/analytics/extractCorpus/core.js +364 -0
- package/dist/analytics/extractCorpus/core.js.map +1 -0
- package/dist/analytics/extractCorpus/corpus.js +145 -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 +423 -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 +122 -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 +185 -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 +20 -20
- package/dist/analytics/usageStats.js.map +1 -1
- package/dist/capabilities/audit/instructions.js +6 -0
- package/dist/capabilities/audit/instructions.js.map +1 -0
- package/dist/capabilities/build/instructions.js +6 -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 +6 -0
- package/dist/capabilities/document/instructions.js.map +1 -0
- package/dist/capabilities/index.js +24 -24
- package/dist/capabilities/index.js.map +1 -1
- package/dist/capabilities/inspirera/instructions.js +1 -1
- package/dist/capabilities/inspirera/instructions.js.map +1 -1
- package/dist/capabilities/optimize/instructions.js +6 -0
- package/dist/capabilities/optimize/instructions.js.map +1 -0
- package/dist/capabilities/orchestrate/instructions.js +6 -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/planera/instructions.js +1 -1
- package/dist/capabilities/planera/instructions.js.map +1 -1
- package/dist/capabilities/profile/instructions.js +6 -0
- package/dist/capabilities/profile/instructions.js.map +1 -0
- package/dist/capabilities/profilera/instructions.js +1 -1
- package/dist/capabilities/profilera/instructions.js.map +1 -1
- package/dist/capabilities/realisera/instructions.js +1 -1
- package/dist/capabilities/realisera/instructions.js.map +1 -1
- package/dist/capabilities/research/instructions.js +6 -0
- package/dist/capabilities/research/instructions.js.map +1 -0
- package/dist/capabilities/resonera/instructions.js +1 -1
- package/dist/capabilities/resonera/instructions.js.map +1 -1
- package/dist/capabilities/status/instructions.js +6 -0
- package/dist/capabilities/status/instructions.js.map +1 -0
- package/dist/capabilities/vision/instructions.js +6 -0
- package/dist/capabilities/vision/instructions.js.map +1 -0
- package/dist/capabilities/visionera/instructions.js +1 -1
- package/dist/capabilities/visionera/instructions.js.map +1 -1
- package/dist/capabilities/visualisera/instructions.js +3 -4
- package/dist/capabilities/visualisera/instructions.js.map +1 -1
- 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 +177 -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 +188 -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 +107 -0
- package/dist/cli/capabilityContext/orchestration.js.map +1 -0
- package/dist/cli/capabilityContext/planState.js +271 -0
- package/dist/cli/capabilityContext/planState.js.map +1 -0
- package/dist/cli/capabilityContext/progress.js +103 -0
- package/dist/cli/capabilityContext/progress.js.map +1 -0
- package/dist/cli/capabilityContext/realisera.js +174 -0
- package/dist/cli/capabilityContext/realisera.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 +213 -0
- package/dist/cli/capabilityContext/startup.js.map +1 -0
- package/dist/cli/capabilityContext/types.js +40 -0
- package/dist/cli/capabilityContext/types.js.map +1 -0
- package/dist/cli/capabilityContext.js +1 -2486
- 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 +84 -0
- package/dist/cli/commands/backfill.js.map +1 -0
- package/dist/cli/commands/capability.js +2 -2
- 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 +17 -98
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/lint.js +4 -36
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/prime/bundleStatus.js +140 -0
- package/dist/cli/commands/prime/bundleStatus.js.map +1 -0
- package/dist/cli/commands/prime/collectOrientationState.js +156 -0
- package/dist/cli/commands/prime/collectOrientationState.js.map +1 -0
- package/dist/cli/commands/prime/orientationOutput.js +210 -0
- package/dist/cli/commands/prime/orientationOutput.js.map +1 -0
- package/dist/cli/commands/prime/routeOutput.js +50 -0
- package/dist/cli/commands/prime/routeOutput.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 -554
- 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 +27 -10
- package/dist/cli/commands/report.js.map +1 -1
- package/dist/cli/commands/schema.js +24 -20
- 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 +173 -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.js +7 -7
- package/dist/cli/commands/state.js.map +1 -1
- package/dist/cli/commands/validate.js +50 -100
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/commands/verify.js +1 -1
- 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 +182 -0
- package/dist/cli/dispatch/index.js.map +1 -0
- package/dist/cli/dispatch/lifecycle.js +597 -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 +144 -0
- package/dist/cli/dispatch/state.js.map +1 -0
- package/dist/cli/dispatch.js +1 -1293
- package/dist/cli/dispatch.js.map +1 -1
- package/dist/cli/help.js +41 -8
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/orientation/attention.js +61 -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 +129 -78
- package/dist/cli/orientation.js.map +1 -1
- package/dist/cli/prime-blob.js +1 -1
- package/dist/cli/startupCompletenessContract.js +56 -0
- package/dist/cli/startupCompletenessContract.js.map +1 -0
- package/dist/cli/stateQuery.js +9 -2
- package/dist/cli/stateQuery.js.map +1 -1
- package/dist/cli/todoSeverity.js +19 -0
- package/dist/cli/todoSeverity.js.map +1 -0
- package/dist/core/envPaths.js +21 -0
- package/dist/core/envPaths.js.map +1 -0
- package/dist/core/git.js +43 -0
- package/dist/core/git.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/eval/evalSkills.js +17 -12
- 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 +8 -23
- 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 +199 -0
- package/dist/hooks/compaction/retention.js.map +1 -0
- package/dist/hooks/compaction/status.js +241 -0
- package/dist/hooks/compaction/status.js.map +1 -0
- package/dist/hooks/compaction/todoResolved.js +137 -0
- package/dist/hooks/compaction/todoResolved.js.map +1 -0
- package/dist/hooks/compaction/types.js +6 -0
- package/dist/hooks/compaction/types.js.map +1 -0
- package/dist/hooks/compaction.js +20 -20
- package/dist/hooks/compaction.js.map +1 -1
- 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 +6 -12
- package/dist/hooks/sessionStop.js.map +1 -1
- package/dist/hooks/todoLayout.js +177 -0
- package/dist/hooks/todoLayout.js.map +1 -0
- 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 +459 -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 +105 -0
- package/dist/hooks/validateArtifact/violations.js.map +1 -0
- package/dist/hooks/validateArtifact.js +29 -40
- package/dist/hooks/validateArtifact.js.map +1 -1
- package/dist/migrate/v2HandoffManifest.js +447 -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 +23 -9
- package/dist/registries/artifactRegistry.js.map +1 -1
- package/dist/registries/capabilityContract.js +144 -1
- package/dist/registries/capabilityContract.js.map +1 -1
- package/dist/registries/evaluatorHandoffContract.js +2 -2
- package/dist/registries/evaluatorHandoffContract.js.map +1 -1
- package/dist/registries/packageRegistry.js +4 -3
- package/dist/registries/packageRegistry.js.map +1 -1
- package/dist/registries/runtimeAdapterRegistry.js +5 -4
- 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/routing/index.js +2 -0
- package/dist/routing/index.js.map +1 -0
- package/dist/routing/routeEngine.js +189 -0
- package/dist/routing/routeEngine.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 -1196
- package/dist/setup/codex.js.map +1 -1
- package/dist/setup/cursor.js +6 -4
- 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 +300 -0
- package/dist/setup/doctor/core.js.map +1 -0
- package/dist/setup/doctor/diagnostics.js +240 -0
- package/dist/setup/doctor/diagnostics.js.map +1 -0
- package/dist/setup/doctor/opencode.js +313 -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 -1296
- 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/smokeChecks.js +11 -11
- package/dist/setup/smokeChecks.js.map +1 -1
- package/dist/state/installRoot.js +49 -18
- package/dist/state/installRoot.js.map +1 -1
- package/dist/state/progressCommit.js +289 -0
- package/dist/state/progressCommit.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/upgrade/appContentRefresh.js +342 -0
- package/dist/upgrade/appContentRefresh.js.map +1 -0
- package/dist/upgrade/appModel.js +8 -6
- package/dist/upgrade/appModel.js.map +1 -1
- package/dist/upgrade/bundleEvidence.js +34 -0
- package/dist/upgrade/bundleEvidence.js.map +1 -0
- package/dist/upgrade/channels.js +11 -4
- package/dist/upgrade/channels.js.map +1 -1
- package/dist/upgrade/cliProbe.js +22 -0
- package/dist/upgrade/cliProbe.js.map +1 -0
- package/dist/upgrade/coexistenceProbe.js +107 -0
- package/dist/upgrade/coexistenceProbe.js.map +1 -0
- package/dist/upgrade/compatibility.js +13 -4
- package/dist/upgrade/compatibility.js.map +1 -1
- package/dist/upgrade/doctor.js +165 -183
- package/dist/upgrade/doctor.js.map +1 -1
- package/dist/upgrade/doctorClassifier.js +177 -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 +116 -0
- package/dist/upgrade/legacyAgentCleanup.js.map +1 -0
- package/dist/upgrade/migrateArtifactsV2ToV3.js +57 -109
- package/dist/upgrade/migrateArtifactsV2ToV3.js.map +1 -1
- package/dist/upgrade/nextMajorDoctor.js +42 -7
- package/dist/upgrade/nextMajorDoctor.js.map +1 -1
- package/dist/upgrade/npxPlatformStatus.js +23 -0
- package/dist/upgrade/npxPlatformStatus.js.map +1 -0
- package/dist/upgrade/projectIntegration.js +69 -73
- package/dist/upgrade/projectIntegration.js.map +1 -1
- package/dist/upgrade/projectIntegrationDecision.js +93 -0
- package/dist/upgrade/projectIntegrationDecision.js.map +1 -0
- package/dist/upgrade/runtimeMigration.js +169 -68
- package/dist/upgrade/runtimeMigration.js.map +1 -1
- package/dist/upgrade/v3CapabilitySurface.js +15 -0
- package/dist/upgrade/v3CapabilitySurface.js.map +1 -0
- package/dist/upgrade/versionResolution.js +8 -0
- package/dist/upgrade/versionResolution.js.map +1 -1
- package/dist/validate/appHomeContract.js +4 -4
- package/dist/validate/appHomeContract.js.map +1 -1
- package/dist/validate/capability.js +124 -11
- 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 +488 -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 +13 -723
- package/dist/validate/lifecycleAdapters.js.map +1 -1
- package/dist/validate/selfAudit.js +62 -20
- 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 +27 -24
- package/bundle/references/v1-section-mapping.md +0 -47
- 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/orkestrera.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/visionera.toml +0 -6
- package/bundle/skills/agentera/agents/visualisera.toml +0 -6
- 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/bundle/skills/agentera/capabilities/{inspektera → audit}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{orkestrera → orchestrate}/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/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/exit.yaml +0 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import { ancestorState } from "../core/git.js";
|
|
2
|
+
import { loadYamlMapping } from "../core/yaml.js";
|
|
3
|
+
/**
|
|
4
|
+
* Shared progress-commit and git-ancestry logic. Faithful TS port of
|
|
5
|
+
* `scripts/progress_commit.py`.
|
|
6
|
+
*/
|
|
7
|
+
export const COMMIT_HASH_RE = /^[0-9a-fA-F]{7,40}$/;
|
|
8
|
+
/**
|
|
9
|
+
* Leading verifiable git hash in a cycle `commit` value, else `null`. `pending`,
|
|
10
|
+
* `N/A …` and non-hash free text are exempt; non-string values return `null`.
|
|
11
|
+
*/
|
|
12
|
+
export function commitToken(value) {
|
|
13
|
+
if (typeof value !== "string") {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const text = value.trim();
|
|
17
|
+
if (!text) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
const token = text.split(/\s+/)[0];
|
|
21
|
+
const low = token.toLowerCase();
|
|
22
|
+
if (low === "pending" || low.startsWith("n/a")) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
return COMMIT_HASH_RE.test(token) ? token : null;
|
|
26
|
+
}
|
|
27
|
+
function changeHas(changes, key) {
|
|
28
|
+
return changes instanceof Map ? changes.has(key) : Object.prototype.hasOwnProperty.call(changes, key);
|
|
29
|
+
}
|
|
30
|
+
function changeGet(changes, key) {
|
|
31
|
+
return changes instanceof Map ? changes.get(key) : changes[key];
|
|
32
|
+
}
|
|
33
|
+
function changeSize(changes) {
|
|
34
|
+
return changes instanceof Map ? changes.size : Object.keys(changes).length;
|
|
35
|
+
}
|
|
36
|
+
function splitKeepEnds(text) {
|
|
37
|
+
const matches = text.match(/[^\n]*\n|[^\n]+/g);
|
|
38
|
+
return matches ?? [];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Replace the `commit:` field of specific cycles, preserving the rest. `changes`
|
|
42
|
+
* maps cycle number to the new `commit` value. Multi-line commit scalars are
|
|
43
|
+
* replaced wholesale, dropping their continuation lines.
|
|
44
|
+
*/
|
|
45
|
+
export function rewriteCycleCommits(text, changes) {
|
|
46
|
+
if (changeSize(changes) === 0) {
|
|
47
|
+
return text;
|
|
48
|
+
}
|
|
49
|
+
const numberRe = /^-\s+number:\s*(\d+)\s*$/;
|
|
50
|
+
const listItemRe = /^-\s/;
|
|
51
|
+
const commitRe = /^(\s+)commit:\s*.*$/;
|
|
52
|
+
const topKeyRe = /^[A-Za-z_]/;
|
|
53
|
+
const lines = splitKeepEnds(text);
|
|
54
|
+
const out = [];
|
|
55
|
+
let inCycles = false;
|
|
56
|
+
let current = null;
|
|
57
|
+
let i = 0;
|
|
58
|
+
const total = lines.length;
|
|
59
|
+
while (i < total) {
|
|
60
|
+
const line = lines[i];
|
|
61
|
+
const body = line.endsWith("\n") ? line.slice(0, -1) : line;
|
|
62
|
+
if (topKeyRe.test(body)) {
|
|
63
|
+
inCycles = body.startsWith("cycles:");
|
|
64
|
+
current = null;
|
|
65
|
+
out.push(line);
|
|
66
|
+
i += 1;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (inCycles) {
|
|
70
|
+
const numberMatch = numberRe.exec(body);
|
|
71
|
+
if (numberMatch) {
|
|
72
|
+
current = parseInt(numberMatch[1], 10);
|
|
73
|
+
out.push(line);
|
|
74
|
+
i += 1;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
if (listItemRe.test(body)) {
|
|
78
|
+
current = null;
|
|
79
|
+
out.push(line);
|
|
80
|
+
i += 1;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
const commitMatch = commitRe.exec(body);
|
|
84
|
+
if (commitMatch && current !== null && changeHas(changes, current)) {
|
|
85
|
+
const indent = commitMatch[1];
|
|
86
|
+
const keyIndent = indent.length;
|
|
87
|
+
const newline = line.endsWith("\n") ? "\n" : "";
|
|
88
|
+
out.push(`${indent}commit: "${changeGet(changes, current)}"${newline}`);
|
|
89
|
+
i += 1;
|
|
90
|
+
while (i < total) {
|
|
91
|
+
const cont = lines[i].endsWith("\n") ? lines[i].slice(0, -1) : lines[i];
|
|
92
|
+
if (!cont.trim()) {
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
const leading = (cont.match(/^ */)?.[0].length) ?? 0;
|
|
96
|
+
if (leading > keyIndent && !listItemRe.test(cont)) {
|
|
97
|
+
i += 1;
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
current = null;
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
out.push(line);
|
|
107
|
+
i += 1;
|
|
108
|
+
}
|
|
109
|
+
return out.join("");
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Classify progress cycle commits and decide the backfill outcome. Pure with
|
|
113
|
+
* respect to the artifact: parses `text` and inspects git ancestry but never
|
|
114
|
+
* reads or writes the progress file.
|
|
115
|
+
*/
|
|
116
|
+
export function computeBackfill(text, options = {}) {
|
|
117
|
+
const mode = options.mode ?? "check";
|
|
118
|
+
const targetCommit = options.targetCommit ?? null;
|
|
119
|
+
let targetCycle = options.targetCycle ?? null;
|
|
120
|
+
const cwd = options.cwd ?? ".";
|
|
121
|
+
let data;
|
|
122
|
+
try {
|
|
123
|
+
data = loadYamlMapping(text);
|
|
124
|
+
}
|
|
125
|
+
catch (exc) {
|
|
126
|
+
return {
|
|
127
|
+
status: "error",
|
|
128
|
+
exitCode: 2,
|
|
129
|
+
operations: [],
|
|
130
|
+
changes: [],
|
|
131
|
+
message: `cannot parse progress artifact: ${exc.message}`,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
const cyclesRaw = data && typeof data === "object" ? data.cycles : null;
|
|
135
|
+
if (!Array.isArray(cyclesRaw)) {
|
|
136
|
+
return {
|
|
137
|
+
status: "noop",
|
|
138
|
+
exitCode: 0,
|
|
139
|
+
operations: [],
|
|
140
|
+
changes: [],
|
|
141
|
+
message: "progress artifact has no cycles list",
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
if (ancestorState("HEAD", cwd) === "unavailable") {
|
|
145
|
+
return {
|
|
146
|
+
status: "noop",
|
|
147
|
+
exitCode: 0,
|
|
148
|
+
operations: [],
|
|
149
|
+
changes: [],
|
|
150
|
+
message: "git HEAD unavailable; cannot verify commit ancestry",
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
const fullCycles = [];
|
|
154
|
+
for (const c of cyclesRaw) {
|
|
155
|
+
if (c && typeof c === "object" && !Array.isArray(c)) {
|
|
156
|
+
const num = c.number;
|
|
157
|
+
if (typeof num === "number" && Number.isInteger(num)) {
|
|
158
|
+
fullCycles.push([num, c.commit]);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
let targetToken = null;
|
|
163
|
+
if (targetCommit) {
|
|
164
|
+
const trimmed = targetCommit.trim();
|
|
165
|
+
targetToken = trimmed ? trimmed.split(/\s+/)[0] : "";
|
|
166
|
+
const state = targetToken ? ancestorState(targetToken, cwd) : "unknown";
|
|
167
|
+
if (state !== "ancestor") {
|
|
168
|
+
return {
|
|
169
|
+
status: "error",
|
|
170
|
+
exitCode: 2,
|
|
171
|
+
operations: [],
|
|
172
|
+
changes: [],
|
|
173
|
+
message: `refusing to backfill commit '${targetCommit}': it is ${state} relative to HEAD. ` +
|
|
174
|
+
"Backfill only a commit already in HEAD's history; commit the product change first, " +
|
|
175
|
+
"then backfill from a later commit (never amend to backfill).",
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
const known = new Set(fullCycles.map(([n]) => n));
|
|
179
|
+
if (targetCycle !== null && !known.has(targetCycle)) {
|
|
180
|
+
return {
|
|
181
|
+
status: "error",
|
|
182
|
+
exitCode: 2,
|
|
183
|
+
operations: [],
|
|
184
|
+
changes: [],
|
|
185
|
+
message: `cycle ${targetCycle} not found in progress cycles`,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
if (targetCycle === null) {
|
|
189
|
+
targetCycle =
|
|
190
|
+
fullCycles.find(([, cv]) => {
|
|
191
|
+
const tok = commitToken(cv);
|
|
192
|
+
return tok === null || ancestorState(tok ?? "", cwd) === "stale";
|
|
193
|
+
})?.[0] ?? null;
|
|
194
|
+
}
|
|
195
|
+
if (targetCycle === null) {
|
|
196
|
+
return {
|
|
197
|
+
status: "noop",
|
|
198
|
+
exitCode: 0,
|
|
199
|
+
operations: [],
|
|
200
|
+
changes: [],
|
|
201
|
+
message: "no pending or stale cycle to backfill; pass --cycle N to target one",
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
const changes = new Map();
|
|
206
|
+
const operations = [];
|
|
207
|
+
for (const [number, commitValue] of fullCycles) {
|
|
208
|
+
if (number === targetCycle && targetToken) {
|
|
209
|
+
let action = "set-commit";
|
|
210
|
+
let state = "ancestor";
|
|
211
|
+
if (commitToken(commitValue) === targetToken) {
|
|
212
|
+
action = "none";
|
|
213
|
+
state = "ancestor";
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
changes.set(number, targetToken);
|
|
217
|
+
}
|
|
218
|
+
operations.push({ cycle: number, commit: targetToken, state, action });
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
const token = commitToken(commitValue);
|
|
222
|
+
if (token === null) {
|
|
223
|
+
operations.push({ cycle: number, commit: commitValue, state: "exempt", action: "none" });
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
const state = ancestorState(token, cwd);
|
|
227
|
+
if (state === "stale") {
|
|
228
|
+
changes.set(number, "pending");
|
|
229
|
+
operations.push({ cycle: number, commit: token, state: "stale", action: "reset-to-pending" });
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
operations.push({ cycle: number, commit: token, state, action: "none" });
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
const sortedChanges = [...changes.entries()].sort((a, b) => b[0] - a[0]);
|
|
236
|
+
if (changes.size === 0) {
|
|
237
|
+
return { status: "clean", exitCode: 0, operations, changes: sortedChanges, message: null };
|
|
238
|
+
}
|
|
239
|
+
if (mode === "fix") {
|
|
240
|
+
return { status: "fixed", exitCode: 0, operations, changes: sortedChanges, message: null };
|
|
241
|
+
}
|
|
242
|
+
return { status: "action-needed", exitCode: 1, operations, changes: sortedChanges, message: null };
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Flag progress cycle `commit` hashes that are not ancestors of HEAD. Faithful
|
|
246
|
+
* port of progress_commit.validate_progress_commits.
|
|
247
|
+
*/
|
|
248
|
+
export function validateProgressCommits(content, cwd = ".") {
|
|
249
|
+
let data;
|
|
250
|
+
try {
|
|
251
|
+
data = loadYamlMapping(content);
|
|
252
|
+
}
|
|
253
|
+
catch {
|
|
254
|
+
return [];
|
|
255
|
+
}
|
|
256
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) {
|
|
257
|
+
return [];
|
|
258
|
+
}
|
|
259
|
+
const cycles = data.cycles;
|
|
260
|
+
if (!Array.isArray(cycles)) {
|
|
261
|
+
return [];
|
|
262
|
+
}
|
|
263
|
+
if (ancestorState("HEAD", cwd) === "unavailable") {
|
|
264
|
+
return [];
|
|
265
|
+
}
|
|
266
|
+
const violations = [];
|
|
267
|
+
for (const entry of cycles) {
|
|
268
|
+
if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
const raw = entry.commit;
|
|
272
|
+
if (typeof raw !== "string") {
|
|
273
|
+
continue;
|
|
274
|
+
}
|
|
275
|
+
const token = commitToken(raw);
|
|
276
|
+
if (token === null) {
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
279
|
+
if (ancestorState(token, cwd) === "stale") {
|
|
280
|
+
const number = entry.number ?? "?";
|
|
281
|
+
violations.push(`progress: cycle ${number} commit '${token}' is not an ancestor of HEAD ` +
|
|
282
|
+
"(stale or self-referential); set it to `pending` or run " +
|
|
283
|
+
"`agentera check backfill --mode fix`, then forward-fill the product commit " +
|
|
284
|
+
"(never amend to backfill)");
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return violations;
|
|
288
|
+
}
|
|
289
|
+
//# sourceMappingURL=progressCommit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progressCommit.js","sourceRoot":"","sources":["../../src/state/progressCommit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;GAGG;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAEpD;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC1B,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IAChC,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI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OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAChE,SAAS;QACX,CAAC;QACD,MAAM,GAAG,GAAI,KAAiC,CAAC,MAAM,CAAC;QACtD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC5B,SAAS;QACX,CAAC;QACD,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,SAAS;QACX,CAAC;QACD,IAAI,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,OAAO,EAAE,CAAC;YAC1C,MAAM,MAAM,GAAI,KAAiC,CAAC,MAAM,IAAI,GAAG,CAAC;YAChE,UAAU,CAAC,IAAI,CACb,mBAAmB,MAAM,YAAY,KAAK,+BAA+B;gBACvE,0DAA0D;gBAC1D,6EAA6E;gBAC7E,2BAA2B,CAC9B,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { spawnSync as _spawnSync } from "node:child_process";
|
|
4
|
+
import { pyJsonIndent } from "../../core/pyjson.js";
|
|
5
|
+
import { loadTomlFile } from "../../core/toml.js";
|
|
6
|
+
import { resolveSourceRoot } from "../../core/sourceRoot.js";
|
|
7
|
+
import { loadContract, parseTimestamp, formatTimestamp } from "./contract.js";
|
|
8
|
+
import { inc, counterDict, safeInt, pyJsonDumps } from "./helpers.js";
|
|
9
|
+
import { boundedRuntimeStatus } from "./threshold.js";
|
|
10
|
+
import { classifyStartupRecords } from "./records.js";
|
|
11
|
+
import { renderStartupReport } from "./report.js";
|
|
12
|
+
export const STARTUP_INTERMEDIATE_ENVELOPE = "startup_state_analysis_v1";
|
|
13
|
+
export const BENCHMARK_HISTORY_JSONL = "runs.jsonl";
|
|
14
|
+
export const BENCHMARK_LATEST_REPORT_JSON = "latest-report.json";
|
|
15
|
+
export const BENCHMARK_LATEST_REPORT_MARKDOWN = "latest-report.md";
|
|
16
|
+
const TOKEN_AGGREGATE_FIELDS = new Set([
|
|
17
|
+
"token_estimator_version",
|
|
18
|
+
"estimated_raw_after_cli_tokens",
|
|
19
|
+
"estimated_redundant_raw_tokens",
|
|
20
|
+
"estimated_raw_after_cli_tokens_by_artifact",
|
|
21
|
+
"estimated_redundant_raw_tokens_by_artifact",
|
|
22
|
+
]);
|
|
23
|
+
function maxRecordTimestamp(records, after = null) {
|
|
24
|
+
let latest = null;
|
|
25
|
+
for (const record of records) {
|
|
26
|
+
if (!record || typeof record !== "object" || Array.isArray(record))
|
|
27
|
+
continue;
|
|
28
|
+
const ts = parseTimestamp(record.timestamp);
|
|
29
|
+
if (ts === null)
|
|
30
|
+
continue;
|
|
31
|
+
if (after !== null && ts.getTime() <= after.getTime())
|
|
32
|
+
continue;
|
|
33
|
+
if (latest === null || ts.getTime() > latest.getTime())
|
|
34
|
+
latest = ts;
|
|
35
|
+
}
|
|
36
|
+
return latest;
|
|
37
|
+
}
|
|
38
|
+
function artifactLabelCounts(sequences) {
|
|
39
|
+
const counts = {};
|
|
40
|
+
for (const sequence of sequences) {
|
|
41
|
+
for (const event of Array.isArray(sequence.events) ? sequence.events : []) {
|
|
42
|
+
if (event && typeof event === "object" && !Array.isArray(event) && typeof event.artifact_label === "string") {
|
|
43
|
+
inc(counts, event.artifact_label);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return counterDict(counts);
|
|
48
|
+
}
|
|
49
|
+
function runtimeRecordCounts(records) {
|
|
50
|
+
const counts = {};
|
|
51
|
+
for (const record of records) {
|
|
52
|
+
if (record && typeof record === "object") {
|
|
53
|
+
const runtime = record.runtime;
|
|
54
|
+
if (typeof runtime === "string")
|
|
55
|
+
inc(counts, runtime);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return counterDict(counts);
|
|
59
|
+
}
|
|
60
|
+
function agenteraVersion(root = resolveSourceRoot()) {
|
|
61
|
+
try {
|
|
62
|
+
const data = loadTomlFile(path.join(root, "pyproject.toml")); // cast: IO boundary — TOML parse of pyproject.toml
|
|
63
|
+
const project = data.project;
|
|
64
|
+
if (project && typeof project === "object" && typeof project.version === "string") {
|
|
65
|
+
return project.version;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return "unknown";
|
|
70
|
+
}
|
|
71
|
+
return "unknown";
|
|
72
|
+
}
|
|
73
|
+
function gitOutput(args, root = resolveSourceRoot()) {
|
|
74
|
+
const result = _spawnSync("git", args, { cwd: root, encoding: "utf8", timeout: 5000 });
|
|
75
|
+
if (result.error || result.status !== 0)
|
|
76
|
+
return null;
|
|
77
|
+
return (result.stdout ?? "").trim();
|
|
78
|
+
}
|
|
79
|
+
function gitMetadata(root = resolveSourceRoot()) {
|
|
80
|
+
const commit = gitOutput(["rev-parse", "HEAD"], root) || "unknown";
|
|
81
|
+
const status = gitOutput(["status", "--porcelain"], root);
|
|
82
|
+
return { git_commit: commit, git_dirty: status !== null ? Boolean(status) : false };
|
|
83
|
+
}
|
|
84
|
+
function runtimeScope(metrics, approvedScope = null) {
|
|
85
|
+
if (approvedScope && approvedScope.length > 0) {
|
|
86
|
+
return [...new Set(approvedScope.filter((l) => l).map((l) => String(l)))].sort();
|
|
87
|
+
}
|
|
88
|
+
const labels = new Set();
|
|
89
|
+
for (const item of Array.isArray(metrics.runtime_coverage) ? metrics.runtime_coverage : []) {
|
|
90
|
+
if (item && typeof item === "object" && !Array.isArray(item) && typeof item.runtime === "string")
|
|
91
|
+
labels.add(item.runtime);
|
|
92
|
+
}
|
|
93
|
+
const runtimeCounts = metrics.runtime_record_counts;
|
|
94
|
+
if (runtimeCounts && typeof runtimeCounts === "object") {
|
|
95
|
+
for (const label of Object.keys(runtimeCounts))
|
|
96
|
+
if (label)
|
|
97
|
+
labels.add(String(label));
|
|
98
|
+
}
|
|
99
|
+
const sorted = [...labels].sort();
|
|
100
|
+
return sorted.length > 0 ? sorted : ["unknown"];
|
|
101
|
+
}
|
|
102
|
+
function runtimeScopeMatches(row, scope) {
|
|
103
|
+
const value = row.runtime_scope;
|
|
104
|
+
if (!Array.isArray(value))
|
|
105
|
+
return false;
|
|
106
|
+
const a = value.map((l) => String(l)).sort();
|
|
107
|
+
const b = scope.map((l) => String(l)).sort();
|
|
108
|
+
return a.length === b.length && a.every((v, i) => v === b[i]);
|
|
109
|
+
}
|
|
110
|
+
export function previousBenchmarkWatermark(benchmarkDir, scope) {
|
|
111
|
+
const historyPath = path.join(benchmarkDir, BENCHMARK_HISTORY_JSONL);
|
|
112
|
+
let lines;
|
|
113
|
+
try {
|
|
114
|
+
lines = fs.readFileSync(historyPath, "utf8").split(/\r\n|\r|\n/);
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
let watermark = null;
|
|
120
|
+
for (const line of lines) {
|
|
121
|
+
if (!line.trim())
|
|
122
|
+
continue;
|
|
123
|
+
let row;
|
|
124
|
+
try {
|
|
125
|
+
row = JSON.parse(line);
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (!row || typeof row !== "object" || !runtimeScopeMatches(row, scope))
|
|
131
|
+
continue;
|
|
132
|
+
const candidate = parseTimestamp(row.benchmark_watermark_at);
|
|
133
|
+
if (candidate !== null)
|
|
134
|
+
watermark = candidate;
|
|
135
|
+
}
|
|
136
|
+
return watermark;
|
|
137
|
+
}
|
|
138
|
+
function previousBenchmarkRow(benchmarkDir, scope) {
|
|
139
|
+
const historyPath = path.join(benchmarkDir, BENCHMARK_HISTORY_JSONL);
|
|
140
|
+
let lines;
|
|
141
|
+
try {
|
|
142
|
+
lines = fs.readFileSync(historyPath, "utf8").split(/\r\n|\r|\n/);
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
let previous = null;
|
|
148
|
+
for (const line of lines) {
|
|
149
|
+
if (!line.trim())
|
|
150
|
+
continue;
|
|
151
|
+
let row;
|
|
152
|
+
try {
|
|
153
|
+
row = JSON.parse(line);
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
if (row && typeof row === "object" && runtimeScopeMatches(row, scope))
|
|
159
|
+
previous = row;
|
|
160
|
+
}
|
|
161
|
+
return previous;
|
|
162
|
+
}
|
|
163
|
+
function withEstimatedTokensSaved(metrics, benchmarkDir, scope) {
|
|
164
|
+
const enriched = { ...metrics };
|
|
165
|
+
const previous = previousBenchmarkRow(benchmarkDir, scope);
|
|
166
|
+
const currentVersion = enriched.token_estimator_version;
|
|
167
|
+
const currentRedundant = enriched.estimated_redundant_raw_tokens;
|
|
168
|
+
let reason = null;
|
|
169
|
+
let saved = null;
|
|
170
|
+
if (previous === null) {
|
|
171
|
+
reason = "previous_row_missing";
|
|
172
|
+
}
|
|
173
|
+
else if (![...TOKEN_AGGREGATE_FIELDS].every((f) => f in previous)) {
|
|
174
|
+
reason = "previous_missing_token_estimates";
|
|
175
|
+
}
|
|
176
|
+
else if (previous.contract_version !== enriched.contract_version) {
|
|
177
|
+
reason = "contract_version_mismatch";
|
|
178
|
+
}
|
|
179
|
+
else if (previous.benchmark_mode !== (enriched.benchmark_mode || "full_boundary_snapshot")) {
|
|
180
|
+
reason = "benchmark_mode_mismatch";
|
|
181
|
+
}
|
|
182
|
+
else if (!runtimeScopeMatches(previous, scope)) {
|
|
183
|
+
reason = "runtime_scope_mismatch";
|
|
184
|
+
}
|
|
185
|
+
else if (previous.token_estimator_version !== currentVersion) {
|
|
186
|
+
reason = "estimator_version_mismatch";
|
|
187
|
+
}
|
|
188
|
+
else if (!(typeof previous.estimated_redundant_raw_tokens === "number" && Number.isInteger(previous.estimated_redundant_raw_tokens)) ||
|
|
189
|
+
!(typeof currentRedundant === "number" && Number.isInteger(currentRedundant))) {
|
|
190
|
+
reason = "previous_missing_token_estimates";
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
saved = previous.estimated_redundant_raw_tokens - currentRedundant;
|
|
194
|
+
}
|
|
195
|
+
enriched.estimated_tokens_saved_vs_previous = saved;
|
|
196
|
+
enriched.estimated_tokens_saved_vs_previous_null_reason = reason;
|
|
197
|
+
return enriched;
|
|
198
|
+
}
|
|
199
|
+
export function buildBenchmarkHistoryRow(metrics, scope = null) {
|
|
200
|
+
const recommendation = metrics && typeof metrics === "object" && metrics.startup_recommendation && typeof metrics.startup_recommendation === "object" && !Array.isArray(metrics.startup_recommendation)
|
|
201
|
+
? metrics.startup_recommendation
|
|
202
|
+
: {};
|
|
203
|
+
return {
|
|
204
|
+
contract_version: metrics.contract_version ?? null,
|
|
205
|
+
generated_at: metrics.generated_at ?? null,
|
|
206
|
+
agentera_version: agenteraVersion(),
|
|
207
|
+
...gitMetadata(),
|
|
208
|
+
runtime_scope: runtimeScope(metrics, scope),
|
|
209
|
+
benchmark_mode: metrics.benchmark_mode || "full_boundary_snapshot",
|
|
210
|
+
benchmark_previous_watermark_at: metrics.benchmark_previous_watermark_at ?? null,
|
|
211
|
+
benchmark_window_started_after: metrics.benchmark_window_started_after ?? null,
|
|
212
|
+
benchmark_watermark_at: metrics.benchmark_watermark_at ?? null,
|
|
213
|
+
total_records: safeInt(metrics.total_records),
|
|
214
|
+
total_state_sequences: safeInt(metrics.total_state_sequences),
|
|
215
|
+
state_sequences_with_raw_after_cli: safeInt(metrics.state_sequences_with_raw_after_cli),
|
|
216
|
+
state_sequences_with_redundant_raw_access: safeInt(metrics.state_sequences_with_redundant_raw_access),
|
|
217
|
+
raw_after_cli_rate: metrics.raw_after_cli_sequence_rate ?? 0,
|
|
218
|
+
redundant_raw_access_rate: metrics.redundant_raw_sequence_rate ?? 0,
|
|
219
|
+
cli_state_command_counts: metrics.cli_state_command_counts ?? {},
|
|
220
|
+
raw_artifact_access_after_cli_counts: metrics.raw_artifact_access_after_cli_counts ?? {},
|
|
221
|
+
redundant_raw_artifact_access_counts: metrics.redundant_raw_artifact_access_counts ?? {},
|
|
222
|
+
token_estimator_version: metrics.token_estimator_version ?? null,
|
|
223
|
+
estimated_raw_after_cli_tokens: safeInt(metrics.estimated_raw_after_cli_tokens),
|
|
224
|
+
estimated_redundant_raw_tokens: safeInt(metrics.estimated_redundant_raw_tokens),
|
|
225
|
+
estimated_raw_after_cli_tokens_by_artifact: metrics.estimated_raw_after_cli_tokens_by_artifact ?? {},
|
|
226
|
+
estimated_redundant_raw_tokens_by_artifact: metrics.estimated_redundant_raw_tokens_by_artifact ?? {},
|
|
227
|
+
estimated_tokens_saved_vs_previous: metrics.estimated_tokens_saved_vs_previous ?? null,
|
|
228
|
+
estimated_tokens_saved_vs_previous_null_reason: metrics.estimated_tokens_saved_vs_previous_null_reason ?? null,
|
|
229
|
+
per_capability_state_counts: metrics.per_capability_state_counts ?? {},
|
|
230
|
+
degradation_reason_counts: metrics.degradation_reason_counts ?? {},
|
|
231
|
+
bounded_degradation_counts: {
|
|
232
|
+
record_or_sequence: metrics.degradation_reason_counts ?? {},
|
|
233
|
+
runtime_status: metrics.runtime_status_counts ?? {},
|
|
234
|
+
},
|
|
235
|
+
startup_recommendation_action: recommendation.action ?? null,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
function temporaryPeerPath(p) {
|
|
239
|
+
const ts = new Date().toISOString().replace(/[-:.TZ]/g, "");
|
|
240
|
+
const dir = path.dirname(p);
|
|
241
|
+
const base = path.basename(p);
|
|
242
|
+
return path.join(dir, `.${base}.${process.pid}.${ts}.tmp`);
|
|
243
|
+
}
|
|
244
|
+
export function persistStartupBenchmark(metrics, benchmarkDir, scope = null) {
|
|
245
|
+
const resolvedDir = path.resolve(benchmarkDir);
|
|
246
|
+
if (!path.isAbsolute(resolvedDir)) {
|
|
247
|
+
throw new Error("benchmark directory must be an absolute path");
|
|
248
|
+
}
|
|
249
|
+
const resolvedScope = runtimeScope(metrics, scope);
|
|
250
|
+
const enriched = withEstimatedTokensSaved(metrics, resolvedDir, resolvedScope);
|
|
251
|
+
const structuredText = pyJsonIndent(enriched) + "\n";
|
|
252
|
+
const humanText = renderStartupReport(enriched);
|
|
253
|
+
const rowText = pyJsonDumps(buildBenchmarkHistoryRow(enriched, resolvedScope)) + "\n";
|
|
254
|
+
fs.mkdirSync(resolvedDir, { recursive: true });
|
|
255
|
+
const historyPath = path.join(resolvedDir, BENCHMARK_HISTORY_JSONL);
|
|
256
|
+
const jsonPath = path.join(resolvedDir, BENCHMARK_LATEST_REPORT_JSON);
|
|
257
|
+
const markdownPath = path.join(resolvedDir, BENCHMARK_LATEST_REPORT_MARKDOWN);
|
|
258
|
+
const jsonTmp = temporaryPeerPath(jsonPath);
|
|
259
|
+
const markdownTmp = temporaryPeerPath(markdownPath);
|
|
260
|
+
try {
|
|
261
|
+
fs.writeFileSync(jsonTmp, structuredText);
|
|
262
|
+
fs.writeFileSync(markdownTmp, humanText);
|
|
263
|
+
fs.appendFileSync(historyPath, rowText);
|
|
264
|
+
fs.renameSync(jsonTmp, jsonPath);
|
|
265
|
+
fs.renameSync(markdownTmp, markdownPath);
|
|
266
|
+
}
|
|
267
|
+
catch (err) {
|
|
268
|
+
for (const tmp of [jsonTmp, markdownTmp]) {
|
|
269
|
+
try {
|
|
270
|
+
fs.unlinkSync(tmp);
|
|
271
|
+
}
|
|
272
|
+
catch {
|
|
273
|
+
/* ignore */
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
throw err;
|
|
277
|
+
}
|
|
278
|
+
return { history: historyPath, structured: jsonPath, human_readable: markdownPath };
|
|
279
|
+
}
|
|
280
|
+
export function buildStartupIntermediate(corpus, opts) {
|
|
281
|
+
const salt = opts.salt;
|
|
282
|
+
const loaded = opts.contract ?? loadContract();
|
|
283
|
+
let records = corpus && typeof corpus === "object" && !Array.isArray(corpus) ? (corpus.records ?? []) : [];
|
|
284
|
+
if (!Array.isArray(records))
|
|
285
|
+
records = [];
|
|
286
|
+
let metadata = corpus && typeof corpus === "object" && !Array.isArray(corpus) ? (corpus.metadata ?? {}) : {};
|
|
287
|
+
if (!metadata || typeof metadata !== "object" || Array.isArray(metadata))
|
|
288
|
+
metadata = {};
|
|
289
|
+
let runtimeStatuses = metadata.runtime_statuses;
|
|
290
|
+
if (!Array.isArray(runtimeStatuses))
|
|
291
|
+
runtimeStatuses = [];
|
|
292
|
+
const boundaryInfo = loaded.boundary && typeof loaded.boundary === "object" && !Array.isArray(loaded.boundary) ? loaded.boundary : {};
|
|
293
|
+
const boundary = parseTimestamp(boundaryInfo.committed_at);
|
|
294
|
+
const windowStartedAfter = opts.benchmarkWindowStartedAfter ?? boundary;
|
|
295
|
+
const watermarkAt = opts.benchmarkWatermarkAt ?? maxRecordTimestamp(records, windowStartedAfter);
|
|
296
|
+
const classified = classifyStartupRecords(corpus, { salt, contract: loaded });
|
|
297
|
+
const sequences = (Array.isArray(classified.state_gathering_sequences) ? classified.state_gathering_sequences : []);
|
|
298
|
+
const degradations = classified.degradations;
|
|
299
|
+
const runtimeCoverage = runtimeStatuses
|
|
300
|
+
.filter((s) => Boolean(s && typeof s === "object" && !Array.isArray(s)))
|
|
301
|
+
.map((s) => boundedRuntimeStatus(s));
|
|
302
|
+
return {
|
|
303
|
+
output_envelope: STARTUP_INTERMEDIATE_ENVELOPE,
|
|
304
|
+
contract_version: loaded.version ?? null,
|
|
305
|
+
boundary_source: boundaryInfo.source ?? null,
|
|
306
|
+
boundary_commit: boundaryInfo.commit ?? null,
|
|
307
|
+
boundary_committed_at: boundaryInfo.committed_at ?? null,
|
|
308
|
+
benchmark_mode: opts.benchmarkMode || "full_boundary_snapshot",
|
|
309
|
+
benchmark_previous_watermark_at: formatTimestamp(opts.benchmarkPreviousWatermarkAt ?? null),
|
|
310
|
+
benchmark_window_started_after: formatTimestamp(windowStartedAfter),
|
|
311
|
+
benchmark_watermark_at: formatTimestamp(watermarkAt),
|
|
312
|
+
corpus_adapter_version: metadata.adapter_version ?? null,
|
|
313
|
+
runtime_coverage: runtimeCoverage,
|
|
314
|
+
runtime_record_counts: runtimeRecordCounts(records),
|
|
315
|
+
total_records_read: records.length,
|
|
316
|
+
total_state_sequences: sequences.length,
|
|
317
|
+
artifact_label_counts: artifactLabelCounts(sequences),
|
|
318
|
+
state_gathering_sequences: sequences,
|
|
319
|
+
degradations,
|
|
320
|
+
compatibility_note: "Section 22 corpus records are read-only; startup state data is emitted only in startup_state_analysis_v1.",
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
export function buildNoRuntimeStartupIntermediate(opts = {}) {
|
|
324
|
+
const loaded = opts.contract ?? loadContract();
|
|
325
|
+
const boundaryInfo = loaded.boundary && typeof loaded.boundary === "object" && !Array.isArray(loaded.boundary) ? loaded.boundary : {};
|
|
326
|
+
const boundary = parseTimestamp(boundaryInfo.committed_at);
|
|
327
|
+
const windowStartedAfter = opts.benchmarkPreviousWatermarkAt ?? boundary;
|
|
328
|
+
return {
|
|
329
|
+
output_envelope: STARTUP_INTERMEDIATE_ENVELOPE,
|
|
330
|
+
contract_version: loaded.version ?? null,
|
|
331
|
+
boundary_source: boundaryInfo.source ?? null,
|
|
332
|
+
boundary_commit: boundaryInfo.commit ?? null,
|
|
333
|
+
boundary_committed_at: boundaryInfo.committed_at ?? null,
|
|
334
|
+
benchmark_mode: opts.benchmarkMode ?? "since_previous_benchmark",
|
|
335
|
+
benchmark_previous_watermark_at: formatTimestamp(opts.benchmarkPreviousWatermarkAt ?? null),
|
|
336
|
+
benchmark_window_started_after: formatTimestamp(windowStartedAfter),
|
|
337
|
+
benchmark_watermark_at: formatTimestamp(opts.benchmarkPreviousWatermarkAt ?? null),
|
|
338
|
+
corpus_adapter_version: null,
|
|
339
|
+
runtime_coverage: [{ runtime: "none", status: "skipped", reason: "no_runtime_stores_approved", record_count: 0 }],
|
|
340
|
+
runtime_record_counts: {},
|
|
341
|
+
total_records_read: 0,
|
|
342
|
+
total_state_sequences: 0,
|
|
343
|
+
artifact_label_counts: {},
|
|
344
|
+
state_gathering_sequences: [],
|
|
345
|
+
degradations: [],
|
|
346
|
+
compatibility_note: "No runtime stores were approved, so no local runtime history was read.",
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
export function extractStartupIntermediateFromCorpusFile(corpusPath, opts) {
|
|
350
|
+
let corpus;
|
|
351
|
+
try {
|
|
352
|
+
corpus = JSON.parse(fs.readFileSync(corpusPath, "utf8"));
|
|
353
|
+
}
|
|
354
|
+
catch {
|
|
355
|
+
corpus = {
|
|
356
|
+
metadata: {
|
|
357
|
+
runtime_statuses: [
|
|
358
|
+
{ runtime: "local-corpus", status: "degraded", reason: "schema_divergent", error_count: 1 },
|
|
359
|
+
],
|
|
360
|
+
},
|
|
361
|
+
records: [],
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
const intermediate = buildStartupIntermediate(corpus, { salt: opts.salt, contract: opts.contract ?? null });
|
|
365
|
+
if (opts.outputPath) {
|
|
366
|
+
fs.mkdirSync(path.dirname(opts.outputPath), { recursive: true });
|
|
367
|
+
fs.writeFileSync(opts.outputPath, pyJsonIndent(intermediate) + "\n");
|
|
368
|
+
}
|
|
369
|
+
return intermediate;
|
|
370
|
+
}
|
|
371
|
+
//# sourceMappingURL=benchmark.js.map
|