agentera 3.0.0-dev.4 → 3.0.0-dev.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +108 -22
- package/bundle/.agentera-npx-bundle.json +1 -1
- package/bundle/CHANGELOG.md +1351 -0
- package/bundle/DESIGN.md +229 -0
- package/bundle/LICENSE +201 -0
- package/bundle/README.md +143 -0
- package/bundle/UPGRADE.md +236 -0
- package/bundle/extract-corpus-parity.json +21 -0
- package/bundle/fixtures/routing/hybrid-corpus.yaml +154 -0
- package/bundle/references/adapters/package-publication.json +437 -0
- package/bundle/references/adapters/package-registry.yaml +434 -189
- package/bundle/references/adapters/package-surface-characterization.md +66 -35
- package/bundle/references/adapters/runtime-lifecycle-adapters.yaml +74 -0
- package/bundle/references/adapters/runtime-lifecycle-authority.yaml +62 -0
- package/bundle/references/adapters/runtime-lifecycle-operation-contract.yaml +84 -0
- package/bundle/references/adapters/runtime-retired-resources.yaml +333 -0
- package/bundle/references/analysis/evidence-tier-authority.yaml +518 -0
- package/bundle/references/analysis/verification-policy.yaml +191 -0
- package/bundle/references/artifacts/artifact-registry-interface-model.yaml +20 -10
- package/bundle/references/artifacts/glossary-entry-contract.yaml +1254 -0
- package/bundle/references/artifacts/state-storage-authority.yaml +2982 -0
- package/bundle/references/artifacts/verbosity-budget-authority.yaml +42 -0
- package/bundle/references/cli/app-lifecycle-vocabulary.yaml +7 -8
- package/bundle/references/cli/capability-instruction-contract.yaml +97 -59
- package/bundle/references/cli/hybrid-route-contract.yaml +438 -0
- package/bundle/references/cli/routing-model.md +155 -0
- package/bundle/references/cli/trigger-schema-enrichment.md +147 -0
- package/bundle/references/cli/update-channels.yaml +35 -2
- package/bundle/references/cli/vocabulary-index.yaml +23 -20
- package/bundle/references/cli/vocabulary.md +337 -366
- package/bundle/references/meta/retained-reference-authority.yaml +151 -0
- package/bundle/registry.json +14 -14
- package/bundle/skills/agentera/SKILL.md +218 -408
- 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/audit/schemas/triggers.yaml +25 -0
- package/bundle/skills/agentera/capabilities/{inspektera → audit}/schemas/validation.yaml +37 -18
- package/bundle/skills/agentera/capabilities/build/schemas/artifacts.yaml +102 -0
- package/bundle/skills/agentera/capabilities/{realisera → build}/schemas/exit.yaml +6 -5
- package/bundle/skills/agentera/capabilities/build/schemas/triggers.yaml +27 -0
- package/bundle/skills/agentera/capabilities/build/schemas/validation.yaml +176 -0
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/artifacts.yaml +12 -12
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/exit.yaml +5 -5
- package/bundle/skills/agentera/capabilities/design/schemas/triggers.yaml +16 -0
- package/bundle/skills/agentera/capabilities/{visualisera → design}/schemas/validation.yaml +7 -7
- package/bundle/skills/agentera/capabilities/discuss/schemas/artifacts.yaml +51 -0
- package/bundle/skills/agentera/capabilities/{resonera → discuss}/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/discuss/schemas/triggers.yaml +20 -0
- package/bundle/skills/agentera/capabilities/discuss/schemas/validation.yaml +144 -0
- package/bundle/skills/agentera/capabilities/document/schemas/artifacts.yaml +80 -0
- package/bundle/skills/agentera/capabilities/document/schemas/triggers.yaml +16 -0
- package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/validation.yaml +18 -18
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/artifacts.yaml +18 -18
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/optimize/schemas/triggers.yaml +16 -0
- package/bundle/skills/agentera/capabilities/{optimera → optimize}/schemas/validation.yaml +9 -9
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/artifacts.yaml +76 -0
- package/bundle/skills/agentera/capabilities/{orkestrera → orchestrate}/schemas/exit.yaml +9 -7
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/triggers.yaml +23 -0
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/validation.yaml +121 -0
- package/bundle/skills/agentera/capabilities/plan/schemas/artifacts.yaml +66 -0
- package/bundle/skills/agentera/capabilities/{planera → plan}/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/plan/schemas/triggers.yaml +23 -0
- package/bundle/skills/agentera/capabilities/plan/schemas/validation.yaml +121 -0
- package/bundle/skills/agentera/capabilities/profile/schemas/artifacts.yaml +23 -0
- package/bundle/skills/agentera/capabilities/{profilera → profile}/schemas/exit.yaml +6 -5
- package/bundle/skills/agentera/capabilities/profile/schemas/triggers.yaml +20 -0
- package/bundle/skills/agentera/capabilities/profile/schemas/validation.yaml +115 -0
- package/bundle/skills/agentera/capabilities/research/schemas/artifacts.yaml +24 -0
- package/bundle/skills/agentera/capabilities/research/schemas/triggers.yaml +16 -0
- package/bundle/skills/agentera/capabilities/{inspirera → research}/schemas/validation.yaml +2 -2
- package/bundle/skills/agentera/capabilities/status/schemas/artifacts.yaml +73 -0
- package/bundle/skills/agentera/capabilities/status/schemas/triggers.yaml +22 -0
- package/bundle/skills/agentera/capabilities/{hej → status}/schemas/validation.yaml +5 -5
- package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/artifacts.yaml +16 -16
- package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/exit.yaml +7 -6
- package/bundle/skills/agentera/capabilities/vision/schemas/triggers.yaml +23 -0
- package/bundle/skills/agentera/capabilities/{visionera → vision}/schemas/validation.yaml +18 -20
- package/bundle/skills/agentera/capability_schema_contract.yaml +200 -37
- package/bundle/skills/agentera/protocol.yaml +31 -31
- package/bundle/skills/agentera/route-phrases.yaml +81 -0
- package/bundle/skills/agentera/schemas/artifacts/changelog.yaml +5 -4
- package/bundle/skills/agentera/schemas/artifacts/decisions.yaml +40 -22
- package/bundle/skills/agentera/schemas/artifacts/design.yaml +5 -4
- package/bundle/skills/agentera/schemas/artifacts/docs.yaml +15 -19
- package/bundle/skills/agentera/schemas/artifacts/experiments.yaml +145 -14
- package/bundle/skills/agentera/schemas/artifacts/glossary.yaml +82 -0
- package/bundle/skills/agentera/schemas/artifacts/health.yaml +58 -21
- package/bundle/skills/agentera/schemas/artifacts/objective.yaml +22 -8
- package/bundle/skills/agentera/schemas/artifacts/plan.yaml +421 -33
- package/bundle/skills/agentera/schemas/artifacts/progress.yaml +143 -53
- package/bundle/skills/agentera/schemas/artifacts/todo.yaml +345 -31
- package/bundle/skills/agentera/schemas/artifacts/vision.yaml +3 -3
- package/dist/analytics/extractCorpus/cli.js +190 -0
- package/dist/analytics/extractCorpus/copilotSessions.js +275 -0
- package/dist/analytics/extractCorpus/core.js +392 -0
- package/dist/analytics/extractCorpus/corpus.js +167 -0
- package/dist/analytics/extractCorpus/coverageAudit.js +260 -0
- package/dist/analytics/extractCorpus/cursorSessions.js +425 -0
- package/dist/analytics/extractCorpus/evidenceTiers.js +603 -0
- package/dist/analytics/extractCorpus/extractCorpusParity.js +105 -0
- package/dist/analytics/extractCorpus/filesystemSources.js +118 -0
- package/dist/analytics/extractCorpus/index.js +14 -0
- package/dist/analytics/extractCorpus/jsonlSessions.js +204 -0
- package/dist/analytics/extractCorpus/sqliteCaps.js +43 -0
- package/dist/analytics/extractCorpus/sqliteSessions.js +367 -0
- package/dist/analytics/extractCorpus/tierReader.js +108 -0
- package/dist/analytics/extractCorpus.js +2 -1791
- package/dist/analytics/glossaryAdviceResolution.js +166 -0
- package/dist/analytics/glossaryInputAcquisition.js +319 -0
- package/dist/analytics/personalGlossaryAdmission.js +133 -0
- package/dist/analytics/personalGlossaryProfile.js +219 -0
- package/dist/analytics/profileSignals.js +211 -0
- package/dist/analytics/usageStats.js +169 -42
- package/dist/audit/terminologyDrift.js +281 -0
- package/dist/bin/agentera.js +3 -2
- package/dist/capabilities/audit/instructions.js +16 -0
- package/dist/capabilities/build/instructions.js +56 -0
- package/dist/capabilities/design/instructions.js +4 -0
- package/dist/capabilities/discuss/instructions.js +29 -0
- package/dist/capabilities/document/instructions.js +11 -0
- package/dist/capabilities/index.js +40 -0
- package/dist/capabilities/optimize/instructions.js +14 -0
- package/dist/capabilities/orchestrate/instructions.js +40 -0
- package/dist/capabilities/plan/instructions.js +32 -0
- package/dist/capabilities/profile/instructions.js +70 -0
- package/dist/capabilities/research/instructions.js +5 -0
- package/dist/capabilities/status/instructions.js +11 -0
- package/dist/capabilities/status/startupInstructions.js +34 -0
- package/dist/capabilities/vision/instructions.js +4 -0
- package/dist/cli/appContext.js +30 -24
- package/dist/cli/argvalidate.js +0 -1
- package/dist/cli/capabilityContext/benchmark.js +565 -0
- package/dist/cli/capabilityContext/bespoke.js +44 -0
- package/dist/cli/capabilityContext/build.js +242 -0
- package/dist/cli/capabilityContext/closeout.js +233 -0
- package/dist/cli/capabilityContext/contract.js +179 -0
- package/dist/cli/capabilityContext/evidence.js +463 -0
- package/dist/cli/capabilityContext/index.js +3 -0
- package/dist/cli/capabilityContext/orchestration.js +131 -0
- package/dist/cli/capabilityContext/planState.js +260 -0
- package/dist/cli/capabilityContext/progress.js +142 -0
- package/dist/cli/capabilityContext/projectVerification.js +409 -0
- package/dist/cli/capabilityContext/shared.js +83 -0
- package/dist/cli/capabilityContext/slim.js +152 -0
- package/dist/cli/capabilityContext/startup.js +150 -0
- package/dist/cli/capabilityContext/startupAggregation.js +68 -0
- package/dist/cli/capabilityContext/types.js +56 -0
- package/dist/cli/capabilityContext.js +1 -2421
- package/dist/cli/commands/appHome.js +22 -0
- package/dist/cli/commands/capability.js +5 -12
- package/dist/cli/commands/compact.js +41 -13
- package/dist/cli/commands/doctor.js +127 -97
- package/dist/cli/commands/durability.js +81 -0
- package/dist/cli/commands/glossaryAdvice.js +138 -0
- package/dist/cli/commands/lint.js +26 -44
- package/dist/cli/commands/personalGlossary.js +176 -0
- package/dist/cli/commands/prime/briefOrientation.js +747 -0
- package/dist/cli/commands/prime/buildExecutionRequest.js +165 -0
- package/dist/cli/commands/prime/bundleStatus.js +190 -0
- package/dist/cli/commands/prime/collectEntityOrientation.js +311 -0
- package/dist/cli/commands/prime/collectOrientationState.js +212 -0
- package/dist/cli/commands/prime/orientationOutput.js +397 -0
- package/dist/cli/commands/prime/types.js +1 -0
- package/dist/cli/commands/prime/v1Migration.js +38 -0
- package/dist/cli/commands/prime.js +80 -558
- package/dist/cli/commands/profileGrounding.js +55 -0
- package/dist/cli/commands/query.js +78 -53
- package/dist/cli/commands/report.js +96 -25
- package/dist/cli/commands/route.js +142 -0
- package/dist/cli/commands/schema.js +266 -143
- package/dist/cli/commands/state/decisions.js +387 -0
- package/dist/cli/commands/state/docs.js +70 -0
- package/dist/cli/commands/state/experimentRecords.js +151 -0
- package/dist/cli/commands/state/experiments.js +14 -0
- package/dist/cli/commands/state/get.js +129 -0
- package/dist/cli/commands/state/health.js +14 -0
- package/dist/cli/commands/state/index.js +16 -0
- package/dist/cli/commands/state/list.js +194 -0
- package/dist/cli/commands/state/objective.js +25 -0
- package/dist/cli/commands/state/plan.js +14 -0
- package/dist/cli/commands/state/planTasks.js +154 -0
- package/dist/cli/commands/state/plans.js +154 -0
- package/dist/cli/commands/state/progress.js +13 -0
- package/dist/cli/commands/state/shared.js +14 -0
- package/dist/cli/commands/state/todo.js +42 -0
- package/dist/cli/commands/state/write.js +434 -0
- package/dist/cli/commands/upgrade.js +146 -5
- package/dist/cli/commands/upgradeVerify.js +118 -0
- package/dist/cli/commands/validate.js +272 -213
- package/dist/cli/commands/verify.js +24 -9
- package/dist/cli/contracts/bundleStatus.js +1 -0
- package/dist/cli/contracts/orientationState.js +1 -0
- package/dist/cli/dispatch/argvParser.js +32 -0
- package/dist/cli/dispatch/check.js +372 -0
- package/dist/cli/dispatch/commands.js +27 -0
- package/dist/cli/dispatch/index.js +207 -0
- package/dist/cli/dispatch/lifecycle.js +652 -0
- package/dist/cli/dispatch/prime.js +139 -0
- package/dist/cli/dispatch/projections.js +17 -0
- package/dist/cli/dispatch/shared.js +63 -0
- package/dist/cli/dispatch/state.js +140 -0
- package/dist/cli/dispatch.js +1 -996
- package/dist/cli/errors.js +52 -0
- package/dist/cli/help.js +390 -43
- package/dist/cli/migrationRequired.js +87 -0
- package/dist/cli/orientation/attention.js +59 -0
- package/dist/cli/orientation/corpusCoverage.js +102 -0
- package/dist/cli/orientation.js +444 -173
- package/dist/cli/planArtifacts.js +350 -0
- package/dist/cli/planEvidence.js +157 -0
- package/dist/cli/planLifecycleState.js +36 -0
- package/dist/cli/planTaskIndex.js +11 -0
- package/dist/cli/preCutoverCommand.js +32 -0
- package/dist/cli/prime-blob.js +71 -3
- package/dist/cli/profileAcquisition.js +167 -0
- package/dist/cli/startupCompletenessContract.js +59 -0
- package/dist/cli/stateQuery.js +63 -14
- package/dist/cli/structured.js +0 -1
- package/dist/cli/todoMarkdown.js +46 -0
- package/dist/cli/todoReadinessSelection.js +192 -0
- package/dist/cli/todoSeverity.js +18 -0
- package/dist/core/atomicWriter.js +20 -0
- package/dist/core/developmentChannel.js +1 -0
- package/dist/core/developmentInvocation.js +374 -0
- package/dist/core/difflib.js +0 -1
- package/dist/core/envPaths.js +20 -0
- package/dist/core/jsonValue.js +5 -0
- package/dist/core/paths.js +0 -1
- package/dist/core/pyjson.js +67 -3
- package/dist/core/shell.js +4 -0
- package/dist/core/skillIdentity.js +23 -0
- package/dist/core/sourceRoot.js +9 -12
- package/dist/core/text.js +10 -0
- package/dist/core/toml.js +0 -1
- package/dist/core/yaml.js +8 -1
- package/dist/eval/evalSkills.js +30 -26
- package/dist/eval/hybridRouteEvaluation.js +155 -0
- package/dist/eval/semanticEval.js +43 -20
- package/dist/eval/semanticFixtures.js +16 -5
- package/dist/hooks/common.js +11 -81
- package/dist/hooks/compaction/apply.js +446 -0
- package/dist/hooks/compaction/dryRun.js +184 -0
- package/dist/hooks/compaction/index.js +22 -0
- package/dist/hooks/compaction/parse.js +325 -0
- package/dist/hooks/compaction/retention.js +202 -0
- package/dist/hooks/compaction/status.js +360 -0
- package/dist/hooks/compaction/types.js +5 -0
- package/dist/hooks/validateArtifact/agentFacing.js +9 -0
- package/dist/hooks/validateArtifact/index.js +92 -0
- package/dist/hooks/validateArtifact/markdown.js +145 -0
- package/dist/hooks/validateArtifact/schema.js +546 -0
- package/dist/hooks/validateArtifact/traversal.js +107 -0
- package/dist/hooks/validateArtifact/violations.js +107 -0
- package/dist/migrate/v2HandoffManifest.js +452 -0
- package/dist/registries/activationContract.js +2 -0
- package/dist/registries/activationTuples.js +106 -0
- package/dist/registries/artifactProtocolIds.js +78 -0
- package/dist/registries/artifactRegistry.js +224 -63
- package/dist/registries/artifactSchemaProjection.js +45 -0
- package/dist/registries/capabilityContract.js +141 -13
- package/dist/registries/evaluatorHandoffContract.js +170 -0
- package/dist/registries/evidenceTierContract.js +371 -0
- package/dist/registries/glossaryAdviceContract.js +79 -0
- package/dist/registries/glossaryCaveatContract.js +67 -0
- package/dist/registries/glossaryConsumerContractValidation.js +787 -0
- package/dist/registries/glossaryEntryContract.js +757 -0
- package/dist/registries/glossaryTermIdentity.js +17 -0
- package/dist/registries/glossaryTermOccurrence.js +20 -0
- package/dist/registries/hybridRoute.js +274 -0
- package/dist/registries/hybridRouteReceipt.js +221 -0
- package/dist/registries/packagePublication.js +229 -0
- package/dist/registries/packageRegistry.js +187 -211
- package/dist/registries/todoReadinessContract.js +448 -0
- package/dist/registries/triggerLoader.js +174 -0
- package/dist/registries/verbosityBudgetContract.js +205 -0
- package/dist/release/releaseMetadata.js +385 -0
- package/dist/runtime/lifecycleAdapterContract.js +457 -0
- package/dist/runtime/lifecycleAdapters.js +777 -0
- package/dist/runtime/lifecycleAuthority.js +453 -0
- package/dist/runtime/lifecycleOperationContract.js +123 -0
- package/dist/runtime/lifecycleOperations.js +634 -0
- package/dist/runtime/lifecycleOwnershipJournal.js +622 -0
- package/dist/runtime/lifecyclePublication.js +415 -0
- package/dist/runtime/lifecycleSnapshot.js +438 -0
- package/dist/runtime/nativeResourceCleanup.js +502 -0
- package/dist/setup/opencode.js +20 -0
- package/dist/setup/opencodeConstants.js +1 -0
- package/dist/setup/sharedSkill.js +45 -0
- package/dist/setup/smokeChecks.js +21 -82
- package/dist/state/archiveDiscovery.js +580 -0
- package/dist/state/archivePublication.js +225 -0
- package/dist/state/archiveRecovery.js +237 -0
- package/dist/state/archiveReplay.js +53 -0
- package/dist/state/canonicalMigrationRecord.js +36 -0
- package/dist/state/changelog.js +221 -0
- package/dist/state/decisionEntities.js +367 -0
- package/dist/state/decisionLegacyValidation.js +215 -0
- package/dist/state/decisionMigrationProvenance.js +199 -0
- package/dist/state/decisionOverlay.js +254 -0
- package/dist/state/decisionRevision.js +256 -0
- package/dist/state/decisionRevisionMigration.js +89 -0
- package/dist/state/directRetrieval.js +323 -0
- package/dist/state/durability.js +324 -0
- package/dist/state/entityCutover.js +459 -0
- package/dist/state/entityCutoverGit.js +127 -0
- package/dist/state/entityGlossaryAuthority.js +13 -0
- package/dist/state/entityListProjection.js +187 -0
- package/dist/state/entityListRuntimeRegistry.js +85 -0
- package/dist/state/entityMigrationCausality.js +97 -0
- package/dist/state/entityMigrationIdentity.js +5 -0
- package/dist/state/entityMigrationPreview.js +846 -0
- package/dist/state/entityMigrationTodo.js +133 -0
- package/dist/state/entityPublicationContext.js +806 -0
- package/dist/state/entityRetrievalHelp.js +506 -0
- package/dist/state/entityStorage.js +896 -0
- package/dist/state/exactReplacementRecovery.js +18 -0
- package/dist/state/experimentArchive.js +63 -0
- package/dist/state/experimentIdentity.js +202 -0
- package/dist/state/healthEntities.js +262 -0
- package/dist/state/healthEntityValidation.js +18 -0
- package/dist/state/healthRepair.js +69 -0
- package/dist/state/installRoot.js +64 -25
- package/dist/state/legacyEntityCutoverEvidence.js +65 -0
- package/dist/state/legacyIdentity.js +47 -0
- package/dist/state/legacySummaryRecord.js +6 -0
- package/dist/state/listAccounting.js +54 -0
- package/dist/state/listClassification.js +17 -0
- package/dist/state/listCursor.js +42 -0
- package/dist/state/listRetrieval.js +781 -0
- package/dist/state/migrationSourceBinding.js +30 -0
- package/dist/state/objectiveExperimentEntities.js +322 -0
- package/dist/state/planEntities.js +530 -0
- package/dist/state/planIdentity.js +47 -0
- package/dist/state/planRetrieval.js +313 -0
- package/dist/state/planTaskRetrieval.js +294 -0
- package/dist/state/progressEntities.js +512 -0
- package/dist/state/progressGlossaryCaveat.js +168 -0
- package/dist/state/progressPublicationOrder.js +19 -0
- package/dist/state/projectRoot.js +62 -0
- package/dist/state/projectionPolicy.js +190 -0
- package/dist/state/retrievalAuthority.js +156 -0
- package/dist/state/safeProjectFile.js +155 -0
- package/dist/state/startupAnalysis/benchmark.js +432 -0
- package/dist/state/startupAnalysis/contract.js +160 -0
- package/dist/state/startupAnalysis/helpers.js +286 -0
- package/dist/state/startupAnalysis/index.js +6 -0
- package/dist/state/startupAnalysis/metrics.js +340 -0
- package/dist/state/startupAnalysis/records.js +198 -0
- package/dist/state/startupAnalysis/report.js +111 -0
- package/dist/state/startupAnalysis/threshold.js +512 -0
- package/dist/state/startupAnalysis.js +2 -1953
- package/dist/state/startupProjection.js +499 -0
- package/dist/state/stateMode.js +85 -0
- package/dist/state/stateStorageAuthority.js +47 -0
- package/dist/state/summaryEntityRead.js +25 -0
- package/dist/state/summaryMigrationProvenance.js +66 -0
- package/dist/state/summarySourceRowAuthority.js +36 -0
- package/dist/state/todoDocsEntities.js +1064 -0
- package/dist/state/todoDocsEntityValidation.js +158 -0
- package/dist/state/todoMarkdownProjection.js +51 -0
- package/dist/state/todoReconciliationActivation.js +132 -0
- package/dist/state/todoReconciliationInspection.js +173 -0
- package/dist/state/todoReconciliationRepair.js +170 -0
- package/dist/state/todoReconciliationTransaction.js +582 -0
- package/dist/state/write/assign.js +20 -0
- package/dist/state/write/candidateMutation.js +269 -0
- package/dist/state/write/errors.js +11 -0
- package/dist/state/write/experimentPublication.js +192 -0
- package/dist/state/write/explain.js +332 -0
- package/dist/state/write/fields.js +61 -0
- package/dist/state/write/glossaryPublication.js +263 -0
- package/dist/state/write/grammar.js +280 -0
- package/dist/state/write/helpers.js +29 -0
- package/dist/state/write/index.js +12 -0
- package/dist/state/write/input.js +367 -0
- package/dist/state/write/lock.js +837 -0
- package/dist/state/write/mutation.js +234 -0
- package/dist/state/write/operations.js +169 -0
- package/dist/state/write/planEvaluation.js +128 -0
- package/dist/state/write/planPublication.js +179 -0
- package/dist/state/write/runtimeOperations.js +142 -0
- package/dist/state/write/serialize.js +1 -0
- package/dist/state/write/transaction.js +52 -0
- package/dist/state/write/validate.js +7 -0
- package/dist/upgrade/appContentRefresh.js +383 -0
- package/dist/upgrade/appModel.js +8 -7
- package/dist/upgrade/atomicWriter.js +1 -0
- package/dist/upgrade/bundleEvidence.js +33 -0
- package/dist/upgrade/channels.js +12 -8
- package/dist/upgrade/compatibility.js +56 -21
- package/dist/upgrade/doctor.js +197 -192
- package/dist/upgrade/doctorClassifier.js +187 -0
- package/dist/upgrade/installedHooksRetirement.js +196 -0
- package/dist/upgrade/legacyAgentCleanup.js +282 -0
- package/dist/upgrade/lifecycleUpgrade.js +113 -0
- package/dist/upgrade/migrateArtifactsV2ToV3.js +367 -149
- package/dist/upgrade/migrationPublication.js +122 -0
- package/dist/upgrade/nextMajorDoctor.js +155 -0
- package/dist/upgrade/npxPlatformStatus.js +22 -0
- package/dist/upgrade/projectIntegration.js +145 -187
- package/dist/upgrade/projectIntegrationDecision.js +50 -0
- package/dist/upgrade/retiredResourceDiagnostics.js +117 -0
- package/dist/upgrade/runtimeMigration.js +278 -352
- package/dist/upgrade/upgradeCommands.js +14 -1
- package/dist/upgrade/upgradeLock.js +85 -0
- package/dist/upgrade/upgradeOrchestrator.js +263 -59
- package/dist/upgrade/v3CapabilitySurface.js +14 -0
- package/dist/upgrade/versionResolution.js +12 -5
- package/dist/validate/activationArtifactEvidence.js +844 -0
- package/dist/validate/activationConjunction.js +816 -0
- package/dist/validate/activationEvidenceManifest.js +515 -0
- package/dist/validate/activationPackageSemantics.js +29 -0
- package/dist/validate/appHomeContract.js +5 -11
- package/dist/validate/bootstrapAuthority.js +44 -0
- package/dist/validate/capability.js +144 -15
- package/dist/validate/crossCapability.js +15 -10
- package/dist/validate/retainedReferenceAuthority.js +879 -0
- package/dist/validate/selfAudit.js +73 -37
- package/dist/validate/v1LegacyCruft.js +131 -0
- package/dist/validate/vocabularyAuthority.js +303 -0
- package/package.json +53 -27
- package/bundle/references/adapters/cursor.md +0 -213
- package/bundle/references/adapters/opencode.md +0 -530
- package/bundle/references/adapters/package-manifest-interface-model.yaml +0 -337
- package/bundle/references/adapters/runtime-adapter-characterization.md +0 -79
- package/bundle/references/adapters/runtime-adapter-interface-model.yaml +0 -200
- package/bundle/references/adapters/runtime-adapter-registry.yaml +0 -548
- package/bundle/references/adapters/runtime-feature-parity.md +0 -189
- package/bundle/references/analysis/benchmark.md +0 -267
- package/bundle/references/analysis/startup-measurement-contract.yaml +0 -424
- package/bundle/references/cli/agent-ready-state-contract.yaml +0 -953
- package/bundle/references/cli/audience-namespace-cli-migration.yaml +0 -355
- package/bundle/references/cli/bundle-skill-vocabulary.yaml +0 -278
- package/bundle/references/cli/capability-tool-classification.yaml +0 -53
- package/bundle/references/cli/routing-execution-vocabulary.yaml +0 -281
- package/bundle/references/meta/documentation-inventory.md +0 -43
- 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/dokumentera/schemas/artifacts.yaml +0 -73
- package/bundle/skills/agentera/capabilities/dokumentera/schemas/triggers.yaml +0 -35
- package/bundle/skills/agentera/capabilities/hej/instructions.md +0 -331
- package/bundle/skills/agentera/capabilities/hej/schemas/artifacts.yaml +0 -69
- package/bundle/skills/agentera/capabilities/hej/schemas/triggers.yaml +0 -58
- 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/inspektera/schemas/triggers.yaml +0 -38
- 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/inspirera/schemas/triggers.yaml +0 -34
- package/bundle/skills/agentera/capabilities/optimera/instructions.md +0 -437
- package/bundle/skills/agentera/capabilities/optimera/schemas/triggers.yaml +0 -39
- 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/triggers.yaml +0 -42
- 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/triggers.yaml +0 -34
- 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/profilera/schemas/artifacts.yaml +0 -18
- package/bundle/skills/agentera/capabilities/profilera/schemas/triggers.yaml +0 -45
- package/bundle/skills/agentera/capabilities/profilera/schemas/validation.yaml +0 -57
- package/bundle/skills/agentera/capabilities/realisera/instructions.md +0 -403
- package/bundle/skills/agentera/capabilities/realisera/schemas/artifacts.yaml +0 -80
- package/bundle/skills/agentera/capabilities/realisera/schemas/triggers.yaml +0 -39
- package/bundle/skills/agentera/capabilities/realisera/schemas/validation.yaml +0 -110
- 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/resonera/schemas/triggers.yaml +0 -46
- package/bundle/skills/agentera/capabilities/resonera/schemas/validation.yaml +0 -77
- package/bundle/skills/agentera/capabilities/visionera/instructions.md +0 -309
- package/bundle/skills/agentera/capabilities/visionera/schemas/triggers.yaml +0 -41
- package/bundle/skills/agentera/capabilities/visualisera/instructions.md +0 -400
- package/bundle/skills/agentera/capabilities/visualisera/schemas/triggers.yaml +0 -33
- package/bundle/skills/agentera/references/contract.md +0 -1039
- 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/analytics/extractCorpus.js.map +0 -1
- package/dist/analytics/usageStats.js.map +0 -1
- package/dist/bin/agentera.js.map +0 -1
- package/dist/cli/appContext.js.map +0 -1
- package/dist/cli/argvalidate.js.map +0 -1
- package/dist/cli/capabilityContext.js.map +0 -1
- package/dist/cli/commands/backfill.js +0 -84
- package/dist/cli/commands/backfill.js.map +0 -1
- package/dist/cli/commands/capability.js.map +0 -1
- package/dist/cli/commands/compact.js.map +0 -1
- package/dist/cli/commands/doctor.js.map +0 -1
- package/dist/cli/commands/lint.js.map +0 -1
- package/dist/cli/commands/prime.js.map +0 -1
- package/dist/cli/commands/query.js.map +0 -1
- package/dist/cli/commands/report.js.map +0 -1
- package/dist/cli/commands/schema.js.map +0 -1
- package/dist/cli/commands/state.js +0 -1012
- package/dist/cli/commands/state.js.map +0 -1
- package/dist/cli/commands/upgrade.js.map +0 -1
- package/dist/cli/commands/validate.js.map +0 -1
- package/dist/cli/commands/verify.js.map +0 -1
- package/dist/cli/dispatch.js.map +0 -1
- package/dist/cli/help.js.map +0 -1
- package/dist/cli/orientation.js.map +0 -1
- package/dist/cli/prime-blob.js.map +0 -1
- package/dist/cli/stateQuery.js.map +0 -1
- package/dist/cli/structured.js.map +0 -1
- package/dist/core/difflib.js.map +0 -1
- package/dist/core/git.js +0 -43
- package/dist/core/git.js.map +0 -1
- package/dist/core/paths.js.map +0 -1
- package/dist/core/pyjson.js.map +0 -1
- package/dist/core/sourceRoot.js.map +0 -1
- package/dist/core/toml.js.map +0 -1
- package/dist/core/yaml.js.map +0 -1
- package/dist/eval/evalSkills.js.map +0 -1
- package/dist/eval/semanticEval.js.map +0 -1
- package/dist/eval/semanticFixtures.js.map +0 -1
- package/dist/hooks/common.js.map +0 -1
- package/dist/hooks/compaction.js +0 -935
- package/dist/hooks/compaction.js.map +0 -1
- package/dist/hooks/cursorPreToolUse.js +0 -19
- package/dist/hooks/cursorPreToolUse.js.map +0 -1
- package/dist/hooks/cursorSessionStart.js +0 -71
- package/dist/hooks/cursorSessionStart.js.map +0 -1
- package/dist/hooks/sessionStart.js +0 -209
- package/dist/hooks/sessionStart.js.map +0 -1
- package/dist/hooks/sessionStop.js +0 -212
- package/dist/hooks/sessionStop.js.map +0 -1
- package/dist/hooks/validateArtifact.js +0 -933
- package/dist/hooks/validateArtifact.js.map +0 -1
- package/dist/registries/artifactRegistry.js.map +0 -1
- package/dist/registries/capabilityContract.js.map +0 -1
- package/dist/registries/packageRegistry.js.map +0 -1
- package/dist/registries/runtimeAdapterRegistry.js +0 -315
- package/dist/registries/runtimeAdapterRegistry.js.map +0 -1
- package/dist/setup/codex.js +0 -1056
- package/dist/setup/codex.js.map +0 -1
- package/dist/setup/copilot.js +0 -227
- package/dist/setup/copilot.js.map +0 -1
- package/dist/setup/cursor.js +0 -127
- package/dist/setup/cursor.js.map +0 -1
- package/dist/setup/doctor.js +0 -1297
- package/dist/setup/doctor.js.map +0 -1
- package/dist/setup/smokeChecks.js.map +0 -1
- package/dist/state/installRoot.js.map +0 -1
- package/dist/state/progressCommit.js +0 -289
- package/dist/state/progressCommit.js.map +0 -1
- package/dist/state/startupAnalysis.js.map +0 -1
- package/dist/upgrade/appModel.js.map +0 -1
- package/dist/upgrade/channels.js.map +0 -1
- package/dist/upgrade/compatibility.js.map +0 -1
- package/dist/upgrade/doctor.js.map +0 -1
- package/dist/upgrade/migrateArtifactsV1ToV2.js +0 -571
- package/dist/upgrade/migrateArtifactsV1ToV2.js.map +0 -1
- package/dist/upgrade/migrateArtifactsV2ToV3.js.map +0 -1
- package/dist/upgrade/projectIntegration.js.map +0 -1
- package/dist/upgrade/runtimeMigration.js.map +0 -1
- package/dist/upgrade/upgradeCommands.js.map +0 -1
- package/dist/upgrade/upgradeOrchestrator.js.map +0 -1
- package/dist/upgrade/versionResolution.js.map +0 -1
- package/dist/validate/appHomeContract.js.map +0 -1
- package/dist/validate/capability.js.map +0 -1
- package/dist/validate/crossCapability.js.map +0 -1
- package/dist/validate/lifecycleAdapters.js +0 -772
- package/dist/validate/lifecycleAdapters.js.map +0 -1
- package/dist/validate/selfAudit.js.map +0 -1
- /package/bundle/skills/agentera/capabilities/{dokumentera → document}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{inspirera → research}/schemas/exit.yaml +0 -0
- /package/bundle/skills/agentera/capabilities/{hej → status}/schemas/exit.yaml +0 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YAML-side violation orchestrators.
|
|
3
|
+
*
|
|
4
|
+
* `validateYamlContent` is the single entry point: parse, walk the
|
|
5
|
+
* schema singleton groups, run sequence validation, apply artifact-
|
|
6
|
+
* specific rules (plan, decisions), and finally run BUDGET and
|
|
7
|
+
* VALIDATION_RULES checks. Lower-level helpers live in `schema.ts`.
|
|
8
|
+
*/
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
import { parseYaml } from "../../core/yaml.js";
|
|
11
|
+
import { resolveSourceRoot } from "../../core/sourceRoot.js";
|
|
12
|
+
import { loadYamlMapping } from "../../core/yaml.js";
|
|
13
|
+
import { expectedSequenceOrder, isMapping, sequenceInOrder, validationRuleSeverity, validateDecisionAlternatives, validateDecisionSatisfaction, validateFullPlanContract, validatePlanDependencies, validatePlanKnownFields, validateSequences, validateSingletonGroup, collectSingletonGroups, wordCount, } from "./schema.js";
|
|
14
|
+
function schemasDirDefault() {
|
|
15
|
+
return path.join(resolveSourceRoot(), "skills", "agentera", "schemas", "artifacts");
|
|
16
|
+
}
|
|
17
|
+
export function validateYamlContent(content, schema, name) {
|
|
18
|
+
const violations = [];
|
|
19
|
+
let data;
|
|
20
|
+
try {
|
|
21
|
+
data = parseYaml(content);
|
|
22
|
+
}
|
|
23
|
+
catch (exc) {
|
|
24
|
+
return [`${name}: invalid YAML: ${exc.message}`];
|
|
25
|
+
}
|
|
26
|
+
if (!isMapping(data)) {
|
|
27
|
+
return [`${name}: root must be a mapping`];
|
|
28
|
+
}
|
|
29
|
+
for (const [group, groupLower, fields] of collectSingletonGroups(schema)) {
|
|
30
|
+
let scope;
|
|
31
|
+
if (groupLower in data && isMapping(data[groupLower])) {
|
|
32
|
+
scope = data[groupLower];
|
|
33
|
+
}
|
|
34
|
+
else if (fields.some((f) => f in data)) {
|
|
35
|
+
scope = data;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
validateSingletonGroup(violations, name, schema, group, scope, groupLower);
|
|
41
|
+
}
|
|
42
|
+
if (name === "plan") {
|
|
43
|
+
validatePlanKnownFields(data, schema, violations);
|
|
44
|
+
validateFullPlanContract(data, violations);
|
|
45
|
+
validatePlanDependencies(data, violations);
|
|
46
|
+
}
|
|
47
|
+
validateSequences(data, schema, name, violations);
|
|
48
|
+
if (name === "decisions") {
|
|
49
|
+
violations.push(...validateDecisionAlternatives(data, name));
|
|
50
|
+
violations.push(...validateDecisionSatisfaction(data, name));
|
|
51
|
+
}
|
|
52
|
+
const wordBudgetSeverity = validationRuleSeverity(schema, "word_budget");
|
|
53
|
+
for (const be of Object.values(schema.BUDGET ?? {})) {
|
|
54
|
+
if (!isMapping(be))
|
|
55
|
+
continue;
|
|
56
|
+
const mw = be.max_words;
|
|
57
|
+
const scope = be.scope ?? "";
|
|
58
|
+
if (mw && String(scope).includes("full_file") && wordBudgetSeverity === "error") {
|
|
59
|
+
const wc = wordCount(content);
|
|
60
|
+
if (wc > Number(mw))
|
|
61
|
+
violations.push(`${name}: word count (${wc}) exceeds budget (${mw})`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
for (const groupKey of ["VALIDATION", "VALIDATION_RULES"]) {
|
|
65
|
+
for (const ve of Object.values(schema[groupKey] ?? {})) {
|
|
66
|
+
if (!isMapping(ve))
|
|
67
|
+
continue;
|
|
68
|
+
const rule = String(ve.rule ?? "");
|
|
69
|
+
if (ve.severity !== "error")
|
|
70
|
+
continue;
|
|
71
|
+
if (rule.includes("unique") && rule.includes("number")) {
|
|
72
|
+
for (const [key, val] of Object.entries(data)) {
|
|
73
|
+
if (Array.isArray(val)) {
|
|
74
|
+
const nums = val
|
|
75
|
+
.filter((e) => isMapping(e) && "number" in e)
|
|
76
|
+
.map((e) => e.number);
|
|
77
|
+
if (nums.length > 0) {
|
|
78
|
+
if (nums.length !== new Set(nums).size) {
|
|
79
|
+
violations.push(`${name}: duplicate numbers in '${key}'`);
|
|
80
|
+
}
|
|
81
|
+
const direction = expectedSequenceOrder(name, key);
|
|
82
|
+
if (!sequenceInOrder(nums, direction)) {
|
|
83
|
+
violations.push(`${name}: '${key}' not in ${direction} order`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else if (rule === "closure_consistency") {
|
|
90
|
+
const header = isMapping(data.header) ? data.header : {};
|
|
91
|
+
const status = data.status ?? header.status;
|
|
92
|
+
if (typeof status === "string" && status === "closed") {
|
|
93
|
+
for (const field of ["closed_at", "final_value", "target_ref", "reason"]) {
|
|
94
|
+
let val = data[field];
|
|
95
|
+
if (val === null || val === undefined)
|
|
96
|
+
val = header[field];
|
|
97
|
+
if (val === null || val === undefined || (typeof val === "string" && !val.trim())) {
|
|
98
|
+
violations.push(`${name}: closure field '${field}' is required when status is 'closed'`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return violations;
|
|
106
|
+
}
|
|
107
|
+
export { loadYamlMapping, schemasDirDefault };
|
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { isLifecycleOwnershipStateDirectory } from "../runtime/lifecycleOwnershipJournal.js";
|
|
4
|
+
import { AGENTERA_PROFILE_DIR_ENV, PROFILERA_PROFILE_DIR_ENV, resolveProfileDirOverride, } from "../core/envPaths.js";
|
|
5
|
+
import { expanduser, isFile, pathExists, resolvePath } from "../core/paths.js";
|
|
6
|
+
import { opencodeConfigDir } from "../setup/opencode.js";
|
|
7
|
+
import { doctorRoots, loadSuiteVersion } from "../upgrade/appModel.js";
|
|
8
|
+
import { MANAGED_APP_CONTENT_ROOT_ENTRIES } from "../upgrade/appContentRefresh.js";
|
|
9
|
+
import { AGENTERA_USER_STATE_NAMES, ROOT_USER_STATE_DIR_NAMES, ROOT_USER_STATE_FILE_NAMES, } from "../upgrade/doctor.js";
|
|
10
|
+
export const V2_HANDOFF_MANIFEST_FILENAME = "v3-handoff.json";
|
|
11
|
+
export const V2_HANDOFF_SCHEMA_VERSION = "agentera.v3_handoff_manifest.v1";
|
|
12
|
+
export const READER_PREFLIGHT_BUDGET_MS = 100;
|
|
13
|
+
export const USER_DATA_CATALOG_DIRS = [
|
|
14
|
+
"benchmarks",
|
|
15
|
+
"intermediate",
|
|
16
|
+
"sessions",
|
|
17
|
+
"history",
|
|
18
|
+
"corpus",
|
|
19
|
+
];
|
|
20
|
+
export const PROFILE_FILE_MEMBERS = ["PROFILE.md", "USAGE.md"];
|
|
21
|
+
function isRecord(value) {
|
|
22
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
23
|
+
}
|
|
24
|
+
function asNonEmptyString(value, field) {
|
|
25
|
+
if (typeof value !== "string" || !value.trim()) {
|
|
26
|
+
throw new Error(`${field} must be a non-empty string`);
|
|
27
|
+
}
|
|
28
|
+
return value.trim();
|
|
29
|
+
}
|
|
30
|
+
function parseDirectoryEntry(raw) {
|
|
31
|
+
const id = asNonEmptyString(raw.id, "user_data_inventory.id");
|
|
32
|
+
if (!USER_DATA_CATALOG_DIRS.includes(id)) {
|
|
33
|
+
throw new Error(`user_data_inventory id ${id} is not in the catalog`);
|
|
34
|
+
}
|
|
35
|
+
if (raw.kind !== "directory") {
|
|
36
|
+
throw new Error(`user_data_inventory entry ${id} must have kind=directory`);
|
|
37
|
+
}
|
|
38
|
+
if (typeof raw.exists !== "boolean") {
|
|
39
|
+
throw new Error(`user_data_inventory entry ${id} must have boolean exists`);
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
id: id,
|
|
43
|
+
relative_path: asNonEmptyString(raw.relative_path, `user_data_inventory.${id}.relative_path`),
|
|
44
|
+
kind: "directory",
|
|
45
|
+
exists: raw.exists,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function parseProfileFilesEntry(raw) {
|
|
49
|
+
if (raw.id !== "profile_files") {
|
|
50
|
+
throw new Error("profile_files entry must have id=profile_files");
|
|
51
|
+
}
|
|
52
|
+
if (raw.kind !== "profile_files") {
|
|
53
|
+
throw new Error("profile_files entry must have kind=profile_files");
|
|
54
|
+
}
|
|
55
|
+
if (!Array.isArray(raw.members)) {
|
|
56
|
+
throw new Error("profile_files entry must have members array");
|
|
57
|
+
}
|
|
58
|
+
const members = raw.members.map((member, index) => {
|
|
59
|
+
if (!isRecord(member)) {
|
|
60
|
+
throw new Error(`profile_files.members[${index}] must be an object`);
|
|
61
|
+
}
|
|
62
|
+
if (member.kind !== "file") {
|
|
63
|
+
throw new Error(`profile_files.members[${index}] must have kind=file`);
|
|
64
|
+
}
|
|
65
|
+
if (typeof member.exists !== "boolean") {
|
|
66
|
+
throw new Error(`profile_files.members[${index}] must have boolean exists`);
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
relative_path: asNonEmptyString(member.relative_path, `profile_files.members[${index}].relative_path`),
|
|
70
|
+
kind: "file",
|
|
71
|
+
exists: member.exists,
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
return { id: "profile_files", kind: "profile_files", members };
|
|
75
|
+
}
|
|
76
|
+
function parseUserDataInventory(raw) {
|
|
77
|
+
if (!Array.isArray(raw) || raw.length < 6) {
|
|
78
|
+
throw new Error("user_data_inventory must be an array with at least six entries");
|
|
79
|
+
}
|
|
80
|
+
const entries = raw.map((item, index) => {
|
|
81
|
+
if (!isRecord(item)) {
|
|
82
|
+
throw new Error(`user_data_inventory[${index}] must be an object`);
|
|
83
|
+
}
|
|
84
|
+
if (item.kind === "profile_files") {
|
|
85
|
+
return parseProfileFilesEntry(item);
|
|
86
|
+
}
|
|
87
|
+
return parseDirectoryEntry(item);
|
|
88
|
+
});
|
|
89
|
+
const ids = new Set(entries.map((entry) => entry.id));
|
|
90
|
+
for (const id of [...USER_DATA_CATALOG_DIRS, "profile_files"]) {
|
|
91
|
+
if (!ids.has(id)) {
|
|
92
|
+
throw new Error(`user_data_inventory missing catalog id ${id}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return entries;
|
|
96
|
+
}
|
|
97
|
+
export function parseV2HandoffManifest(raw) {
|
|
98
|
+
if (!isRecord(raw)) {
|
|
99
|
+
throw new Error("manifest must be a JSON object");
|
|
100
|
+
}
|
|
101
|
+
const schemaVersion = asNonEmptyString(raw.schema_version, "schema_version");
|
|
102
|
+
if (schemaVersion !== V2_HANDOFF_SCHEMA_VERSION) {
|
|
103
|
+
throw new Error(`schema_version must be ${V2_HANDOFF_SCHEMA_VERSION}`);
|
|
104
|
+
}
|
|
105
|
+
const writtenAt = asNonEmptyString(raw.written_at, "written_at");
|
|
106
|
+
if (Number.isNaN(Date.parse(writtenAt))) {
|
|
107
|
+
throw new Error("written_at must be an ISO-8601 UTC timestamp");
|
|
108
|
+
}
|
|
109
|
+
if (!Array.isArray(raw.runtime_adapters)) {
|
|
110
|
+
throw new Error("runtime_adapters must be an array");
|
|
111
|
+
}
|
|
112
|
+
const runtimeAdapters = raw.runtime_adapters.map((adapter, index) => asNonEmptyString(adapter, `runtime_adapters[${index}]`));
|
|
113
|
+
return {
|
|
114
|
+
schema_version: V2_HANDOFF_SCHEMA_VERSION,
|
|
115
|
+
written_at: writtenAt,
|
|
116
|
+
installed_v2_version: asNonEmptyString(raw.installed_v2_version, "installed_v2_version"),
|
|
117
|
+
app_home_path: asNonEmptyString(raw.app_home_path, "app_home_path"),
|
|
118
|
+
user_data_inventory: parseUserDataInventory(raw.user_data_inventory),
|
|
119
|
+
runtime_adapters: runtimeAdapters,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export function v2HandoffManifestPath(appHome) {
|
|
123
|
+
return path.join(resolvePath(appHome), V2_HANDOFF_MANIFEST_FILENAME);
|
|
124
|
+
}
|
|
125
|
+
export function readV2HandoffManifestFile(appHome) {
|
|
126
|
+
const manifestPath = v2HandoffManifestPath(appHome);
|
|
127
|
+
if (!isFile(manifestPath)) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
const started = performance.now();
|
|
131
|
+
let parsed;
|
|
132
|
+
try {
|
|
133
|
+
parsed = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
|
134
|
+
}
|
|
135
|
+
catch (exc) {
|
|
136
|
+
throw new Error(`failed to read ${V2_HANDOFF_MANIFEST_FILENAME}: ${exc.message}`);
|
|
137
|
+
}
|
|
138
|
+
const manifest = parseV2HandoffManifest(parsed);
|
|
139
|
+
const elapsedMs = performance.now() - started;
|
|
140
|
+
return { manifest, elapsedMs };
|
|
141
|
+
}
|
|
142
|
+
function agenteraUserStateDirIsRecognized(dir) {
|
|
143
|
+
if (!pathExists(dir) || !fs.statSync(dir).isDirectory()) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
for (const entry of fs.readdirSync(dir)) {
|
|
147
|
+
const full = path.join(dir, entry);
|
|
148
|
+
const st = fs.statSync(full);
|
|
149
|
+
if (AGENTERA_USER_STATE_NAMES.has(entry) && st.isFile()) {
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
if ((entry === "optimize" || entry === "optimera") && st.isDirectory()) {
|
|
153
|
+
// "optimera" is the v2 stable legacy objective dir name; keep it
|
|
154
|
+
// recognized so v2->v3 migration preserves legacy objective state.
|
|
155
|
+
continue;
|
|
156
|
+
}
|
|
157
|
+
if (entry === "runtime-lifecycle" && isLifecycleOwnershipStateDirectory(full)) {
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
function isPreservedUserStateEntry(appHome, entry) {
|
|
165
|
+
const full = path.join(appHome, entry);
|
|
166
|
+
if (!pathExists(full)) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
const st = fs.statSync(full);
|
|
170
|
+
if (ROOT_USER_STATE_FILE_NAMES.has(entry) && st.isFile()) {
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
if (ROOT_USER_STATE_DIR_NAMES.has(entry) && st.isDirectory()) {
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
if (entry === ".agentera" && agenteraUserStateDirIsRecognized(full)) {
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
if (USER_DATA_CATALOG_DIRS.includes(entry) &&
|
|
180
|
+
st.isDirectory()) {
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
function listPreservedTopLevelFromScan(appHome) {
|
|
186
|
+
if (!pathExists(appHome)) {
|
|
187
|
+
return [];
|
|
188
|
+
}
|
|
189
|
+
const preserved = [];
|
|
190
|
+
for (const entry of fs.readdirSync(appHome)) {
|
|
191
|
+
if (entry === "app" || entry === V2_HANDOFF_MANIFEST_FILENAME) {
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
if (isPreservedUserStateEntry(appHome, entry)) {
|
|
195
|
+
preserved.push(entry);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return preserved.sort();
|
|
199
|
+
}
|
|
200
|
+
function listPreservedAbsolutePathsFromScan(appHome) {
|
|
201
|
+
const preserved = [];
|
|
202
|
+
for (const entry of listPreservedTopLevelFromScan(appHome)) {
|
|
203
|
+
const full = path.join(appHome, entry);
|
|
204
|
+
preserved.push(full);
|
|
205
|
+
if (entry === ".agentera" && pathExists(full) && fs.statSync(full).isDirectory()) {
|
|
206
|
+
for (const name of AGENTERA_USER_STATE_NAMES) {
|
|
207
|
+
const nested = path.join(full, name);
|
|
208
|
+
if (isFile(nested)) {
|
|
209
|
+
preserved.push(nested);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return preserved.sort();
|
|
215
|
+
}
|
|
216
|
+
function listPreservedTopLevelFromManifest(manifest) {
|
|
217
|
+
const preserved = new Set();
|
|
218
|
+
for (const entry of manifest.user_data_inventory) {
|
|
219
|
+
if (entry.kind === "directory" && entry.exists) {
|
|
220
|
+
preserved.add(entry.relative_path);
|
|
221
|
+
}
|
|
222
|
+
if (entry.kind === "profile_files") {
|
|
223
|
+
for (const member of entry.members) {
|
|
224
|
+
if (member.exists) {
|
|
225
|
+
preserved.add(member.relative_path);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return [...preserved].sort();
|
|
231
|
+
}
|
|
232
|
+
function listPreservedAbsolutePathsFromManifest(manifest, appHome) {
|
|
233
|
+
const root = resolvePath(appHome);
|
|
234
|
+
const preserved = [];
|
|
235
|
+
for (const rel of listPreservedTopLevelFromManifest(manifest)) {
|
|
236
|
+
preserved.push(path.join(root, rel));
|
|
237
|
+
}
|
|
238
|
+
const agenteraDir = path.join(root, ".agentera");
|
|
239
|
+
if (pathExists(agenteraDir) && fs.statSync(agenteraDir).isDirectory()) {
|
|
240
|
+
preserved.push(agenteraDir);
|
|
241
|
+
for (const name of AGENTERA_USER_STATE_NAMES) {
|
|
242
|
+
const nested = path.join(agenteraDir, name);
|
|
243
|
+
if (isFile(nested)) {
|
|
244
|
+
preserved.push(nested);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return preserved.sort();
|
|
249
|
+
}
|
|
250
|
+
export function isManifestCatalogEntryPreserved(manifest, entry) {
|
|
251
|
+
for (const item of manifest.user_data_inventory) {
|
|
252
|
+
if (item.kind === "directory" && item.relative_path === entry) {
|
|
253
|
+
return item.exists;
|
|
254
|
+
}
|
|
255
|
+
if (item.kind === "profile_files") {
|
|
256
|
+
for (const member of item.members) {
|
|
257
|
+
if (member.relative_path === entry) {
|
|
258
|
+
return member.exists;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
if (entry === ".agentera") {
|
|
264
|
+
const agenteraDir = path.join(resolvePath(manifest.app_home_path), ".agentera");
|
|
265
|
+
return agenteraUserStateDirIsRecognized(agenteraDir);
|
|
266
|
+
}
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
function profileDirEnvVar(env) {
|
|
270
|
+
if (env[AGENTERA_PROFILE_DIR_ENV]) {
|
|
271
|
+
return AGENTERA_PROFILE_DIR_ENV;
|
|
272
|
+
}
|
|
273
|
+
if (env[PROFILERA_PROFILE_DIR_ENV]) {
|
|
274
|
+
return PROFILERA_PROFILE_DIR_ENV;
|
|
275
|
+
}
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
function opencodeConfigDirEnvVar(env) {
|
|
279
|
+
if (env.OPENCODE_CONFIG_DIR) {
|
|
280
|
+
return "OPENCODE_CONFIG_DIR";
|
|
281
|
+
}
|
|
282
|
+
if (env.XDG_CONFIG_HOME) {
|
|
283
|
+
return "XDG_CONFIG_HOME";
|
|
284
|
+
}
|
|
285
|
+
return null;
|
|
286
|
+
}
|
|
287
|
+
function listUserDataPathsAtRoot(root) {
|
|
288
|
+
const preserved = new Set([root]);
|
|
289
|
+
for (const dir of USER_DATA_CATALOG_DIRS) {
|
|
290
|
+
const full = path.join(root, dir);
|
|
291
|
+
if (pathExists(full) && fs.statSync(full).isDirectory()) {
|
|
292
|
+
preserved.add(full);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
for (const file of PROFILE_FILE_MEMBERS) {
|
|
296
|
+
const full = path.join(root, file);
|
|
297
|
+
if (isFile(full)) {
|
|
298
|
+
preserved.add(full);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return [...preserved].sort();
|
|
302
|
+
}
|
|
303
|
+
function opencodeConfigDirHasArtifacts(configDir) {
|
|
304
|
+
if (isFile(path.join(configDir, "plugins", "agentera.js"))) {
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
307
|
+
const agentsDir = path.join(configDir, "agents");
|
|
308
|
+
if (pathExists(agentsDir) && fs.statSync(agentsDir).isDirectory()) {
|
|
309
|
+
if (fs.readdirSync(agentsDir).some((name) => isFile(path.join(agentsDir, name)))) {
|
|
310
|
+
return true;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return pathExists(path.join(configDir, "skills", "agentera"));
|
|
314
|
+
}
|
|
315
|
+
function listOpencodeConfigCatalog(configDir) {
|
|
316
|
+
const preserved = new Set([configDir]);
|
|
317
|
+
for (const rel of ["plugins/agentera.js", "agents", "commands", "skills"]) {
|
|
318
|
+
const full = path.join(configDir, rel);
|
|
319
|
+
if (pathExists(full)) {
|
|
320
|
+
preserved.add(full);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return [...preserved].sort();
|
|
324
|
+
}
|
|
325
|
+
export function buildExternalHandoffCatalog(appHome, opts) {
|
|
326
|
+
if (!opts?.env) {
|
|
327
|
+
return [];
|
|
328
|
+
}
|
|
329
|
+
const env = opts.env;
|
|
330
|
+
const home = resolvePath(opts.home ?? appHome);
|
|
331
|
+
const resolvedAppHome = resolvePath(appHome);
|
|
332
|
+
const catalog = [];
|
|
333
|
+
const profileEnvVar = profileDirEnvVar(env);
|
|
334
|
+
const profileOverride = resolveProfileDirOverride(env);
|
|
335
|
+
if (profileEnvVar && profileOverride) {
|
|
336
|
+
const profileDir = resolvePath(expanduser(profileOverride));
|
|
337
|
+
if (profileDir !== resolvedAppHome) {
|
|
338
|
+
catalog.push({
|
|
339
|
+
surface: "custom_profile_dir",
|
|
340
|
+
root: profileDir,
|
|
341
|
+
envVar: profileEnvVar,
|
|
342
|
+
entries: listUserDataPathsAtRoot(profileDir),
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
const opencodeEnvVar = opencodeConfigDirEnvVar(env);
|
|
347
|
+
if (opencodeEnvVar) {
|
|
348
|
+
const configDir = opencodeConfigDir(home, env);
|
|
349
|
+
const defaultDir = resolvePath(path.join(home, ".config", "opencode"));
|
|
350
|
+
if (configDir !== defaultDir && opencodeConfigDirHasArtifacts(configDir)) {
|
|
351
|
+
catalog.push({
|
|
352
|
+
surface: "opencode_runtime_config_dir",
|
|
353
|
+
root: configDir,
|
|
354
|
+
envVar: opencodeEnvVar,
|
|
355
|
+
entries: listOpencodeConfigCatalog(configDir),
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
return catalog;
|
|
360
|
+
}
|
|
361
|
+
function mergePreservedAbsolutePaths(base, handoffCatalog) {
|
|
362
|
+
const merged = new Set(base);
|
|
363
|
+
for (const entry of handoffCatalog) {
|
|
364
|
+
for (const absolutePath of entry.entries) {
|
|
365
|
+
merged.add(absolutePath);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return [...merged].sort();
|
|
369
|
+
}
|
|
370
|
+
export function handoffCatalogMessage(entry) {
|
|
371
|
+
if (entry.surface === "custom_profile_dir") {
|
|
372
|
+
return `custom profile dir (${entry.envVar}=${entry.root}) cataloged for v2→v3 handoff`;
|
|
373
|
+
}
|
|
374
|
+
return `opencode runtime config dir (${entry.envVar} → ${entry.root}) cataloged for v2→v3 handoff`;
|
|
375
|
+
}
|
|
376
|
+
export function resolveMigrationUserStatePreflight(appHome, opts) {
|
|
377
|
+
const resolvedHome = resolvePath(appHome);
|
|
378
|
+
const handoffCatalog = buildExternalHandoffCatalog(resolvedHome, opts);
|
|
379
|
+
const manifestRead = readV2HandoffManifestFile(resolvedHome);
|
|
380
|
+
if (manifestRead) {
|
|
381
|
+
return {
|
|
382
|
+
source: "manifest",
|
|
383
|
+
elapsedMs: manifestRead.elapsedMs,
|
|
384
|
+
manifest: manifestRead.manifest,
|
|
385
|
+
preservedTopLevel: listPreservedTopLevelFromManifest(manifestRead.manifest),
|
|
386
|
+
preservedAbsolutePaths: mergePreservedAbsolutePaths(listPreservedAbsolutePathsFromManifest(manifestRead.manifest, resolvedHome), handoffCatalog),
|
|
387
|
+
handoffCatalog,
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
const started = performance.now();
|
|
391
|
+
const preservedTopLevel = listPreservedTopLevelFromScan(resolvedHome);
|
|
392
|
+
const preservedAbsolutePaths = mergePreservedAbsolutePaths(listPreservedAbsolutePathsFromScan(resolvedHome), handoffCatalog);
|
|
393
|
+
return {
|
|
394
|
+
source: "scan",
|
|
395
|
+
elapsedMs: performance.now() - started,
|
|
396
|
+
manifest: null,
|
|
397
|
+
preservedTopLevel,
|
|
398
|
+
preservedAbsolutePaths,
|
|
399
|
+
handoffCatalog,
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
export function appHomeHasUnrecognizedEntriesWithPreflight(appHome, preflight) {
|
|
403
|
+
if (!pathExists(appHome)) {
|
|
404
|
+
return [];
|
|
405
|
+
}
|
|
406
|
+
const unknown = [];
|
|
407
|
+
for (const entry of fs.readdirSync(appHome)) {
|
|
408
|
+
if (entry === "app" || entry === V2_HANDOFF_MANIFEST_FILENAME) {
|
|
409
|
+
continue;
|
|
410
|
+
}
|
|
411
|
+
if (MANAGED_APP_CONTENT_ROOT_ENTRIES.has(entry)) {
|
|
412
|
+
continue;
|
|
413
|
+
}
|
|
414
|
+
if (preflight.source === "manifest" && preflight.manifest) {
|
|
415
|
+
if (isManifestCatalogEntryPreserved(preflight.manifest, entry)) {
|
|
416
|
+
continue;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
else if (isPreservedUserStateEntry(appHome, entry)) {
|
|
420
|
+
continue;
|
|
421
|
+
}
|
|
422
|
+
unknown.push(entry);
|
|
423
|
+
}
|
|
424
|
+
return unknown;
|
|
425
|
+
}
|
|
426
|
+
export function isV2HandoffManifestStale(manifest, ctx) {
|
|
427
|
+
if (resolvePath(manifest.app_home_path) !== resolvePath(ctx.appHome)) {
|
|
428
|
+
return true;
|
|
429
|
+
}
|
|
430
|
+
if (manifest.installed_v2_version !== ctx.installedVersion) {
|
|
431
|
+
return true;
|
|
432
|
+
}
|
|
433
|
+
const writtenAtMs = Date.parse(manifest.written_at);
|
|
434
|
+
const markerMs = ctx.bundleMarkerMtimeMs;
|
|
435
|
+
if (Number.isNaN(writtenAtMs) || Math.floor(writtenAtMs / 1000) < Math.floor(markerMs / 1000)) {
|
|
436
|
+
return true;
|
|
437
|
+
}
|
|
438
|
+
return false;
|
|
439
|
+
}
|
|
440
|
+
export function bundleMarkerFreshnessContext(appHome, sourceRoot) {
|
|
441
|
+
const roots = doctorRoots(appHome);
|
|
442
|
+
const markerPath = path.join(roots.activeBundleRoot, ".agentera-bundle.json");
|
|
443
|
+
if (!isFile(markerPath)) {
|
|
444
|
+
return null;
|
|
445
|
+
}
|
|
446
|
+
const installedVersion = loadSuiteVersion(roots.activeBundleRoot) ?? loadSuiteVersion(sourceRoot) ?? "unknown";
|
|
447
|
+
return {
|
|
448
|
+
appHome: resolvePath(appHome),
|
|
449
|
+
installedVersion,
|
|
450
|
+
bundleMarkerMtimeMs: fs.statSync(markerPath).mtimeMs,
|
|
451
|
+
};
|
|
452
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { ACTIVATION_CENSUS_AUTHORITY, ACTIVATION_CHECK_IDS, ACTIVATION_CLASSES, ACTIVATION_CLASS_AUTHORITIES, ACTIVATION_DIMENSIONS, ACTIVATION_EVIDENCE_SOURCES, } from "./packagePublication.js";
|
|
2
|
+
export { ACTIVATION_CANONICAL_TUPLES, ACTIVATION_TUPLE_AUTHORITY, canonicalTupleJson, digestCanonicalTuples, } from "./activationTuples.js";
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { gunzipSync } from "node:zlib";
|
|
3
|
+
// This compressed literal is the immutable, code-owned tuple catalog. It expands
|
|
4
|
+
// only into exact tuple records; no production loader participates in authority.
|
|
5
|
+
const CATALOG = [
|
|
6
|
+
"H4sIAAAAAAACA+1dW3PiOBZ+319B8TyGqd23bO1DOs32ZDed9JJMV01NpihhC1DHWG7JZsJMzX9fyTdssEEm7uYcwUsugI4/fd/R",
|
|
7
|
+
"7egg/fpb71+9X//W6/3Zd30iZf9K/Wb9H/oyFjPi0gnz1EuhYEuqXuS/B1RMQhIt9IvEfSFzKoeqwFAKN/ntManedhdDly+XJPDk",
|
|
8
|
+
"IJJFQbleTrk/4eov6lM34kKZeX/7+On66ean0Xjy9PBpcjf6PLqb3Dx8/Hh9//5xU7QoEMS+r+BRZT1ibvHGhM0mJFjn77sk4AFz",
|
|
9
|
+
"iT9xuR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5bl",
|
|
66
|
+
"EkLUa0llAPKsr8CHmWSXL0MuGWyHroJEvYKM/YiFkKN+JYSo4yPxVEYsimE79hZK1J5NfB1uoF66OwrYwXeA2kG7uyBBQH0MxG+g",
|
|
67
|
+
"wqD+t/8DfpAaejqfAQA=",
|
|
68
|
+
].join("");
|
|
69
|
+
// Emitted producers carry `reason`, while generated files carry
|
|
70
|
+
// `command_authority_reason`. This immutable patch catalog intentionally updates
|
|
71
|
+
// the M6 tuple payload without consulting the mutable package registry loader.
|
|
72
|
+
const EMITTED_REASON_CATALOG = "H4sIAAAAAAACA8VYXXPrJhD9K0ye6+v3+9Z8zPShHbfx7X1HsJaYYFAAqfZ0+t+7fEhCsRNbTiy/xAIUnbMLu3uWf+9gK5wD/r2m7IWWYJdMiqU1bMloTQshhRM4KRSH3Tdn777fPehtLcEB6V/Yk0JzfItQxYl11LimJkxvtzi2pKbWElcZ3ZQV/gKxFTXASW1gwRqnWzD4srLONMxpk76iG8NgmUgR3bi6ccQyquy3u18+II2/tRFbWBRSF28IIzUnGAnrpGwEp4pB4AdHGYpESmi1QAv3Oc1Ps6xA1pHfb/hEYEc9y/fdlfx5wIF11vkPJgroQwNv2XlaCvhJYltRGuptfobXRiB0ZPkHZZVQQAwwv2V7shEgcXt7PmgC4H7SQmbO1Urue2twxx/ihj9EY05y0UaAcoHNmEW2MAuRWlL1u9gA2zMJawSGMR/Zrc3Cxh9k+KvBXRizePVTww7VRlsYmNhrUHGa62egHOGtXYMEdrhZP1aPK2TlcM9aKq/uIQOlsB7MLqt9YQR/xqiAZ2AgaheZhRnvKD/VpyzauAoPltt/zmchLCtqSQEVbYU2aHNKDawC9nI6NwyZ9UErBzu3LECxakvNS0ppWertVmY5eUeYNUKmFHHvHz2+X7gRHSbxzKO3k5/S6Nak8NdQ5g42r1u4ES9oBcfjk3LZUxrd2FnaYJQgYJb1V/nUjenFchx5rVNpHjb0NpzcvgYbKf3AR042VMoC/5dw2NBGuvm9FFPqr2WJ2TjbyXWXalsqZOc0ny+5sF+nK1IGboHQRACmZuCkXjPTjgRvBJtVEfXEgoqNnP4MgrajwwUtlbaodL/Kicdl7lRPvg56JUiXnvCsbjO+8uci4Hpuu7j8YyzU1LEq77oe0xw2S/156756VYHXk+klbiTUq+GZ+YwDIO8QVgG+qxhDf5BozR+dOJReED8ph/li9baXidOjVuZ2VIOMewowqfXDgpvLOhOnvixOJhNEN20OfHjvZ2ftBguhljiBZc7QVHKxSc9AcMn3XlooR+qmkMKidiF8iN+0ya6i+MdQZYUTLcioBqlQFnlSw7Oev+M9vRAPDIelRS+gKKPcx+8CdrU2LgeOb2AHyRsG5rKWxdb6JWWL+zjIpVLCsGMfJI8duCBu6wU0shz6jhvCG9fyQhJCY/XTfdjfPG0LfxSPuADsxU44moWy2MkuMPJEGa4Vrk7KYhBsU+isw3MfER8D/oOtebgrnBoUPbK3b8k1S1r5EZ8W0ejzGHwWuoQUkE87bPoWODwTeLg8uRT6TRhEqzt73o2A+NqE8z8GRStcpxbsfLb6O6lkqr95uj5sU5cGM2nE/DsOzoZN4uli1J9gxGY/xm79nGAjUXE9Im3G4Od05MlR1dXS4Thn1fX9opbYnH+ae+kbdHvq//xjj3fEGjxBaEYwf9QcRvTzMQ/6uw8wuwvMqRh2qAOhJJzA6PPkhwg+hvKL1yccN5lk85NClQT6+VMHpDMPd64FdfKIDEnAJ/igskV/PRKvorEAMyzT0+LjMD/89z8hk4jWPxsAAA==";
|
|
73
|
+
const decodedCatalog = gunzipSync(Buffer.from(CATALOG, "base64")).toString("utf8");
|
|
74
|
+
const emittedReasons = JSON.parse(gunzipSync(Buffer.from(EMITTED_REASON_CATALOG, "base64")).toString("utf8"));
|
|
75
|
+
const rawTuples = JSON.parse(decodedCatalog.slice(decodedCatalog.indexOf("[", 2)).replace(/,\s*]$/, "]"));
|
|
76
|
+
const addedTuples = [
|
|
77
|
+
{ class: "state", surface_id: "write:todo.activate", owner_path: "packages/cli/src/state/write/runtimeOperations.ts", owner_symbol_or_selector: "runtimeOperationSpecs", owner_selector: "todo.activate", semantic_selector_if_any: null, canonical_correction: "node packages/cli/dist/bin/agentera.js check validate state --format json" },
|
|
78
|
+
{ class: "state", surface_id: "write:todo.repair", owner_path: "packages/cli/src/state/write/runtimeOperations.ts", owner_symbol_or_selector: "runtimeOperationSpecs", owner_selector: "todo.repair", semantic_selector_if_any: null, canonical_correction: "node packages/cli/dist/bin/agentera.js check validate state --format json" },
|
|
79
|
+
{ class: "package", surface_id: "emitted:packages/cli/src/cli/commands/doctor.ts", owner_path: "packages/cli/src/registries/packageRegistry.ts", owner_symbol_or_selector: "loadRegistry", owner_selector: "packages/cli/src/cli/commands/doctor.ts", semantic_selector_if_any: JSON.stringify({ path: "packages/cli/src/cli/commands/doctor.ts", selector: null, format: null, classification: null, reason: "Doctor project-state signals publish bounded reconciliation preview and apply guidance." }), canonical_correction: "pnpm -C packages/cli run verify:package" },
|
|
80
|
+
{ class: "package", surface_id: "emitted:packages/cli/src/state/todoReconciliationInspection.ts", owner_path: "packages/cli/src/registries/packageRegistry.ts", owner_symbol_or_selector: "loadRegistry", owner_selector: "packages/cli/src/state/todoReconciliationInspection.ts", semantic_selector_if_any: JSON.stringify({ path: "packages/cli/src/state/todoReconciliationInspection.ts", selector: null, format: null, classification: null, reason: "TODO reconciliation inspection publishes bounded preview and effect-bound apply guidance." }), canonical_correction: "pnpm -C packages/cli run verify:package" },
|
|
81
|
+
];
|
|
82
|
+
const tuples = [...rawTuples, ...addedTuples].map((tuple) => {
|
|
83
|
+
const reason = emittedReasons[tuple.surface_id];
|
|
84
|
+
if (tuple.class !== "package" || reason === undefined || tuple.semantic_selector_if_any === null)
|
|
85
|
+
return tuple;
|
|
86
|
+
const semantic = JSON.parse(tuple.semantic_selector_if_any);
|
|
87
|
+
return { ...tuple, semantic_selector_if_any: JSON.stringify({ ...semantic, reason }) };
|
|
88
|
+
});
|
|
89
|
+
export const ACTIVATION_CANONICAL_TUPLES = Object.freeze(tuples.map((tuple) => Object.freeze(tuple)));
|
|
90
|
+
export const ACTIVATION_TUPLE_AUTHORITY = Object.freeze({
|
|
91
|
+
algorithm: "sha256(sorted_canonical_json_tuples_joined_by_lf)",
|
|
92
|
+
classes: {
|
|
93
|
+
cli: { count: 27, sha256: "9d0db6cafe592da30ea3469c91dc514bdd1b3b22e8229a0519e680cbcb01c2fa" },
|
|
94
|
+
capability: { count: 12, sha256: "892e6e5e2a57b41064bc44fa2946453225f1b1195aff77aad05365fd0a1071c2" },
|
|
95
|
+
runtime: { count: 81, sha256: "99b2abff3ebff889b54b1781c563ab4b32609a479c4e90d6aad854f48fba7edc" },
|
|
96
|
+
reference: { count: 22, sha256: "243fd3c317553f8924c56a52c61af90ccf2793b7b0018af1373b73c69b6c3afb" },
|
|
97
|
+
state: { count: 36, sha256: "c3366cd6d538a47b5554f2e142eb255ac371bfc77e89128aceb59dfd8376c20a" },
|
|
98
|
+
package: { count: 66, sha256: "83e6971af7f7564e42369aaccc445b32a0793bfffade843d149b6abd4fd3dbbc" },
|
|
99
|
+
bootstrap: { count: 34, sha256: "9a7dd7e27110d85cf5c08835fdd8f08119e75579858e63bc6d396c733961d0bc" },
|
|
100
|
+
},
|
|
101
|
+
total: { count: 278, sha256: "52a349aa3901626cba0bef4e06d380067722d73d3039fea95f2d806a8018fe54" },
|
|
102
|
+
});
|
|
103
|
+
export function canonicalTupleJson(value) { return JSON.stringify(value); }
|
|
104
|
+
export function digestCanonicalTuples(values) {
|
|
105
|
+
return createHash("sha256").update(values.map(canonicalTupleJson).sort().join("\n"), "utf8").digest("hex");
|
|
106
|
+
}
|