agentera 3.0.0-dev.41 → 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/README.md +33 -4
- package/bundle/CHANGELOG.md +91 -1
- package/bundle/README.md +26 -19
- package/bundle/UPGRADE.md +50 -15
- package/bundle/references/adapters/package-publication.json +408 -14
- package/bundle/references/adapters/package-registry.yaml +414 -1
- package/bundle/references/adapters/package-surface-characterization.md +20 -0
- package/bundle/references/adapters/runtime-retired-resources.yaml +237 -1
- package/bundle/references/analysis/evidence-tier-authority.yaml +3 -3
- package/bundle/references/analysis/verification-policy.yaml +48 -0
- package/bundle/references/artifacts/artifact-registry-interface-model.yaml +1 -1
- package/bundle/references/artifacts/glossary-entry-contract.yaml +11 -11
- package/bundle/references/artifacts/state-storage-authority.yaml +170 -118
- package/bundle/references/cli/capability-instruction-contract.yaml +4 -4
- package/bundle/references/cli/hybrid-route-contract.yaml +27 -5
- package/bundle/references/cli/routing-model.md +20 -4
- package/bundle/references/cli/trigger-schema-enrichment.md +7 -0
- package/bundle/references/cli/vocabulary-index.yaml +1 -3
- package/bundle/references/cli/vocabulary.md +18 -60
- package/bundle/references/meta/retained-reference-authority.yaml +151 -0
- package/bundle/skills/agentera/SKILL.md +32 -16
- package/bundle/skills/agentera/capabilities/audit/schemas/artifacts.yaml +3 -3
- package/bundle/skills/agentera/capabilities/audit/schemas/validation.yaml +1 -1
- package/bundle/skills/agentera/capabilities/build/schemas/artifacts.yaml +5 -5
- package/bundle/skills/agentera/capabilities/build/schemas/validation.yaml +5 -5
- package/bundle/skills/agentera/capabilities/design/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/discuss/schemas/artifacts.yaml +3 -3
- package/bundle/skills/agentera/capabilities/discuss/schemas/validation.yaml +2 -2
- package/bundle/skills/agentera/capabilities/document/schemas/artifacts.yaml +3 -3
- package/bundle/skills/agentera/capabilities/document/schemas/validation.yaml +1 -1
- package/bundle/skills/agentera/capabilities/optimize/schemas/artifacts.yaml +1 -1
- package/bundle/skills/agentera/capabilities/optimize/schemas/validation.yaml +1 -1
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/artifacts.yaml +5 -5
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/validation.yaml +2 -2
- package/bundle/skills/agentera/capabilities/plan/schemas/artifacts.yaml +1 -1
- package/bundle/skills/agentera/capabilities/plan/schemas/validation.yaml +1 -1
- package/bundle/skills/agentera/capabilities/profile/schemas/validation.yaml +1 -1
- package/bundle/skills/agentera/capability_schema_contract.yaml +2 -2
- package/bundle/skills/agentera/schemas/artifacts/decisions.yaml +3 -3
- package/bundle/skills/agentera/schemas/artifacts/experiments.yaml +3 -3
- package/bundle/skills/agentera/schemas/artifacts/glossary.yaml +1 -1
- package/bundle/skills/agentera/schemas/artifacts/health.yaml +3 -3
- package/bundle/skills/agentera/schemas/artifacts/plan.yaml +12 -10
- package/bundle/skills/agentera/schemas/artifacts/progress.yaml +3 -3
- package/bundle/skills/agentera/schemas/artifacts/todo.yaml +6 -4
- package/dist/analytics/extractCorpus/cli.js +0 -1
- package/dist/analytics/extractCorpus/copilotSessions.js +0 -1
- package/dist/analytics/extractCorpus/core.js +0 -1
- package/dist/analytics/extractCorpus/corpus.js +0 -1
- package/dist/analytics/extractCorpus/coverageAudit.js +0 -1
- package/dist/analytics/extractCorpus/cursorSessions.js +0 -1
- package/dist/analytics/extractCorpus/evidenceTiers.js +0 -1
- package/dist/analytics/extractCorpus/extractCorpusParity.js +0 -1
- package/dist/analytics/extractCorpus/filesystemSources.js +0 -1
- package/dist/analytics/extractCorpus/index.js +0 -1
- package/dist/analytics/extractCorpus/jsonlSessions.js +0 -1
- package/dist/analytics/extractCorpus/sqliteCaps.js +0 -1
- package/dist/analytics/extractCorpus/sqliteSessions.js +0 -1
- package/dist/analytics/extractCorpus/tierReader.js +0 -1
- package/dist/analytics/extractCorpus.js +0 -1
- package/dist/analytics/glossaryAdviceResolution.js +0 -1
- package/dist/analytics/glossaryInputAcquisition.js +0 -1
- package/dist/analytics/personalGlossaryAdmission.js +0 -1
- package/dist/analytics/personalGlossaryProfile.js +0 -1
- package/dist/analytics/profileSignals.js +0 -1
- package/dist/analytics/usageStats.js +0 -1
- package/dist/audit/terminologyDrift.js +0 -1
- package/dist/bin/agentera.js +0 -1
- package/dist/capabilities/audit/instructions.js +3 -4
- package/dist/capabilities/build/instructions.js +2 -3
- package/dist/capabilities/design/instructions.js +1 -2
- package/dist/capabilities/discuss/instructions.js +2 -3
- package/dist/capabilities/document/instructions.js +2 -3
- package/dist/capabilities/index.js +5 -4
- package/dist/capabilities/optimize/instructions.js +1 -2
- package/dist/capabilities/orchestrate/instructions.js +3 -4
- package/dist/capabilities/plan/instructions.js +1 -2
- package/dist/capabilities/profile/instructions.js +1 -2
- package/dist/capabilities/research/instructions.js +1 -2
- package/dist/capabilities/status/instructions.js +1 -2
- package/dist/capabilities/status/startupInstructions.js +0 -5
- package/dist/capabilities/vision/instructions.js +1 -2
- package/dist/cli/appContext.js +0 -1
- package/dist/cli/argvalidate.js +0 -1
- package/dist/cli/capabilityContext/benchmark.js +4 -4
- package/dist/cli/capabilityContext/bespoke.js +0 -1
- package/dist/cli/capabilityContext/build.js +8 -10
- package/dist/cli/capabilityContext/closeout.js +8 -10
- package/dist/cli/capabilityContext/contract.js +7 -42
- package/dist/cli/capabilityContext/evidence.js +12 -14
- package/dist/cli/capabilityContext/index.js +0 -1
- package/dist/cli/capabilityContext/orchestration.js +6 -8
- package/dist/cli/capabilityContext/planState.js +0 -1
- package/dist/cli/capabilityContext/progress.js +0 -1
- package/dist/cli/capabilityContext/projectVerification.js +0 -1
- package/dist/cli/capabilityContext/shared.js +2 -19
- package/dist/cli/capabilityContext/slim.js +0 -1
- package/dist/cli/capabilityContext/startup.js +24 -152
- package/dist/cli/capabilityContext/startupAggregation.js +68 -0
- package/dist/cli/capabilityContext/types.js +4 -4
- package/dist/cli/capabilityContext.js +0 -1
- package/dist/cli/commands/appHome.js +0 -1
- package/dist/cli/commands/capability.js +2 -2
- package/dist/cli/commands/compact.js +0 -1
- package/dist/cli/commands/doctor.js +104 -9
- package/dist/cli/commands/durability.js +0 -1
- package/dist/cli/commands/glossaryAdvice.js +0 -1
- package/dist/cli/commands/lint.js +0 -1
- package/dist/cli/commands/personalGlossary.js +0 -1
- package/dist/cli/commands/prime/briefOrientation.js +24 -85
- package/dist/cli/commands/prime/buildExecutionRequest.js +2 -2
- package/dist/cli/commands/prime/bundleStatus.js +0 -1
- package/dist/cli/commands/prime/collectEntityOrientation.js +47 -27
- package/dist/cli/commands/prime/collectOrientationState.js +36 -2
- package/dist/cli/commands/prime/orientationOutput.js +104 -84
- package/dist/cli/commands/prime/types.js +0 -1
- package/dist/cli/commands/prime/v1Migration.js +0 -1
- package/dist/cli/commands/prime.js +18 -36
- package/dist/cli/commands/profileGrounding.js +0 -1
- package/dist/cli/commands/query.js +2 -2
- package/dist/cli/commands/report.js +0 -1
- package/dist/cli/commands/route.js +3 -3
- package/dist/cli/commands/schema.js +62 -92
- package/dist/cli/commands/state/decisions.js +0 -1
- package/dist/cli/commands/state/docs.js +0 -1
- package/dist/cli/commands/state/experimentRecords.js +0 -1
- package/dist/cli/commands/state/experiments.js +0 -1
- package/dist/cli/commands/state/get.js +0 -1
- package/dist/cli/commands/state/health.js +0 -1
- package/dist/cli/commands/state/index.js +0 -1
- package/dist/cli/commands/state/list.js +0 -1
- package/dist/cli/commands/state/objective.js +0 -1
- package/dist/cli/commands/state/plan.js +0 -1
- package/dist/cli/commands/state/planTasks.js +0 -1
- package/dist/cli/commands/state/plans.js +0 -1
- package/dist/cli/commands/state/progress.js +0 -1
- package/dist/cli/commands/state/shared.js +0 -1
- package/dist/cli/commands/state/todo.js +0 -1
- package/dist/cli/commands/state/write.js +10 -1
- package/dist/cli/commands/upgrade.js +0 -1
- package/dist/cli/commands/upgradeVerify.js +0 -1
- package/dist/cli/commands/validate.js +106 -10
- package/dist/cli/commands/verify.js +0 -1
- package/dist/cli/contracts/bundleStatus.js +0 -1
- package/dist/cli/contracts/orientationState.js +0 -1
- package/dist/cli/dispatch/argvParser.js +0 -1
- package/dist/cli/dispatch/check.js +6 -24
- package/dist/cli/dispatch/commands.js +3 -3
- package/dist/cli/dispatch/index.js +9 -36
- package/dist/cli/dispatch/lifecycle.js +11 -57
- package/dist/cli/dispatch/prime.js +0 -1
- package/dist/cli/dispatch/projections.js +17 -0
- package/dist/cli/dispatch/shared.js +0 -1
- package/dist/cli/dispatch/state.js +0 -1
- package/dist/cli/dispatch.js +0 -1
- package/dist/cli/errors.js +0 -1
- package/dist/cli/help.js +51 -30
- package/dist/cli/migrationRequired.js +3 -5
- package/dist/cli/orientation/attention.js +4 -17
- package/dist/cli/orientation/corpusCoverage.js +0 -1
- package/dist/cli/orientation.js +5 -5
- package/dist/cli/planArtifacts.js +0 -1
- package/dist/cli/planEvidence.js +0 -1
- package/dist/cli/planLifecycleState.js +2 -2
- package/dist/cli/planTaskIndex.js +0 -1
- package/dist/cli/preCutoverCommand.js +32 -0
- package/dist/cli/prime-blob.js +6 -6
- package/dist/cli/profileAcquisition.js +0 -1
- package/dist/cli/startupCompletenessContract.js +0 -1
- package/dist/cli/stateQuery.js +17 -21
- package/dist/cli/structured.js +0 -1
- package/dist/cli/todoMarkdown.js +0 -1
- package/dist/cli/todoReadinessSelection.js +2 -2
- package/dist/cli/todoSeverity.js +0 -1
- package/dist/core/atomicWriter.js +0 -1
- 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 +0 -1
- package/dist/core/jsonValue.js +0 -1
- package/dist/core/paths.js +0 -1
- package/dist/core/pyjson.js +0 -1
- package/dist/core/shell.js +0 -1
- package/dist/core/skillIdentity.js +0 -1
- package/dist/core/sourceRoot.js +9 -12
- package/dist/core/text.js +0 -1
- package/dist/core/toml.js +0 -1
- package/dist/core/yaml.js +0 -1
- package/dist/eval/evalSkills.js +0 -1
- package/dist/eval/hybridRouteEvaluation.js +0 -1
- package/dist/eval/semanticEval.js +0 -1
- package/dist/eval/semanticFixtures.js +0 -1
- package/dist/hooks/common.js +1 -54
- package/dist/hooks/compaction/apply.js +0 -1
- package/dist/hooks/compaction/dryRun.js +0 -1
- package/dist/hooks/compaction/index.js +1 -2
- package/dist/hooks/compaction/parse.js +0 -1
- package/dist/hooks/compaction/retention.js +0 -1
- package/dist/hooks/compaction/status.js +0 -1
- package/dist/hooks/compaction/types.js +0 -1
- package/dist/hooks/validateArtifact/agentFacing.js +0 -1
- package/dist/hooks/validateArtifact/index.js +6 -65
- package/dist/hooks/validateArtifact/markdown.js +0 -1
- package/dist/hooks/validateArtifact/schema.js +0 -1
- package/dist/hooks/validateArtifact/traversal.js +0 -1
- package/dist/hooks/validateArtifact/violations.js +0 -1
- package/dist/migrate/v2HandoffManifest.js +0 -3
- package/dist/registries/activationContract.js +2 -0
- package/dist/registries/activationTuples.js +106 -0
- package/dist/registries/artifactProtocolIds.js +0 -1
- package/dist/registries/artifactRegistry.js +0 -1
- package/dist/registries/artifactSchemaProjection.js +0 -1
- package/dist/registries/capabilityContract.js +0 -1
- package/dist/registries/evaluatorHandoffContract.js +0 -1
- package/dist/registries/evidenceTierContract.js +0 -1
- package/dist/registries/glossaryAdviceContract.js +2 -2
- package/dist/registries/glossaryCaveatContract.js +0 -1
- package/dist/registries/glossaryConsumerContractValidation.js +5 -6
- package/dist/registries/glossaryEntryContract.js +8 -8
- package/dist/registries/glossaryTermIdentity.js +0 -1
- package/dist/registries/glossaryTermOccurrence.js +0 -1
- package/dist/registries/hybridRoute.js +73 -2
- package/dist/registries/hybridRouteReceipt.js +2 -2
- package/dist/registries/packagePublication.js +229 -0
- package/dist/registries/packageRegistry.js +118 -2
- package/dist/registries/todoReadinessContract.js +0 -1
- package/dist/registries/triggerLoader.js +0 -1
- package/dist/registries/verbosityBudgetContract.js +0 -1
- package/dist/release/releaseMetadata.js +69 -3
- package/dist/runtime/lifecycleAdapterContract.js +0 -1
- package/dist/runtime/lifecycleAdapters.js +0 -1
- package/dist/runtime/lifecycleAuthority.js +0 -1
- package/dist/runtime/lifecycleOperationContract.js +12 -3
- package/dist/runtime/lifecycleOperations.js +0 -1
- package/dist/runtime/lifecycleOwnershipJournal.js +0 -1
- package/dist/runtime/lifecyclePublication.js +0 -1
- package/dist/runtime/lifecycleSnapshot.js +0 -1
- package/dist/runtime/nativeResourceCleanup.js +191 -6
- package/dist/setup/opencode.js +0 -1
- package/dist/setup/opencodeConstants.js +0 -1
- package/dist/setup/sharedSkill.js +0 -1
- package/dist/setup/smokeChecks.js +1 -33
- package/dist/state/archiveDiscovery.js +0 -1
- package/dist/state/archivePublication.js +0 -1
- package/dist/state/archiveRecovery.js +0 -1
- package/dist/state/archiveReplay.js +0 -1
- package/dist/state/canonicalMigrationRecord.js +0 -1
- package/dist/state/changelog.js +0 -1
- package/dist/state/decisionEntities.js +0 -1
- package/dist/state/decisionLegacyValidation.js +0 -1
- package/dist/state/decisionMigrationProvenance.js +0 -1
- package/dist/state/decisionOverlay.js +0 -1
- package/dist/state/decisionRevision.js +0 -1
- package/dist/state/decisionRevisionMigration.js +0 -1
- package/dist/state/directRetrieval.js +0 -1
- package/dist/state/durability.js +0 -1
- package/dist/state/entityCutover.js +174 -9
- package/dist/state/entityCutoverGit.js +0 -1
- package/dist/state/entityGlossaryAuthority.js +0 -1
- package/dist/state/entityListProjection.js +0 -1
- package/dist/state/entityListRuntimeRegistry.js +46 -11
- package/dist/state/entityMigrationCausality.js +3 -5
- package/dist/state/entityMigrationIdentity.js +0 -1
- package/dist/state/entityMigrationPreview.js +35 -73
- package/dist/state/entityMigrationTodo.js +133 -0
- package/dist/state/entityPublicationContext.js +0 -1
- package/dist/state/entityRetrievalHelp.js +53 -23
- package/dist/state/entityStorage.js +0 -1
- package/dist/state/exactReplacementRecovery.js +0 -1
- package/dist/state/experimentArchive.js +0 -1
- package/dist/state/experimentIdentity.js +0 -1
- package/dist/state/healthEntities.js +0 -1
- package/dist/state/healthEntityValidation.js +0 -1
- package/dist/state/healthRepair.js +0 -1
- package/dist/state/installRoot.js +0 -1
- package/dist/state/legacyEntityCutoverEvidence.js +0 -1
- package/dist/state/legacyIdentity.js +0 -1
- package/dist/state/legacySummaryRecord.js +0 -1
- package/dist/state/listAccounting.js +0 -1
- package/dist/state/listClassification.js +0 -1
- package/dist/state/listCursor.js +0 -1
- package/dist/state/listRetrieval.js +0 -1
- package/dist/state/migrationSourceBinding.js +0 -1
- package/dist/state/objectiveExperimentEntities.js +0 -1
- package/dist/state/planEntities.js +0 -1
- package/dist/state/planIdentity.js +0 -1
- package/dist/state/planRetrieval.js +0 -1
- package/dist/state/planTaskRetrieval.js +0 -1
- package/dist/state/progressEntities.js +0 -1
- package/dist/state/progressGlossaryCaveat.js +0 -1
- package/dist/state/progressPublicationOrder.js +0 -1
- package/dist/state/projectRoot.js +0 -1
- package/dist/state/projectionPolicy.js +0 -1
- package/dist/state/retrievalAuthority.js +0 -1
- package/dist/state/safeProjectFile.js +0 -1
- package/dist/state/startupAnalysis/benchmark.js +0 -1
- package/dist/state/startupAnalysis/contract.js +44 -10
- package/dist/state/startupAnalysis/helpers.js +0 -1
- package/dist/state/startupAnalysis/index.js +0 -1
- package/dist/state/startupAnalysis/metrics.js +0 -1
- package/dist/state/startupAnalysis/records.js +0 -1
- package/dist/state/startupAnalysis/report.js +0 -1
- package/dist/state/startupAnalysis/threshold.js +0 -1
- package/dist/state/startupAnalysis.js +0 -1
- package/dist/state/startupProjection.js +2 -2
- package/dist/state/stateMode.js +0 -1
- package/dist/state/stateStorageAuthority.js +0 -1
- package/dist/state/summaryEntityRead.js +0 -1
- package/dist/state/summaryMigrationProvenance.js +0 -1
- package/dist/state/summarySourceRowAuthority.js +0 -1
- package/dist/state/todoDocsEntities.js +161 -83
- package/dist/state/todoDocsEntityValidation.js +0 -1
- package/dist/state/todoMarkdownProjection.js +51 -0
- package/dist/state/todoReconciliationActivation.js +73 -4
- package/dist/state/todoReconciliationInspection.js +173 -0
- package/dist/state/todoReconciliationRepair.js +170 -0
- package/dist/state/todoReconciliationTransaction.js +41 -13
- package/dist/state/write/assign.js +0 -1
- package/dist/state/write/candidateMutation.js +0 -1
- package/dist/state/write/errors.js +0 -1
- package/dist/state/write/experimentPublication.js +0 -1
- package/dist/state/write/explain.js +0 -1
- package/dist/state/write/fields.js +0 -1
- package/dist/state/write/glossaryPublication.js +0 -1
- package/dist/state/write/grammar.js +13 -4
- package/dist/state/write/helpers.js +0 -1
- package/dist/state/write/index.js +0 -1
- package/dist/state/write/input.js +0 -1
- package/dist/state/write/lock.js +0 -1
- package/dist/state/write/mutation.js +0 -1
- package/dist/state/write/operations.js +0 -1
- package/dist/state/write/planEvaluation.js +0 -1
- package/dist/state/write/planPublication.js +0 -1
- package/dist/state/write/runtimeOperations.js +83 -6
- package/dist/state/write/serialize.js +0 -1
- package/dist/state/write/transaction.js +0 -1
- package/dist/state/write/validate.js +0 -1
- package/dist/upgrade/appContentRefresh.js +0 -1
- package/dist/upgrade/appModel.js +0 -1
- package/dist/upgrade/atomicWriter.js +0 -1
- package/dist/upgrade/bundleEvidence.js +0 -1
- package/dist/upgrade/channels.js +0 -1
- package/dist/upgrade/compatibility.js +0 -1
- package/dist/upgrade/doctor.js +0 -1
- package/dist/upgrade/doctorClassifier.js +0 -1
- package/dist/upgrade/installedHooksRetirement.js +0 -1
- package/dist/upgrade/legacyAgentCleanup.js +0 -1
- package/dist/upgrade/lifecycleUpgrade.js +0 -1
- package/dist/upgrade/migrateArtifactsV2ToV3.js +7 -15
- package/dist/upgrade/migrationPublication.js +0 -1
- package/dist/upgrade/nextMajorDoctor.js +0 -1
- package/dist/upgrade/npxPlatformStatus.js +0 -1
- package/dist/upgrade/projectIntegration.js +4 -17
- package/dist/upgrade/projectIntegrationDecision.js +0 -1
- package/dist/upgrade/retiredResourceDiagnostics.js +117 -0
- package/dist/upgrade/runtimeMigration.js +61 -190
- package/dist/upgrade/upgradeCommands.js +5 -1
- package/dist/upgrade/upgradeLock.js +0 -1
- package/dist/upgrade/upgradeOrchestrator.js +52 -9
- package/dist/upgrade/v3CapabilitySurface.js +0 -1
- package/dist/upgrade/versionResolution.js +0 -1
- 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 +0 -2
- package/dist/validate/bootstrapAuthority.js +44 -0
- package/dist/validate/capability.js +0 -1
- package/dist/validate/crossCapability.js +0 -1
- package/dist/validate/retainedReferenceAuthority.js +879 -0
- package/dist/validate/selfAudit.js +0 -1
- package/dist/validate/v1LegacyCruft.js +0 -10
- package/dist/validate/vocabularyAuthority.js +6 -8
- package/package.json +12 -5
- package/bundle/references/adapters/package-manifest-interface-model.yaml +0 -127
- package/bundle/references/analysis/benchmark.md +0 -271
- package/bundle/references/analysis/startup-measurement-contract.yaml +0 -435
- package/bundle/references/cli/agent-ready-state-contract.yaml +0 -1015
- package/bundle/references/cli/audience-namespace-cli-migration.yaml +0 -395
- package/bundle/references/cli/bundle-skill-vocabulary.yaml +0 -241
- package/bundle/references/cli/capability-instruction-structure.md +0 -144
- package/bundle/references/cli/capability-tool-classification.yaml +0 -53
- package/bundle/references/cli/coexistence-probe.yaml +0 -13
- package/bundle/references/cli/parity-expected-actual-template.md +0 -30
- package/bundle/references/cli/prime-consumer-compatibility.yaml +0 -701
- package/bundle/references/cli/routing-execution-vocabulary.yaml +0 -259
- package/bundle/references/cli/single-name-protocol.yaml +0 -42
- package/bundle/references/cli/upgrade-repair-wording.md +0 -25
- package/bundle/references/cli/v3-handoff-manifest.schema.yaml +0 -97
- package/bundle/references/meta/documentation-inventory.md +0 -50
- package/bundle/skills/agentera/references/contract.md +0 -1097
- package/dist/analytics/extractCorpus/cli.js.map +0 -1
- package/dist/analytics/extractCorpus/copilotSessions.js.map +0 -1
- package/dist/analytics/extractCorpus/core.js.map +0 -1
- package/dist/analytics/extractCorpus/corpus.js.map +0 -1
- package/dist/analytics/extractCorpus/coverageAudit.js.map +0 -1
- package/dist/analytics/extractCorpus/cursorSessions.js.map +0 -1
- package/dist/analytics/extractCorpus/evidenceTiers.js.map +0 -1
- package/dist/analytics/extractCorpus/extractCorpusParity.js.map +0 -1
- package/dist/analytics/extractCorpus/filesystemSources.js.map +0 -1
- package/dist/analytics/extractCorpus/index.js.map +0 -1
- package/dist/analytics/extractCorpus/jsonlSessions.js.map +0 -1
- package/dist/analytics/extractCorpus/sqliteCaps.js.map +0 -1
- package/dist/analytics/extractCorpus/sqliteSessions.js.map +0 -1
- package/dist/analytics/extractCorpus/tierReader.js.map +0 -1
- package/dist/analytics/extractCorpus.js.map +0 -1
- package/dist/analytics/glossaryAdviceResolution.js.map +0 -1
- package/dist/analytics/glossaryInputAcquisition.js.map +0 -1
- package/dist/analytics/personalGlossaryAdmission.js.map +0 -1
- package/dist/analytics/personalGlossaryProfile.js.map +0 -1
- package/dist/analytics/profileSignals.js.map +0 -1
- package/dist/analytics/usageStats.js.map +0 -1
- package/dist/audit/terminologyDrift.js.map +0 -1
- package/dist/bin/agentera.js.map +0 -1
- package/dist/capabilities/audit/instructions.js.map +0 -1
- package/dist/capabilities/build/instructions.js.map +0 -1
- package/dist/capabilities/design/instructions.js.map +0 -1
- package/dist/capabilities/discuss/instructions.js.map +0 -1
- package/dist/capabilities/document/instructions.js.map +0 -1
- package/dist/capabilities/index.js.map +0 -1
- package/dist/capabilities/optimize/instructions.js.map +0 -1
- package/dist/capabilities/orchestrate/instructions.js.map +0 -1
- package/dist/capabilities/plan/instructions.js.map +0 -1
- package/dist/capabilities/profile/instructions.js.map +0 -1
- package/dist/capabilities/research/instructions.js.map +0 -1
- package/dist/capabilities/status/instructions.js.map +0 -1
- package/dist/capabilities/status/startupInstructions.js.map +0 -1
- package/dist/capabilities/vision/instructions.js.map +0 -1
- package/dist/cli/appContext.js.map +0 -1
- package/dist/cli/argvalidate.js.map +0 -1
- package/dist/cli/capabilityContext/benchmark.js.map +0 -1
- package/dist/cli/capabilityContext/bespoke.js.map +0 -1
- package/dist/cli/capabilityContext/build.js.map +0 -1
- package/dist/cli/capabilityContext/closeout.js.map +0 -1
- package/dist/cli/capabilityContext/contract.js.map +0 -1
- package/dist/cli/capabilityContext/evidence.js.map +0 -1
- package/dist/cli/capabilityContext/index.js.map +0 -1
- package/dist/cli/capabilityContext/orchestration.js.map +0 -1
- package/dist/cli/capabilityContext/planState.js.map +0 -1
- package/dist/cli/capabilityContext/progress.js.map +0 -1
- package/dist/cli/capabilityContext/projectVerification.js.map +0 -1
- package/dist/cli/capabilityContext/shared.js.map +0 -1
- package/dist/cli/capabilityContext/slim.js.map +0 -1
- package/dist/cli/capabilityContext/startup.js.map +0 -1
- package/dist/cli/capabilityContext/types.js.map +0 -1
- package/dist/cli/capabilityContext.js.map +0 -1
- package/dist/cli/commands/appHome.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/durability.js.map +0 -1
- package/dist/cli/commands/entityMigrate.js +0 -132
- package/dist/cli/commands/entityMigrate.js.map +0 -1
- package/dist/cli/commands/glossaryAdvice.js.map +0 -1
- package/dist/cli/commands/lint.js.map +0 -1
- package/dist/cli/commands/personalGlossary.js.map +0 -1
- package/dist/cli/commands/prime/briefOrientation.js.map +0 -1
- package/dist/cli/commands/prime/buildExecutionRequest.js.map +0 -1
- package/dist/cli/commands/prime/bundleStatus.js.map +0 -1
- package/dist/cli/commands/prime/collectEntityOrientation.js.map +0 -1
- package/dist/cli/commands/prime/collectOrientationState.js.map +0 -1
- package/dist/cli/commands/prime/orientationOutput.js.map +0 -1
- package/dist/cli/commands/prime/types.js.map +0 -1
- package/dist/cli/commands/prime/v1Migration.js.map +0 -1
- package/dist/cli/commands/prime.js.map +0 -1
- package/dist/cli/commands/profileGrounding.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/route.js.map +0 -1
- package/dist/cli/commands/schema.js.map +0 -1
- package/dist/cli/commands/state/decisions.js.map +0 -1
- package/dist/cli/commands/state/docs.js.map +0 -1
- package/dist/cli/commands/state/experimentRecords.js.map +0 -1
- package/dist/cli/commands/state/experiments.js.map +0 -1
- package/dist/cli/commands/state/get.js.map +0 -1
- package/dist/cli/commands/state/health.js.map +0 -1
- package/dist/cli/commands/state/index.js.map +0 -1
- package/dist/cli/commands/state/list.js.map +0 -1
- package/dist/cli/commands/state/objective.js.map +0 -1
- package/dist/cli/commands/state/plan.js.map +0 -1
- package/dist/cli/commands/state/planTasks.js.map +0 -1
- package/dist/cli/commands/state/plans.js.map +0 -1
- package/dist/cli/commands/state/progress.js.map +0 -1
- package/dist/cli/commands/state/shared.js.map +0 -1
- package/dist/cli/commands/state/todo.js.map +0 -1
- package/dist/cli/commands/state/write.js.map +0 -1
- package/dist/cli/commands/upgrade.js.map +0 -1
- package/dist/cli/commands/upgradeVerify.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/contracts/bundleStatus.js.map +0 -1
- package/dist/cli/contracts/orientationState.js.map +0 -1
- package/dist/cli/dispatch/argvParser.js.map +0 -1
- package/dist/cli/dispatch/check.js.map +0 -1
- package/dist/cli/dispatch/commands.js.map +0 -1
- package/dist/cli/dispatch/index.js.map +0 -1
- package/dist/cli/dispatch/lifecycle.js.map +0 -1
- package/dist/cli/dispatch/prime.js.map +0 -1
- package/dist/cli/dispatch/shared.js.map +0 -1
- package/dist/cli/dispatch/state.js.map +0 -1
- package/dist/cli/dispatch.js.map +0 -1
- package/dist/cli/errors.js.map +0 -1
- package/dist/cli/help.js.map +0 -1
- package/dist/cli/migrationRequired.js.map +0 -1
- package/dist/cli/orientation/attention.js.map +0 -1
- package/dist/cli/orientation/corpusCoverage.js.map +0 -1
- package/dist/cli/orientation.js.map +0 -1
- package/dist/cli/planArtifacts.js.map +0 -1
- package/dist/cli/planEvidence.js.map +0 -1
- package/dist/cli/planLifecycleState.js.map +0 -1
- package/dist/cli/planTaskIndex.js.map +0 -1
- package/dist/cli/prime-blob.js.map +0 -1
- package/dist/cli/profileAcquisition.js.map +0 -1
- package/dist/cli/startupCompletenessContract.js.map +0 -1
- package/dist/cli/stateQuery.js.map +0 -1
- package/dist/cli/structured.js.map +0 -1
- package/dist/cli/todoMarkdown.js.map +0 -1
- package/dist/cli/todoReadinessSelection.js.map +0 -1
- package/dist/cli/todoSeverity.js.map +0 -1
- package/dist/core/atomicWriter.js.map +0 -1
- package/dist/core/difflib.js.map +0 -1
- package/dist/core/envPaths.js.map +0 -1
- package/dist/core/jsonValue.js.map +0 -1
- package/dist/core/paths.js.map +0 -1
- package/dist/core/pyjson.js.map +0 -1
- package/dist/core/shell.js.map +0 -1
- package/dist/core/skillIdentity.js.map +0 -1
- package/dist/core/sourceRoot.js.map +0 -1
- package/dist/core/text.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/hybridRouteEvaluation.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/apply.js.map +0 -1
- package/dist/hooks/compaction/dryRun.js.map +0 -1
- package/dist/hooks/compaction/index.js.map +0 -1
- package/dist/hooks/compaction/parse.js.map +0 -1
- package/dist/hooks/compaction/retention.js.map +0 -1
- package/dist/hooks/compaction/status.js.map +0 -1
- package/dist/hooks/compaction/types.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 -64
- package/dist/hooks/cursorSessionStart.js.map +0 -1
- package/dist/hooks/projectHookInput.js +0 -26
- package/dist/hooks/projectHookInput.js.map +0 -1
- package/dist/hooks/sessionStart.js +0 -94
- package/dist/hooks/sessionStart.js.map +0 -1
- package/dist/hooks/sessionStop.js +0 -198
- package/dist/hooks/sessionStop.js.map +0 -1
- package/dist/hooks/validateArtifact/agentFacing.js.map +0 -1
- package/dist/hooks/validateArtifact/index.js.map +0 -1
- package/dist/hooks/validateArtifact/markdown.js.map +0 -1
- package/dist/hooks/validateArtifact/runtime.js +0 -86
- package/dist/hooks/validateArtifact/runtime.js.map +0 -1
- package/dist/hooks/validateArtifact/schema.js.map +0 -1
- package/dist/hooks/validateArtifact/traversal.js.map +0 -1
- package/dist/hooks/validateArtifact/violations.js.map +0 -1
- package/dist/migrate/v2HandoffManifest.js.map +0 -1
- package/dist/registries/artifactProtocolIds.js.map +0 -1
- package/dist/registries/artifactRegistry.js.map +0 -1
- package/dist/registries/artifactSchemaProjection.js.map +0 -1
- package/dist/registries/capabilityContract.js.map +0 -1
- package/dist/registries/evaluatorHandoffContract.js.map +0 -1
- package/dist/registries/evidenceTierContract.js.map +0 -1
- package/dist/registries/glossaryAdviceContract.js.map +0 -1
- package/dist/registries/glossaryCaveatContract.js.map +0 -1
- package/dist/registries/glossaryConsumerContractValidation.js.map +0 -1
- package/dist/registries/glossaryEntryContract.js.map +0 -1
- package/dist/registries/glossaryTermIdentity.js.map +0 -1
- package/dist/registries/glossaryTermOccurrence.js.map +0 -1
- package/dist/registries/hybridRoute.js.map +0 -1
- package/dist/registries/hybridRouteReceipt.js.map +0 -1
- package/dist/registries/packageRegistry.js.map +0 -1
- package/dist/registries/todoReadinessContract.js.map +0 -1
- package/dist/registries/triggerLoader.js.map +0 -1
- package/dist/registries/verbosityBudgetContract.js.map +0 -1
- package/dist/release/releaseMetadata.js.map +0 -1
- package/dist/runtime/lifecycleAdapterContract.js.map +0 -1
- package/dist/runtime/lifecycleAdapters.js.map +0 -1
- package/dist/runtime/lifecycleAuthority.js.map +0 -1
- package/dist/runtime/lifecycleOperationContract.js.map +0 -1
- package/dist/runtime/lifecycleOperations.js.map +0 -1
- package/dist/runtime/lifecycleOwnershipJournal.js.map +0 -1
- package/dist/runtime/lifecyclePublication.js.map +0 -1
- package/dist/runtime/lifecycleSnapshot.js.map +0 -1
- package/dist/runtime/nativeResourceCleanup.js.map +0 -1
- package/dist/setup/codex/cli.js +0 -130
- package/dist/setup/codex/cli.js.map +0 -1
- package/dist/setup/codex/configToml.js +0 -558
- package/dist/setup/codex/configToml.js.map +0 -1
- package/dist/setup/codex/constants.js +0 -14
- package/dist/setup/codex/constants.js.map +0 -1
- package/dist/setup/codex/installRoot.js +0 -64
- package/dist/setup/codex/installRoot.js.map +0 -1
- package/dist/setup/codex/state.js +0 -252
- package/dist/setup/codex/state.js.map +0 -1
- package/dist/setup/codex.js +0 -10
- package/dist/setup/codex.js.map +0 -1
- package/dist/setup/opencode.js.map +0 -1
- package/dist/setup/opencodeConstants.js.map +0 -1
- package/dist/setup/sharedSkill.js.map +0 -1
- package/dist/setup/smokeChecks.js.map +0 -1
- package/dist/state/archiveDiscovery.js.map +0 -1
- package/dist/state/archivePublication.js.map +0 -1
- package/dist/state/archiveRecovery.js.map +0 -1
- package/dist/state/archiveReplay.js.map +0 -1
- package/dist/state/canonicalMigrationRecord.js.map +0 -1
- package/dist/state/changelog.js.map +0 -1
- package/dist/state/decisionEntities.js.map +0 -1
- package/dist/state/decisionLegacyValidation.js.map +0 -1
- package/dist/state/decisionMigrationProvenance.js.map +0 -1
- package/dist/state/decisionOverlay.js.map +0 -1
- package/dist/state/decisionRevision.js.map +0 -1
- package/dist/state/decisionRevisionMigration.js.map +0 -1
- package/dist/state/directRetrieval.js.map +0 -1
- package/dist/state/durability.js.map +0 -1
- package/dist/state/entityCutover.js.map +0 -1
- package/dist/state/entityCutoverGit.js.map +0 -1
- package/dist/state/entityGlossaryAuthority.js.map +0 -1
- package/dist/state/entityListProjection.js.map +0 -1
- package/dist/state/entityListRuntimeRegistry.js.map +0 -1
- package/dist/state/entityMigrationCausality.js.map +0 -1
- package/dist/state/entityMigrationIdentity.js.map +0 -1
- package/dist/state/entityMigrationPreview.js.map +0 -1
- package/dist/state/entityPublicationContext.js.map +0 -1
- package/dist/state/entityRetrievalHelp.js.map +0 -1
- package/dist/state/entityStorage.js.map +0 -1
- package/dist/state/exactReplacementRecovery.js.map +0 -1
- package/dist/state/experimentArchive.js.map +0 -1
- package/dist/state/experimentIdentity.js.map +0 -1
- package/dist/state/healthEntities.js.map +0 -1
- package/dist/state/healthEntityValidation.js.map +0 -1
- package/dist/state/healthRepair.js.map +0 -1
- package/dist/state/installRoot.js.map +0 -1
- package/dist/state/legacyEntityCutoverEvidence.js.map +0 -1
- package/dist/state/legacyIdentity.js.map +0 -1
- package/dist/state/legacySummaryRecord.js.map +0 -1
- package/dist/state/listAccounting.js.map +0 -1
- package/dist/state/listClassification.js.map +0 -1
- package/dist/state/listCursor.js.map +0 -1
- package/dist/state/listRetrieval.js.map +0 -1
- package/dist/state/migrationSourceBinding.js.map +0 -1
- package/dist/state/objectiveExperimentEntities.js.map +0 -1
- package/dist/state/planEntities.js.map +0 -1
- package/dist/state/planIdentity.js.map +0 -1
- package/dist/state/planRetrieval.js.map +0 -1
- package/dist/state/planTaskRetrieval.js.map +0 -1
- package/dist/state/progressEntities.js.map +0 -1
- package/dist/state/progressGlossaryCaveat.js.map +0 -1
- package/dist/state/progressPublicationOrder.js.map +0 -1
- package/dist/state/projectRoot.js.map +0 -1
- package/dist/state/projectionPolicy.js.map +0 -1
- package/dist/state/retrievalAuthority.js.map +0 -1
- package/dist/state/safeProjectFile.js.map +0 -1
- package/dist/state/startupAnalysis/benchmark.js.map +0 -1
- package/dist/state/startupAnalysis/contract.js.map +0 -1
- package/dist/state/startupAnalysis/helpers.js.map +0 -1
- package/dist/state/startupAnalysis/index.js.map +0 -1
- package/dist/state/startupAnalysis/metrics.js.map +0 -1
- package/dist/state/startupAnalysis/records.js.map +0 -1
- package/dist/state/startupAnalysis/report.js.map +0 -1
- package/dist/state/startupAnalysis/threshold.js.map +0 -1
- package/dist/state/startupAnalysis.js.map +0 -1
- package/dist/state/startupProjection.js.map +0 -1
- package/dist/state/stateMode.js.map +0 -1
- package/dist/state/stateStorageAuthority.js.map +0 -1
- package/dist/state/summaryEntityRead.js.map +0 -1
- package/dist/state/summaryMigrationProvenance.js.map +0 -1
- package/dist/state/summarySourceRowAuthority.js.map +0 -1
- package/dist/state/todoDocsEntities.js.map +0 -1
- package/dist/state/todoDocsEntityValidation.js.map +0 -1
- package/dist/state/todoReconciliationActivation.js.map +0 -1
- package/dist/state/todoReconciliationTransaction.js.map +0 -1
- package/dist/state/write/assign.js.map +0 -1
- package/dist/state/write/candidateMutation.js.map +0 -1
- package/dist/state/write/errors.js.map +0 -1
- package/dist/state/write/experimentPublication.js.map +0 -1
- package/dist/state/write/explain.js.map +0 -1
- package/dist/state/write/fields.js.map +0 -1
- package/dist/state/write/glossaryPublication.js.map +0 -1
- package/dist/state/write/grammar.js.map +0 -1
- package/dist/state/write/helpers.js.map +0 -1
- package/dist/state/write/index.js.map +0 -1
- package/dist/state/write/input.js.map +0 -1
- package/dist/state/write/lock.js.map +0 -1
- package/dist/state/write/mutation.js.map +0 -1
- package/dist/state/write/operations.js.map +0 -1
- package/dist/state/write/planEvaluation.js.map +0 -1
- package/dist/state/write/planPublication.js.map +0 -1
- package/dist/state/write/runtimeOperations.js.map +0 -1
- package/dist/state/write/serialize.js.map +0 -1
- package/dist/state/write/transaction.js.map +0 -1
- package/dist/state/write/validate.js.map +0 -1
- package/dist/upgrade/appContentRefresh.js.map +0 -1
- package/dist/upgrade/appModel.js.map +0 -1
- package/dist/upgrade/atomicWriter.js.map +0 -1
- package/dist/upgrade/bundleEvidence.js.map +0 -1
- package/dist/upgrade/channels.js.map +0 -1
- package/dist/upgrade/coexistenceProbe.js +0 -105
- package/dist/upgrade/coexistenceProbe.js.map +0 -1
- package/dist/upgrade/compatibility.js.map +0 -1
- package/dist/upgrade/doctor.js.map +0 -1
- package/dist/upgrade/doctorClassifier.js.map +0 -1
- package/dist/upgrade/installedHooksRetirement.js.map +0 -1
- package/dist/upgrade/legacyAgentCleanup.js.map +0 -1
- package/dist/upgrade/lifecycleUpgrade.js.map +0 -1
- package/dist/upgrade/migrateArtifactsV2ToV3.js.map +0 -1
- package/dist/upgrade/migrationPublication.js.map +0 -1
- package/dist/upgrade/nextMajorDoctor.js.map +0 -1
- package/dist/upgrade/npxPlatformStatus.js.map +0 -1
- package/dist/upgrade/projectIntegration.js.map +0 -1
- package/dist/upgrade/projectIntegrationDecision.js.map +0 -1
- package/dist/upgrade/runtimeMigration.js.map +0 -1
- package/dist/upgrade/upgradeCommands.js.map +0 -1
- package/dist/upgrade/upgradeLock.js.map +0 -1
- package/dist/upgrade/upgradeOrchestrator.js.map +0 -1
- package/dist/upgrade/v3CapabilitySurface.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/selfAudit.js.map +0 -1
- package/dist/validate/v1LegacyCruft.js.map +0 -1
- package/dist/validate/vocabularyAuthority.js.map +0 -1
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
export const ACTIVATION_CLASSES = [
|
|
4
|
+
"cli", "capability", "runtime", "reference", "state", "package", "bootstrap",
|
|
5
|
+
];
|
|
6
|
+
export const ACTIVATION_DIMENSIONS = [
|
|
7
|
+
"discovery", "behavior", "diagnostics", "package_projection", "instructions", "adversarial",
|
|
8
|
+
];
|
|
9
|
+
function deepFreeze(value) {
|
|
10
|
+
if (value && typeof value === "object" && !Object.isFrozen(value)) {
|
|
11
|
+
Object.freeze(value);
|
|
12
|
+
for (const child of Object.values(value))
|
|
13
|
+
deepFreeze(child);
|
|
14
|
+
}
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
/** Code-owned identity that the publication document must project exactly. */
|
|
18
|
+
export const ACTIVATION_CLASS_AUTHORITIES = deepFreeze({
|
|
19
|
+
cli: {
|
|
20
|
+
path: "packages/cli/src/cli/dispatch/commands.ts", symbol: "DISPATCHER_TOP_LEVEL_COMMANDS",
|
|
21
|
+
correction: "pnpm -C packages/cli test:source -- test/cli/activationConjunction.test.ts",
|
|
22
|
+
},
|
|
23
|
+
capability: {
|
|
24
|
+
path: "packages/cli/src/capabilities/index.ts", symbol: "CAPABILITY_INSTRUCTIONS",
|
|
25
|
+
correction: "pnpm -C packages/cli test:source -- test/cli/activationConjunction.test.ts",
|
|
26
|
+
},
|
|
27
|
+
runtime: {
|
|
28
|
+
path: "packages/cli/src/runtime/lifecycleAuthority.ts", symbol: "loadLifecycleAuthority",
|
|
29
|
+
correction: "pnpm -C packages/cli test:source -- test/runtime/runtimeLifecycle.test.ts",
|
|
30
|
+
},
|
|
31
|
+
reference: {
|
|
32
|
+
path: "packages/cli/src/validate/retainedReferenceAuthority.ts", symbol: "validateRetainedReferenceAuthority",
|
|
33
|
+
correction: "node packages/cli/dist/bin/agentera.js check validate retained-references --format json",
|
|
34
|
+
},
|
|
35
|
+
state: {
|
|
36
|
+
path: "packages/cli/src/state/write/runtimeOperations.ts", symbol: "runtimeOperationSpecs",
|
|
37
|
+
correction: "node packages/cli/dist/bin/agentera.js check validate state --format json",
|
|
38
|
+
},
|
|
39
|
+
package: {
|
|
40
|
+
path: "packages/cli/src/registries/packageRegistry.ts", symbol: "loadRegistry",
|
|
41
|
+
correction: "pnpm -C packages/cli run verify:package",
|
|
42
|
+
},
|
|
43
|
+
bootstrap: {
|
|
44
|
+
path: "packages/cli/src/validate/bootstrapAuthority.ts", symbol: "bootstrapMatrixAuthority",
|
|
45
|
+
correction: "pnpm -C packages/cli test:source -- test/cli/runtimeBootstrapMatrix.test.ts",
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
/** SHA-256 uses the sorted exact UTF-8 identities joined by one LF byte. */
|
|
49
|
+
export const ACTIVATION_CENSUS_AUTHORITY = deepFreeze({
|
|
50
|
+
algorithm: "sha256(sorted_utf8_ids_joined_by_lf)",
|
|
51
|
+
classes: {
|
|
52
|
+
cli: { count: 27, sha256: "986a637f5c11c57ab7a897a01bd291d0811846e5339c3831c715932cf9659ad4" },
|
|
53
|
+
capability: { count: 12, sha256: "007e1157a892fec54182b1803aeaa442cf8e2e332e6a055c3bd020e2b0731867" },
|
|
54
|
+
runtime: { count: 81, sha256: "03fe600a3a27f05daf0d1b59c16b00bedc354a13c70ea60be0b457175fdf743c" },
|
|
55
|
+
reference: { count: 22, sha256: "2b48c82bb7ee10388d9ebb4fa7ea3743ea82a7e9aaedfcd5a858eeedb9d891ae" },
|
|
56
|
+
state: { count: 36, sha256: "a9f371e2f6d49e7cb890767d7dfe26edee11d4a7d28ee35ab6c491c0abafbbf0" },
|
|
57
|
+
package: { count: 66, sha256: "3548af7e84151c90690a6eb3d1cb6c7847f39b290161ecab599d8cb1bf0d2cb0" },
|
|
58
|
+
bootstrap: { count: 34, sha256: "71c2038744e2518a6adb722acbb5f9352bddfb5d1c92eeb0e347297ef2ca2f1e" },
|
|
59
|
+
},
|
|
60
|
+
total: { count: 278, sha256: "5767645b4d78d8716e7ea1a283125bcfd43e13634311b33b62bc0a307d1abdb3" },
|
|
61
|
+
});
|
|
62
|
+
/** Each dimension names the production contract it observes independently. */
|
|
63
|
+
export const ACTIVATION_EVIDENCE_SOURCES = deepFreeze({
|
|
64
|
+
cli: { discovery: "cli.dispatcher-inventory", behavior: "cli.dispatch-handler-registry", diagnostics: "cli.command-diagnostic-registry", package_projection: "cli.schema-dispatcher-projection", instructions: "cli.public-help-declaration", adversarial: "cli.invalid-shape-command-authority" },
|
|
65
|
+
capability: { discovery: "capability.instruction-registry", behavior: "capability.route-handler-registry", diagnostics: "capability.schema-contract-directories", package_projection: "capability.packaged-registry-projection", instructions: "capability.served-instruction-targets", adversarial: "capability.registry-schema-closure" },
|
|
66
|
+
runtime: { discovery: "runtime.lifecycle-retirement-loader", behavior: "runtime.cleanup-behavior-records", diagnostics: "runtime.retired-diagnostic-expansion", package_projection: "runtime.packaged-authority-loaders", instructions: "runtime.lifecycle-declaration-records", adversarial: "runtime.retirement-shape-authority" },
|
|
67
|
+
reference: { discovery: "reference.retained-inventory", behavior: "reference.production-consumers", diagnostics: "reference.authority-entry-validation", package_projection: "reference.packaged-retained-inventory", instructions: "reference.consumer-runbook-contracts", adversarial: "reference.owner-command-shape-authority" },
|
|
68
|
+
state: { discovery: "state.read-write-runtime-registries", behavior: "state.read-write-dispatch-contracts", diagnostics: "state.recovery-and-bound-contracts", package_projection: "state.schema-discovery-projections", instructions: "state.help-and-example-projections", adversarial: "state.input-and-output-bound-authorities" },
|
|
69
|
+
package: { discovery: "package.registry-surface-records", behavior: "package.construction-classification-records", diagnostics: "package.generated-surface-classifications", package_projection: "package.packaged-registry-projection", instructions: "package.identity-and-selector-contracts", adversarial: "package.selector-shape-authority" },
|
|
70
|
+
bootstrap: { discovery: "bootstrap.matrix-axis-registry", behavior: "bootstrap.acceptance-execution-specs", diagnostics: "bootstrap.rejection-classification-specs", package_projection: "bootstrap.packaged-matrix-authority", instructions: "bootstrap.state-applicability-contracts", adversarial: "bootstrap.invalid-command-classification-authority" },
|
|
71
|
+
});
|
|
72
|
+
export const ACTIVATION_CHECK_IDS = Object.freeze(ACTIVATION_CLASSES.flatMap((classId) => ACTIVATION_DIMENSIONS.map((dimension) => `${classId}.${dimension}`)));
|
|
73
|
+
export const SOURCE_GATE_IDS = [
|
|
74
|
+
"source", "stress", "performance", "package", "generated-overlap", "typecheck", "build",
|
|
75
|
+
"compact", "capability-contract", "activation-conjunction",
|
|
76
|
+
];
|
|
77
|
+
export const SOURCE_DAG_PHASES = {
|
|
78
|
+
batchA: ["generated-overlap", "stress", "typecheck"],
|
|
79
|
+
performanceBarrier: ["performance"],
|
|
80
|
+
barrierB: ["compact", "capability-contract", "activation-conjunction"],
|
|
81
|
+
generatedOverlapOrigins: ["source", "package", "build", "generated-overlap"],
|
|
82
|
+
};
|
|
83
|
+
const EXACT_COMMANDS = {
|
|
84
|
+
source: ["pnpm", "-C", "packages/cli", "run", "test:source"],
|
|
85
|
+
stress: ["pnpm", "-C", "packages/cli", "run", "test:stress"],
|
|
86
|
+
performance: ["pnpm", "-C", "packages/cli", "run", "test:performance"],
|
|
87
|
+
package: ["pnpm", "-C", "packages/cli", "run", "verify:package"],
|
|
88
|
+
"generated-overlap": ["pnpm", "-C", "packages/cli", "run", "verify:generated-overlap"],
|
|
89
|
+
typecheck: ["pnpm", "-C", "packages/cli", "run", "typecheck"],
|
|
90
|
+
build: ["pnpm", "-C", "packages/cli", "build"],
|
|
91
|
+
compact: ["node", "packages/cli/dist/bin/agentera.js", "check", "compact"],
|
|
92
|
+
"capability-contract": ["node", "packages/cli/dist/bin/agentera.js", "check", "validate", "capability-contract", "--format", "json"],
|
|
93
|
+
"activation-conjunction": ["node", "packages/cli/dist/bin/agentera.js", "check", "validate", "activation-conjunction", "--format", "json"],
|
|
94
|
+
};
|
|
95
|
+
function fail(message) { throw new Error(`package publication contract: ${message}`); }
|
|
96
|
+
function exactList(value, expected, label) {
|
|
97
|
+
if (!Array.isArray(value) || value.some((entry) => typeof entry !== "string"))
|
|
98
|
+
fail(`${label} must be a string list`);
|
|
99
|
+
if (value.length !== new Set(value).size)
|
|
100
|
+
fail(`${label} contains duplicates`);
|
|
101
|
+
if (value.length !== expected.length || value.some((entry, index) => entry !== expected[index]))
|
|
102
|
+
fail(`${label} must exactly match governed order`);
|
|
103
|
+
return [...value];
|
|
104
|
+
}
|
|
105
|
+
function positiveInteger(value, label, maximum = 1_000_000) {
|
|
106
|
+
if (!Number.isSafeInteger(value) || value <= 0 || value > maximum)
|
|
107
|
+
fail(`${label} must be a bounded positive integer`);
|
|
108
|
+
return value;
|
|
109
|
+
}
|
|
110
|
+
function boundedText(value, label, maximum, grammar) {
|
|
111
|
+
if (typeof value !== "string" || value.length === 0 || value.length > maximum || !grammar.test(value))
|
|
112
|
+
fail(`${label} is invalid`);
|
|
113
|
+
return value;
|
|
114
|
+
}
|
|
115
|
+
function exactCommand(value, expected, label) {
|
|
116
|
+
if (!Array.isArray(value) || value.length === 0 || value.length > 12)
|
|
117
|
+
fail(`${label} must be a bounded nonempty command`);
|
|
118
|
+
const command = value.map((token, index) => boundedText(token, `${label}[${index}]`, 160, /^[^\s\0-\x1f\x7f]+$/));
|
|
119
|
+
if (command.length !== expected.length || command.some((token, index) => token !== expected[index]))
|
|
120
|
+
fail(`${label} does not match its governed command`);
|
|
121
|
+
return command;
|
|
122
|
+
}
|
|
123
|
+
function exactCensusIdentity(value, expected, label) {
|
|
124
|
+
if (!value || Object.keys(value).sort().join("\0") !== "count\0sha256")
|
|
125
|
+
fail(`${label} must contain exact count and sha256 fields`);
|
|
126
|
+
if (value.count !== expected.count || value.sha256 !== expected.sha256) {
|
|
127
|
+
fail(`${label} must equal count ${expected.count} and sha256 ${expected.sha256}`);
|
|
128
|
+
}
|
|
129
|
+
return { count: expected.count, sha256: expected.sha256 };
|
|
130
|
+
}
|
|
131
|
+
/** Validate the sole publication authority against behavior-owned exact sets and grammar. */
|
|
132
|
+
export function validatePackagePublicationDocument(raw) {
|
|
133
|
+
if (raw?.schemaVersion !== "agentera.packagePublication.v2")
|
|
134
|
+
fail("schemaVersion is invalid");
|
|
135
|
+
const source = raw?.qualification?.source;
|
|
136
|
+
const activation = source?.activationConjunction;
|
|
137
|
+
if (!source || !activation || activation.gateIdentity !== "agentera.activationConjunction.v1")
|
|
138
|
+
fail("source activation conjunction is missing or invalid");
|
|
139
|
+
if (!Array.isArray(source.gates) || source.gates.length !== SOURCE_GATE_IDS.length)
|
|
140
|
+
fail("source gates must contain exactly ten entries");
|
|
141
|
+
const sourceGates = source.gates.map((gate, index) => {
|
|
142
|
+
const name = SOURCE_GATE_IDS[index];
|
|
143
|
+
if (!gate || gate.name !== name)
|
|
144
|
+
fail(`source gate ${index} must be '${name}'`);
|
|
145
|
+
const command = exactCommand(gate.command, EXACT_COMMANDS[name], `gate ${name} command`);
|
|
146
|
+
const owner = boundedText(gate.owner, `gate ${name} owner`, 240, /^packages\/cli\/(?:src\/.+\.ts|scripts\/.+\.mjs|package\.json)#[A-Za-z0-9_.-]+$/);
|
|
147
|
+
const correction = boundedText(gate.correction, `gate ${name} correction`, 320, /^(?:pnpm|node) [^\0\r\n]+$/);
|
|
148
|
+
if (correction !== command.join(" "))
|
|
149
|
+
fail(`gate ${name} correction must equal its command`);
|
|
150
|
+
return { name, command, owner, correction };
|
|
151
|
+
});
|
|
152
|
+
const dag = source.dag;
|
|
153
|
+
const batchA = exactList(dag?.batchA, SOURCE_DAG_PHASES.batchA, "source batch A");
|
|
154
|
+
const performanceBarrier = exactList(dag?.performanceBarrier, SOURCE_DAG_PHASES.performanceBarrier, "source performance barrier");
|
|
155
|
+
const barrierB = exactList(dag?.barrierB, SOURCE_DAG_PHASES.barrierB, "source barrier B");
|
|
156
|
+
const generatedOverlapOrigins = exactList(dag?.generatedOverlapOrigins, SOURCE_DAG_PHASES.generatedOverlapOrigins, "generated overlap origins");
|
|
157
|
+
const phases = [...batchA, ...performanceBarrier, ...barrierB];
|
|
158
|
+
if (phases.length !== new Set(phases).size)
|
|
159
|
+
fail("source execution phases must be disjoint");
|
|
160
|
+
const scheduled = new Set([...phases, ...generatedOverlapOrigins]);
|
|
161
|
+
if (scheduled.size !== SOURCE_GATE_IDS.length || SOURCE_GATE_IDS.some((name) => !scheduled.has(name)))
|
|
162
|
+
fail("source schedule must cover every gate exactly through its declared origin");
|
|
163
|
+
const minimumExecutionWindowMs = {};
|
|
164
|
+
if (!dag?.minimumExecutionWindowMs || Object.keys(dag.minimumExecutionWindowMs).length !== barrierB.length)
|
|
165
|
+
fail("barrier B minimum execution windows must exactly match barrier B");
|
|
166
|
+
for (const name of barrierB)
|
|
167
|
+
minimumExecutionWindowMs[name] = positiveInteger(dag.minimumExecutionWindowMs[name], `${name} minimum execution window`, 120_000);
|
|
168
|
+
const classes = exactList(activation.classes, ACTIVATION_CLASSES, "activation classes");
|
|
169
|
+
const dimensions = exactList(activation.dimensions, ACTIVATION_DIMENSIONS, "activation dimensions");
|
|
170
|
+
const checkIds = exactList(activation.checkIds, ACTIVATION_CHECK_IDS, "activation check IDs");
|
|
171
|
+
if (!activation.owners || Object.keys(activation.owners).join("\0") !== classes.join("\0"))
|
|
172
|
+
fail("activation owners must exactly match ordered classes");
|
|
173
|
+
const owners = {};
|
|
174
|
+
for (const classId of classes) {
|
|
175
|
+
const owner = activation.owners[classId];
|
|
176
|
+
if (!owner)
|
|
177
|
+
fail(`activation owner '${classId}' is missing`);
|
|
178
|
+
const canonical = ACTIVATION_CLASS_AUTHORITIES[classId];
|
|
179
|
+
const expectedFields = ["path", "symbol", ...(canonical.selector ? ["selector"] : []), "correction"].sort();
|
|
180
|
+
if (Object.keys(owner).sort().join("\0") !== expectedFields.join("\0")
|
|
181
|
+
|| owner.path !== canonical.path
|
|
182
|
+
|| owner.symbol !== canonical.symbol
|
|
183
|
+
|| owner.selector !== canonical.selector
|
|
184
|
+
|| owner.correction !== canonical.correction) {
|
|
185
|
+
fail(`activation owner '${classId}' must equal ${canonical.path}#${canonical.selector ?? canonical.symbol}; correction: ${canonical.correction}`);
|
|
186
|
+
}
|
|
187
|
+
owners[classId] = {
|
|
188
|
+
path: boundedText(owner.path, `${classId} owner path`, 240, /^packages\/cli\/(?:src\/.+\.ts|scripts\/.+\.mjs)$/),
|
|
189
|
+
symbol: boundedText(owner.symbol, `${classId} owner symbol`, 120, /^[A-Za-z_$][A-Za-z0-9_.$-]*$/),
|
|
190
|
+
...(owner.selector ? { selector: boundedText(owner.selector, `${classId} owner selector`, 240, /^[^\0\r\n]+$/) } : {}),
|
|
191
|
+
correction: boundedText(owner.correction, `${classId} correction`, 320, /^(?:pnpm|node) [^\0\r\n]+$/),
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
const census = activation.census;
|
|
195
|
+
if (!census || Object.keys(census).sort().join("\0") !== "algorithm\0classes\0total"
|
|
196
|
+
|| census.algorithm !== ACTIVATION_CENSUS_AUTHORITY.algorithm)
|
|
197
|
+
fail("activation census authority is missing or invalid");
|
|
198
|
+
if (!census.classes || Object.keys(census.classes).join("\0") !== classes.join("\0"))
|
|
199
|
+
fail("activation census classes must exactly match ordered classes");
|
|
200
|
+
const censusClasses = {};
|
|
201
|
+
for (const classId of classes) {
|
|
202
|
+
censusClasses[classId] = exactCensusIdentity(census.classes[classId], ACTIVATION_CENSUS_AUTHORITY.classes[classId], `activation census '${classId}'`);
|
|
203
|
+
}
|
|
204
|
+
const censusTotal = exactCensusIdentity(census.total, ACTIVATION_CENSUS_AUTHORITY.total, "activation census total");
|
|
205
|
+
const boundNames = ["maxRows", "maxViolations", "maxDiagnosticCharacters", "maxOutputBytes", "maxGenerationIdCharacters", "maxPathCharacters", "maxSymbolCharacters", "maxSelectorCharacters", "maxCorrectionCharacters", "maxCheckIdCharacters", "maxSurfaceIdCharacters"];
|
|
206
|
+
if (!activation.bounds || Object.keys(activation.bounds).sort().join("\0") !== [...boundNames].sort().join("\0"))
|
|
207
|
+
fail("activation bounds must contain the exact governed fields");
|
|
208
|
+
const bounds = Object.fromEntries(boundNames.map((name) => [name, positiveInteger(activation.bounds[name], `activation bounds.${name}`, name === "maxOutputBytes" ? 262_144 : 100_000)]));
|
|
209
|
+
if (bounds.maxOutputBytes > 196_608)
|
|
210
|
+
fail("activation output bound must retain 25 percent headroom");
|
|
211
|
+
return {
|
|
212
|
+
sourceGates,
|
|
213
|
+
sourceDag: {
|
|
214
|
+
batchA, performanceBarrier, barrierB, generatedOverlapOrigins,
|
|
215
|
+
overlapCleanupMarginMs: positiveInteger(dag.overlapCleanupMarginMs, "overlap cleanup margin", 60_000),
|
|
216
|
+
overlapParentReconciliationMarginMs: positiveInteger(dag.overlapParentReconciliationMarginMs, "parent reconciliation margin", 60_000),
|
|
217
|
+
minimumExecutionWindowMs,
|
|
218
|
+
},
|
|
219
|
+
sourceQualificationMs: positiveInteger(raw?.benchmark?.timeouts?.sourceQualificationMs, "source qualification timeout", 900_000),
|
|
220
|
+
activationConjunction: {
|
|
221
|
+
gateIdentity: activation.gateIdentity, classes, dimensions, checkIds, bounds, owners,
|
|
222
|
+
census: { algorithm: ACTIVATION_CENSUS_AUTHORITY.algorithm, classes: censusClasses, total: censusTotal },
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
export function loadPackagePublicationModel(root) {
|
|
227
|
+
const file = path.join(root, "references/adapters/package-publication.json");
|
|
228
|
+
return validatePackagePublicationDocument(JSON.parse(fs.readFileSync(file, "utf8")));
|
|
229
|
+
}
|
|
@@ -10,6 +10,7 @@ export const REQUIRED_GROUPS = [
|
|
|
10
10
|
"version_authority",
|
|
11
11
|
"version_surfaces",
|
|
12
12
|
"bundle_surfaces",
|
|
13
|
+
"bootstrap_command_authority",
|
|
13
14
|
"docs_targets",
|
|
14
15
|
"release_policy",
|
|
15
16
|
];
|
|
@@ -23,6 +24,7 @@ const REQUIRED_FIELDS = {
|
|
|
23
24
|
],
|
|
24
25
|
version_surfaces: ["surfaces"],
|
|
25
26
|
bundle_surfaces: ["directories", "files", "generated_files", "skip_parts", "skip_suffixes"],
|
|
27
|
+
bootstrap_command_authority: ["scanned_formats", "scalar_classifications", "emitted_producers", "constructor_non_producers"],
|
|
26
28
|
docs_targets: ["version_files_source", "version_files", "index_targets"],
|
|
27
29
|
release_policy: [
|
|
28
30
|
"semver_policy_source",
|
|
@@ -32,7 +34,7 @@ const REQUIRED_FIELDS = {
|
|
|
32
34
|
};
|
|
33
35
|
const CONSUMER_GROUPS = {
|
|
34
36
|
validator: ["identity", "version_authority", "version_surfaces"],
|
|
35
|
-
upgrade: ["identity", "version_authority", "bundle_surfaces"],
|
|
37
|
+
upgrade: ["identity", "version_authority", "bundle_surfaces", "bootstrap_command_authority"],
|
|
36
38
|
docs: ["identity", "version_authority", "docs_targets", "release_policy"],
|
|
37
39
|
tests: REQUIRED_GROUPS,
|
|
38
40
|
};
|
|
@@ -258,6 +260,9 @@ function validateGroup(prefix, group, value, root) {
|
|
|
258
260
|
case "bundle_surfaces":
|
|
259
261
|
errors.push(...validateBundleSurfaces(prefix, value));
|
|
260
262
|
break;
|
|
263
|
+
case "bootstrap_command_authority":
|
|
264
|
+
errors.push(...validateBootstrapCommandAuthority(prefix, value, root));
|
|
265
|
+
break;
|
|
261
266
|
case "docs_targets":
|
|
262
267
|
errors.push(...validateDocsTargets(prefix, value, root));
|
|
263
268
|
break;
|
|
@@ -360,6 +365,118 @@ function validateBundleSurfaces(prefix, value) {
|
|
|
360
365
|
errors.push(`${prefix}.${field} must be a list of strings`);
|
|
361
366
|
}
|
|
362
367
|
}
|
|
368
|
+
const generated = value.generated_files;
|
|
369
|
+
if (!Array.isArray(generated)) {
|
|
370
|
+
errors.push(`${prefix}.generated_files must be a list`);
|
|
371
|
+
}
|
|
372
|
+
else {
|
|
373
|
+
generated.forEach((entry, index) => {
|
|
374
|
+
const entryPrefix = `${prefix}.generated_files[${index}]`;
|
|
375
|
+
if (!isMapping(entry)) {
|
|
376
|
+
errors.push(`${entryPrefix} must be an object`);
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
errors.push(...validateRequiredObjectFields(entryPrefix, entry, ["id", "path", "format", "classification", "command_authority_reason"]));
|
|
380
|
+
errors.push(...validateBundlePath(entryPrefix, entry.id, entry.path));
|
|
381
|
+
if (typeof entry.id === "string" && entry.id) {
|
|
382
|
+
const previous = ids.get(entry.id);
|
|
383
|
+
if (previous)
|
|
384
|
+
errors.push(`${entryPrefix}.id ${JSON.stringify(entry.id)} duplicates ${previous}.id; correction: use a unique id across all bundle surfaces`);
|
|
385
|
+
else
|
|
386
|
+
ids.set(entry.id, entryPrefix);
|
|
387
|
+
}
|
|
388
|
+
if (typeof entry.path === "string" && entry.path) {
|
|
389
|
+
const previous = paths.get(entry.path);
|
|
390
|
+
if (previous)
|
|
391
|
+
errors.push(`${entryPrefix}.path ${JSON.stringify(entry.path)} for id ${JSON.stringify(entry.id)} duplicates ${previous}.path; correction: use a unique path across all bundle surfaces`);
|
|
392
|
+
else
|
|
393
|
+
paths.set(entry.path, entryPrefix);
|
|
394
|
+
}
|
|
395
|
+
if (entry.format !== "json")
|
|
396
|
+
errors.push(`${entryPrefix}.format must be json`);
|
|
397
|
+
if (entry.classification !== "active")
|
|
398
|
+
errors.push(`${entryPrefix}.classification must be active`);
|
|
399
|
+
if (typeof entry.command_authority_reason !== "string" || !entry.command_authority_reason) {
|
|
400
|
+
errors.push(`${entryPrefix}.command_authority_reason must be a non-empty string`);
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
return errors;
|
|
405
|
+
}
|
|
406
|
+
function validateBootstrapCommandAuthority(prefix, value, root) {
|
|
407
|
+
const errors = [];
|
|
408
|
+
const formats = value.scanned_formats;
|
|
409
|
+
if (!Array.isArray(formats) || !formats.every((item) => typeof item === "string") || new Set(formats).size !== 3 || !["markdown", "yaml", "json"].every((format) => formats.includes(format))) {
|
|
410
|
+
errors.push(`${prefix}.scanned_formats must contain exactly markdown, yaml, and json`);
|
|
411
|
+
}
|
|
412
|
+
for (const field of ["emitted_producers", "constructor_non_producers"]) {
|
|
413
|
+
const entries = value[field];
|
|
414
|
+
if (!Array.isArray(entries)) {
|
|
415
|
+
errors.push(`${prefix}.${field} must be a list`);
|
|
416
|
+
continue;
|
|
417
|
+
}
|
|
418
|
+
const paths = new Set();
|
|
419
|
+
entries.forEach((entry, index) => {
|
|
420
|
+
const entryPrefix = `${prefix}.${field}[${index}]`;
|
|
421
|
+
if (!isMapping(entry)) {
|
|
422
|
+
errors.push(`${entryPrefix} must be an object`);
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
errors.push(...validateRequiredObjectFields(entryPrefix, entry, ["path", "reason"]));
|
|
426
|
+
errors.push(...validateRepoPath(`${entryPrefix}.path`, entry.path, root));
|
|
427
|
+
if (typeof entry.reason !== "string" || !entry.reason)
|
|
428
|
+
errors.push(`${entryPrefix}.reason must be a non-empty string`);
|
|
429
|
+
if (typeof entry.path === "string") {
|
|
430
|
+
if (paths.has(entry.path))
|
|
431
|
+
errors.push(`${entryPrefix}.path duplicates ${JSON.stringify(entry.path)}`);
|
|
432
|
+
paths.add(entry.path);
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
const classifications = value.scalar_classifications;
|
|
437
|
+
if (!Array.isArray(classifications)) {
|
|
438
|
+
errors.push(`${prefix}.scalar_classifications must be a list`);
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
const identities = new Set();
|
|
442
|
+
const reasons = new Set();
|
|
443
|
+
classifications.forEach((entry, index) => {
|
|
444
|
+
const entryPrefix = `${prefix}.scalar_classifications[${index}]`;
|
|
445
|
+
if (!isMapping(entry)) {
|
|
446
|
+
errors.push(`${entryPrefix} must be an object`);
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
errors.push(...validateRequiredObjectFields(entryPrefix, entry, [
|
|
450
|
+
"path",
|
|
451
|
+
"region",
|
|
452
|
+
"category",
|
|
453
|
+
"classification",
|
|
454
|
+
"normalized_sha256",
|
|
455
|
+
"reason",
|
|
456
|
+
]));
|
|
457
|
+
errors.push(...validateRepoPath(`${entryPrefix}.path`, entry.path, root));
|
|
458
|
+
if (typeof entry.region !== "string" || !entry.region)
|
|
459
|
+
errors.push(`${entryPrefix}.region must be a non-empty string`);
|
|
460
|
+
if (!["identity_only", "argument_bearing", "other_vocabulary"].includes(String(entry.category)))
|
|
461
|
+
errors.push(`${entryPrefix}.category is invalid`);
|
|
462
|
+
if (!["bounded_descriptive", "exact_exemption"].includes(String(entry.classification)))
|
|
463
|
+
errors.push(`${entryPrefix}.classification is invalid`);
|
|
464
|
+
if (typeof entry.normalized_sha256 !== "string" || !/^[a-f0-9]{64}$/u.test(entry.normalized_sha256))
|
|
465
|
+
errors.push(`${entryPrefix}.normalized_sha256 must be lowercase SHA-256`);
|
|
466
|
+
if (typeof entry.reason !== "string" || !entry.reason)
|
|
467
|
+
errors.push(`${entryPrefix}.reason must be a non-empty string`);
|
|
468
|
+
else if (reasons.has(entry.reason))
|
|
469
|
+
errors.push(`${entryPrefix}.reason duplicates another scalar-specific reason`);
|
|
470
|
+
else
|
|
471
|
+
reasons.add(entry.reason);
|
|
472
|
+
if (typeof entry.path === "string" && typeof entry.region === "string") {
|
|
473
|
+
const identity = `${entry.path}\u0000${entry.region}`;
|
|
474
|
+
if (identities.has(identity))
|
|
475
|
+
errors.push(`${entryPrefix} duplicates path and region ${JSON.stringify(entry.path)} ${JSON.stringify(entry.region)}`);
|
|
476
|
+
identities.add(identity);
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
}
|
|
363
480
|
return errors;
|
|
364
481
|
}
|
|
365
482
|
function validateBundlePath(prefix, id, value) {
|
|
@@ -498,4 +615,3 @@ function validateForbiddenFields(prefix, value) {
|
|
|
498
615
|
}
|
|
499
616
|
return errors;
|
|
500
617
|
}
|
|
501
|
-
//# sourceMappingURL=packageRegistry.js.map
|
|
@@ -32,6 +32,12 @@ export const RELEASE_PROVENANCE_EXCLUSIONS = [
|
|
|
32
32
|
"packages/cli/src/release/releaseMetadata.ts",
|
|
33
33
|
"references/adapters/package-surface-characterization.md",
|
|
34
34
|
];
|
|
35
|
+
export const STABLE_SHIM_PROVENANCE_PATHS = [
|
|
36
|
+
"packages/cli/shim/bin",
|
|
37
|
+
"packages/cli/shim/lib",
|
|
38
|
+
"packages/cli/shim/README.md",
|
|
39
|
+
"packages/cli/shim/LICENSE",
|
|
40
|
+
];
|
|
35
41
|
const SEMVER_CORE_RE = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
36
42
|
const SEMVER_STRICT_RE = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;
|
|
37
43
|
const PRE_RELEASE_RE = /-(.+)$/;
|
|
@@ -107,6 +113,53 @@ function validateGitRefProvenance(root, gitRef) {
|
|
|
107
113
|
}
|
|
108
114
|
return [];
|
|
109
115
|
}
|
|
116
|
+
export function validateStableShimGitRefProvenance(root, gitRef) {
|
|
117
|
+
const manifestPath = "packages/cli/shim/package.json";
|
|
118
|
+
const inside = runGit(root, ["rev-parse", "--is-inside-work-tree"]);
|
|
119
|
+
if (inside.status !== 0 || String(inside.stdout).trim() !== "true")
|
|
120
|
+
return [];
|
|
121
|
+
const commit = runGit(root, ["cat-file", "-e", `${gitRef}^{commit}`]);
|
|
122
|
+
if (commit.status !== 0) {
|
|
123
|
+
return [`${manifestPath}: agentera.gitRef ${JSON.stringify(gitRef)} is not a commit in the local repository`];
|
|
124
|
+
}
|
|
125
|
+
const diff = runGit(root, ["diff", "--quiet", gitRef, "--", ...STABLE_SHIM_PROVENANCE_PATHS]);
|
|
126
|
+
if (diff.status !== 0) {
|
|
127
|
+
return [
|
|
128
|
+
`${manifestPath}: agentera.gitRef ${JSON.stringify(gitRef)} does not match the stable shim packaged inputs; ` +
|
|
129
|
+
"select the last substantive shim-source commit",
|
|
130
|
+
];
|
|
131
|
+
}
|
|
132
|
+
const status = runGit(root, [
|
|
133
|
+
"status",
|
|
134
|
+
"--porcelain=v1",
|
|
135
|
+
"--untracked-files=all",
|
|
136
|
+
"--",
|
|
137
|
+
manifestPath,
|
|
138
|
+
...STABLE_SHIM_PROVENANCE_PATHS,
|
|
139
|
+
]);
|
|
140
|
+
if (status.status !== 0 || String(status.stdout).trim() !== "") {
|
|
141
|
+
return [
|
|
142
|
+
`${manifestPath}: stable shim packaged inputs have uncommitted or untracked changes outside approved release metadata`,
|
|
143
|
+
];
|
|
144
|
+
}
|
|
145
|
+
const selected = runGit(root, ["show", `${gitRef}:${manifestPath}`]);
|
|
146
|
+
const current = readJson(path.join(root, manifestPath));
|
|
147
|
+
try {
|
|
148
|
+
const selectedManifest = JSON.parse(String(selected.stdout));
|
|
149
|
+
if (selected.status !== 0 ||
|
|
150
|
+
current === null ||
|
|
151
|
+
!isDeepStrictEqual(normalizedPackageMetadata(selectedManifest), normalizedPackageMetadata(current))) {
|
|
152
|
+
return [
|
|
153
|
+
`${manifestPath}: package contract differs from agentera.gitRef ${JSON.stringify(gitRef)} ` +
|
|
154
|
+
"outside the permitted version and gitRef fields",
|
|
155
|
+
];
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
return [`${manifestPath}: unable to read package contract from agentera.gitRef ${JSON.stringify(gitRef)}`];
|
|
160
|
+
}
|
|
161
|
+
return [];
|
|
162
|
+
}
|
|
110
163
|
function readRegistryVersion(root) {
|
|
111
164
|
const source = "registry.json";
|
|
112
165
|
const data = readJson(path.join(root, source));
|
|
@@ -210,7 +263,21 @@ export function readReleaseMetadata(root = rootDefault()) {
|
|
|
210
263
|
* Validate release-metadata coherence. Returns an empty array when the
|
|
211
264
|
* source-tree version surfaces agree on a single release train.
|
|
212
265
|
*/
|
|
213
|
-
export function validateReleaseMetadata(root = rootDefault()) {
|
|
266
|
+
export function validateReleaseMetadata(root = rootDefault(), adapter = "development") {
|
|
267
|
+
if (adapter === "stable") {
|
|
268
|
+
const manifestPath = "packages/cli/shim/package.json";
|
|
269
|
+
const shim = readJson(path.join(resolvePath(root), manifestPath));
|
|
270
|
+
if (shim === null)
|
|
271
|
+
return [`${manifestPath}: missing or unreadable; cannot validate release-metadata`];
|
|
272
|
+
const agentera = shim.agentera;
|
|
273
|
+
const gitRef = agentera && typeof agentera === "object" && !Array.isArray(agentera)
|
|
274
|
+
? agentera.gitRef
|
|
275
|
+
: null;
|
|
276
|
+
if (typeof gitRef !== "string" || !GIT_REF_HEX_RE.test(gitRef)) {
|
|
277
|
+
return [`${manifestPath}: agentera.gitRef must be a 40-character hex SHA for stable shim provenance`];
|
|
278
|
+
}
|
|
279
|
+
return validateStableShimGitRefProvenance(resolvePath(root), gitRef);
|
|
280
|
+
}
|
|
214
281
|
const errors = [];
|
|
215
282
|
const snap = readReleaseMetadata(root);
|
|
216
283
|
const rootLabel = path.basename(resolvePath(root)) || "repo root";
|
|
@@ -306,7 +373,7 @@ export function releaseMetadataMain(opts = {}) {
|
|
|
306
373
|
const root = resolvePath(opts.root ?? rootDefault());
|
|
307
374
|
const out = opts.out ?? ((line) => process.stdout.write(line + "\n"));
|
|
308
375
|
const err = opts.err ?? ((line) => process.stderr.write(line + "\n"));
|
|
309
|
-
const errors = validateReleaseMetadata(root);
|
|
376
|
+
const errors = validateReleaseMetadata(root, opts.adapter);
|
|
310
377
|
if (errors.length > 0) {
|
|
311
378
|
out("release-metadata validation failed:");
|
|
312
379
|
for (const message of errors)
|
|
@@ -316,4 +383,3 @@ export function releaseMetadataMain(opts = {}) {
|
|
|
316
383
|
out("release-metadata ok");
|
|
317
384
|
return 0;
|
|
318
385
|
}
|
|
319
|
-
//# sourceMappingURL=releaseMetadata.js.map
|
|
@@ -775,4 +775,3 @@ export function inspectRuntimeLifecycleAdapters(context, contract = loadRuntimeL
|
|
|
775
775
|
export function applyRuntimeAdapterRepair(report, options = {}) {
|
|
776
776
|
return applyLifecycleOperations(report.repairPlan, options);
|
|
777
777
|
}
|
|
778
|
-
//# sourceMappingURL=lifecycleAdapters.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { resolveSourceRoot } from "../core/sourceRoot.js";
|
|
3
4
|
import { loadYamlMapping } from "../core/yaml.js";
|
|
4
5
|
import { LIFECYCLE_APPLY_STATUSES, LIFECYCLE_OPERATION_CONTRACT_RELATIVE_PATH, LIFECYCLE_PLAN_ACTIONS, LIFECYCLE_RESOURCE_STATES, } from "./lifecycleOperations.js";
|
|
5
6
|
function sameList(value, expected) {
|
|
@@ -97,18 +98,26 @@ export function validateLifecycleOperationContractData(value) {
|
|
|
97
98
|
}
|
|
98
99
|
return errors;
|
|
99
100
|
}
|
|
101
|
+
export function loadLifecycleOperationContract(contractPath = path.join(resolveSourceRoot(), LIFECYCLE_OPERATION_CONTRACT_RELATIVE_PATH)) {
|
|
102
|
+
const data = loadYamlMapping(fs.readFileSync(contractPath, "utf8"));
|
|
103
|
+
const errors = validateLifecycleOperationContractData(data);
|
|
104
|
+
if (errors.length > 0) {
|
|
105
|
+
throw new Error(`Lifecycle operation contract validation failed: ${errors.join("; ")}`);
|
|
106
|
+
}
|
|
107
|
+
return data;
|
|
108
|
+
}
|
|
100
109
|
export function validateLifecycleOperationContractRoot(root) {
|
|
101
110
|
const contractPath = path.join(root, LIFECYCLE_OPERATION_CONTRACT_RELATIVE_PATH);
|
|
102
111
|
if (!fs.existsSync(contractPath)) {
|
|
103
112
|
return [`${LIFECYCLE_OPERATION_CONTRACT_RELATIVE_PATH}:1: missing lifecycle operation contract`];
|
|
104
113
|
}
|
|
105
114
|
try {
|
|
106
|
-
|
|
115
|
+
loadLifecycleOperationContract(contractPath);
|
|
116
|
+
return [];
|
|
107
117
|
}
|
|
108
118
|
catch (error) {
|
|
109
119
|
return [
|
|
110
|
-
`${LIFECYCLE_OPERATION_CONTRACT_RELATIVE_PATH}: could not
|
|
120
|
+
`${LIFECYCLE_OPERATION_CONTRACT_RELATIVE_PATH}: could not load contract: ${error.message}`,
|
|
111
121
|
];
|
|
112
122
|
}
|
|
113
123
|
}
|
|
114
|
-
//# sourceMappingURL=lifecycleOperationContract.js.map
|