agentera 3.0.0-dev.7 → 3.0.0-dev.72
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 +118 -22
- package/bundle/CHANGELOG.md +1361 -0
- package/bundle/DESIGN.md +229 -0
- package/bundle/LICENSE +201 -0
- package/bundle/README.md +143 -0
- package/bundle/UPGRADE.md +252 -0
- package/bundle/extract-corpus-parity.json +2 -4
- package/bundle/fixtures/routing/hybrid-corpus.yaml +154 -0
- package/bundle/references/adapters/package-publication.json +488 -0
- package/bundle/references/adapters/package-registry.yaml +435 -188
- package/bundle/references/adapters/package-surface-characterization.md +66 -34
- 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 +266 -0
- package/bundle/references/artifacts/artifact-registry-interface-model.yaml +17 -8
- package/bundle/references/artifacts/glossary-entry-contract.yaml +1254 -0
- package/bundle/references/artifacts/state-storage-authority.yaml +3061 -0
- package/bundle/references/artifacts/verbosity-budget-authority.yaml +42 -0
- package/bundle/references/cli/app-lifecycle-vocabulary.yaml +3 -4
- package/bundle/references/cli/capability-instruction-contract.yaml +11 -14
- package/bundle/references/cli/hybrid-route-contract.yaml +438 -0
- package/bundle/references/cli/routing-model.md +152 -93
- package/bundle/references/cli/trigger-schema-enrichment.md +57 -46
- package/bundle/references/cli/update-channels.yaml +4 -2
- package/bundle/references/cli/vocabulary-index.yaml +5 -7
- package/bundle/references/cli/vocabulary.md +51 -93
- package/bundle/references/meta/retained-reference-authority.yaml +151 -0
- package/bundle/skills/agentera/SKILL.md +183 -63
- package/bundle/skills/agentera/capabilities/audit/schemas/artifacts.yaml +27 -19
- package/bundle/skills/agentera/capabilities/audit/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/audit/schemas/triggers.yaml +13 -35
- package/bundle/skills/agentera/capabilities/audit/schemas/validation.yaml +30 -11
- package/bundle/skills/agentera/capabilities/build/schemas/artifacts.yaml +44 -21
- package/bundle/skills/agentera/capabilities/build/schemas/exit.yaml +8 -6
- package/bundle/skills/agentera/capabilities/build/schemas/triggers.yaml +14 -36
- package/bundle/skills/agentera/capabilities/build/schemas/validation.yaml +95 -21
- package/bundle/skills/agentera/capabilities/design/schemas/artifacts.yaml +6 -6
- package/bundle/skills/agentera/capabilities/design/schemas/exit.yaml +5 -5
- package/bundle/skills/agentera/capabilities/design/schemas/triggers.yaml +5 -34
- package/bundle/skills/agentera/capabilities/design/schemas/validation.yaml +2 -2
- package/bundle/skills/agentera/capabilities/discuss/schemas/artifacts.yaml +17 -13
- package/bundle/skills/agentera/capabilities/discuss/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/discuss/schemas/triggers.yaml +6 -40
- package/bundle/skills/agentera/capabilities/discuss/schemas/validation.yaml +72 -5
- package/bundle/skills/agentera/capabilities/document/schemas/artifacts.yaml +24 -17
- package/bundle/skills/agentera/capabilities/document/schemas/triggers.yaml +5 -35
- package/bundle/skills/agentera/capabilities/document/schemas/validation.yaml +13 -13
- package/bundle/skills/agentera/capabilities/optimize/schemas/artifacts.yaml +10 -10
- package/bundle/skills/agentera/capabilities/optimize/schemas/exit.yaml +2 -2
- package/bundle/skills/agentera/capabilities/optimize/schemas/triggers.yaml +4 -35
- package/bundle/skills/agentera/capabilities/optimize/schemas/validation.yaml +3 -3
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/artifacts.yaml +34 -22
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/exit.yaml +9 -7
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/triggers.yaml +5 -37
- package/bundle/skills/agentera/capabilities/orchestrate/schemas/validation.yaml +38 -37
- package/bundle/skills/agentera/capabilities/plan/schemas/artifacts.yaml +20 -16
- package/bundle/skills/agentera/capabilities/plan/schemas/triggers.yaml +8 -31
- package/bundle/skills/agentera/capabilities/plan/schemas/validation.yaml +66 -6
- package/bundle/skills/agentera/capabilities/profile/schemas/artifacts.yaml +9 -4
- package/bundle/skills/agentera/capabilities/profile/schemas/exit.yaml +4 -4
- package/bundle/skills/agentera/capabilities/profile/schemas/triggers.yaml +8 -37
- package/bundle/skills/agentera/capabilities/profile/schemas/validation.yaml +61 -3
- package/bundle/skills/agentera/capabilities/research/schemas/artifacts.yaml +6 -6
- package/bundle/skills/agentera/capabilities/research/schemas/triggers.yaml +5 -29
- package/bundle/skills/agentera/capabilities/status/schemas/artifacts.yaml +13 -12
- package/bundle/skills/agentera/capabilities/status/schemas/triggers.yaml +7 -49
- package/bundle/skills/agentera/capabilities/vision/schemas/artifacts.yaml +8 -8
- package/bundle/skills/agentera/capabilities/vision/schemas/exit.yaml +7 -6
- package/bundle/skills/agentera/capabilities/vision/schemas/triggers.yaml +7 -39
- package/bundle/skills/agentera/capabilities/vision/schemas/validation.yaml +14 -16
- package/bundle/skills/agentera/capability_schema_contract.yaml +32 -32
- package/bundle/skills/agentera/protocol.yaml +4 -4
- package/bundle/skills/agentera/route-phrases.yaml +81 -0
- package/bundle/skills/agentera/schemas/artifacts/changelog.yaml +1 -0
- package/bundle/skills/agentera/schemas/artifacts/decisions.yaml +30 -12
- package/bundle/skills/agentera/schemas/artifacts/design.yaml +1 -0
- package/bundle/skills/agentera/schemas/artifacts/docs.yaml +7 -12
- package/bundle/skills/agentera/schemas/artifacts/experiments.yaml +140 -9
- package/bundle/skills/agentera/schemas/artifacts/glossary.yaml +82 -0
- package/bundle/skills/agentera/schemas/artifacts/health.yaml +56 -19
- package/bundle/skills/agentera/schemas/artifacts/objective.yaml +18 -4
- package/bundle/skills/agentera/schemas/artifacts/plan.yaml +457 -32
- package/bundle/skills/agentera/schemas/artifacts/progress.yaml +131 -18
- package/bundle/skills/agentera/schemas/artifacts/todo.yaml +302 -7
- package/dist/analytics/extractCorpus/cli.js +52 -11
- package/dist/analytics/extractCorpus/copilotSessions.js +6 -4
- package/dist/analytics/extractCorpus/core.js +40 -12
- package/dist/analytics/extractCorpus/corpus.js +39 -17
- package/dist/analytics/extractCorpus/coverageAudit.js +44 -45
- package/dist/analytics/extractCorpus/cursorSessions.js +6 -4
- package/dist/analytics/extractCorpus/evidenceTiers.js +603 -0
- package/dist/analytics/extractCorpus/extractCorpusParity.js +4 -4
- package/dist/analytics/extractCorpus/filesystemSources.js +1 -5
- package/dist/analytics/extractCorpus/index.js +3 -1
- package/dist/analytics/extractCorpus/jsonlSessions.js +24 -5
- package/dist/analytics/extractCorpus/sqliteCaps.js +0 -1
- package/dist/analytics/extractCorpus/sqliteSessions.js +0 -1
- package/dist/analytics/extractCorpus/tierReader.js +108 -0
- package/dist/analytics/extractCorpus.js +0 -1
- 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 +150 -23
- package/dist/audit/terminologyDrift.js +281 -0
- package/dist/bin/agentera.js +3 -2
- package/dist/capabilities/audit/instructions.js +16 -6
- package/dist/capabilities/build/instructions.js +59 -6
- package/dist/capabilities/design/instructions.js +3 -4
- package/dist/capabilities/discuss/instructions.js +29 -6
- package/dist/capabilities/document/instructions.js +11 -6
- package/dist/capabilities/index.js +16 -14
- package/dist/capabilities/optimize/instructions.js +14 -6
- package/dist/capabilities/orchestrate/instructions.js +42 -6
- package/dist/capabilities/plan/instructions.js +30 -3
- package/dist/capabilities/profile/instructions.js +70 -6
- package/dist/capabilities/research/instructions.js +4 -5
- package/dist/capabilities/status/instructions.js +15 -6
- package/dist/capabilities/status/startupInstructions.js +34 -0
- package/dist/capabilities/vision/instructions.js +3 -5
- package/dist/cli/appContext.js +14 -7
- package/dist/cli/argvalidate.js +0 -1
- package/dist/cli/capabilityContext/benchmark.js +5 -4
- package/dist/cli/capabilityContext/bespoke.js +14 -6
- package/dist/cli/capabilityContext/build.js +116 -42
- package/dist/cli/capabilityContext/closeout.js +30 -27
- package/dist/cli/capabilityContext/contract.js +18 -27
- package/dist/cli/capabilityContext/evidence.js +84 -77
- package/dist/cli/capabilityContext/index.js +0 -1
- package/dist/cli/capabilityContext/orchestration.js +42 -18
- package/dist/cli/capabilityContext/planState.js +89 -96
- package/dist/cli/capabilityContext/progress.js +51 -12
- package/dist/cli/capabilityContext/projectVerification.js +409 -0
- package/dist/cli/capabilityContext/shared.js +9 -20
- package/dist/cli/capabilityContext/slim.js +52 -8
- package/dist/cli/capabilityContext/startup.js +51 -114
- package/dist/cli/capabilityContext/startupAggregation.js +68 -0
- package/dist/cli/capabilityContext/types.js +26 -10
- 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 +163 -13
- package/dist/cli/commands/doctor.js +117 -11
- package/dist/cli/commands/durability.js +81 -0
- package/dist/cli/commands/glossaryAdvice.js +138 -0
- package/dist/cli/commands/lint.js +22 -8
- package/dist/cli/commands/personalGlossary.js +176 -0
- package/dist/cli/commands/prime/briefOrientation.js +746 -0
- package/dist/cli/commands/prime/buildExecutionRequest.js +165 -0
- package/dist/cli/commands/prime/bundleStatus.js +54 -4
- package/dist/cli/commands/prime/collectEntityOrientation.js +326 -0
- package/dist/cli/commands/prime/collectOrientationState.js +126 -63
- package/dist/cli/commands/prime/orientationOutput.js +267 -56
- package/dist/cli/commands/prime/types.js +0 -1
- package/dist/cli/commands/prime/v1Migration.js +0 -1
- package/dist/cli/commands/prime.js +76 -11
- package/dist/cli/commands/profileGrounding.js +55 -0
- package/dist/cli/commands/query.js +74 -52
- package/dist/cli/commands/report.js +73 -19
- package/dist/cli/commands/route.js +142 -0
- package/dist/cli/commands/schema.js +257 -138
- package/dist/cli/commands/state/decisions.js +40 -56
- package/dist/cli/commands/state/docs.js +58 -85
- package/dist/cli/commands/state/experimentRecords.js +151 -0
- package/dist/cli/commands/state/experiments.js +11 -65
- package/dist/cli/commands/state/get.js +129 -0
- package/dist/cli/commands/state/health.js +11 -113
- package/dist/cli/commands/state/index.js +6 -41
- package/dist/cli/commands/state/list.js +194 -0
- package/dist/cli/commands/state/objective.js +21 -65
- package/dist/cli/commands/state/plan.js +11 -170
- 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 +11 -45
- package/dist/cli/commands/state/shared.js +0 -1
- package/dist/cli/commands/state/todo.js +28 -107
- package/dist/cli/commands/state/write.js +433 -0
- package/dist/cli/commands/upgrade.js +146 -5
- package/dist/cli/commands/upgradeVerify.js +118 -0
- package/dist/cli/commands/validate.js +235 -136
- package/dist/cli/commands/verify.js +23 -8
- 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 +84 -40
- package/dist/cli/dispatch/commands.js +3 -3
- package/dist/cli/dispatch/index.js +77 -52
- package/dist/cli/dispatch/lifecycle.js +117 -62
- package/dist/cli/dispatch/prime.js +37 -2
- package/dist/cli/dispatch/projections.js +17 -0
- package/dist/cli/dispatch/shared.js +1 -2
- package/dist/cli/dispatch/state.js +62 -66
- package/dist/cli/dispatch.js +0 -1
- package/dist/cli/errors.js +16 -17
- package/dist/cli/help.js +358 -39
- package/dist/cli/migrationRequired.js +122 -0
- package/dist/cli/orientation/attention.js +19 -19
- package/dist/cli/orientation/corpusCoverage.js +32 -1
- package/dist/cli/orientation.js +346 -129
- 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 +11 -8
- package/dist/cli/stateQuery.js +47 -12
- package/dist/cli/structured.js +0 -1
- package/dist/cli/todoMarkdown.js +25 -12
- package/dist/cli/todoReadinessSelection.js +192 -0
- package/dist/cli/todoSeverity.js +0 -1
- 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 +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 +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 +13 -14
- package/dist/eval/hybridRouteEvaluation.js +155 -0
- package/dist/eval/semanticEval.js +0 -1
- package/dist/eval/semanticFixtures.js +0 -1
- package/dist/hooks/common.js +3 -56
- package/dist/hooks/compaction/apply.js +224 -47
- package/dist/hooks/compaction/dryRun.js +2 -1
- package/dist/hooks/compaction/index.js +5 -6
- package/dist/hooks/compaction/parse.js +73 -6
- package/dist/hooks/compaction/retention.js +28 -25
- package/dist/hooks/compaction/status.js +145 -26
- 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 +9 -10
- package/dist/hooks/validateArtifact/schema.js +96 -9
- package/dist/hooks/validateArtifact/traversal.js +12 -11
- package/dist/hooks/validateArtifact/violations.js +5 -3
- package/dist/migrate/v2HandoffManifest.js +8 -3
- package/dist/registries/activationContract.js +2 -0
- package/dist/registries/activationTuples.js +108 -0
- package/dist/registries/artifactProtocolIds.js +2 -1
- package/dist/registries/artifactRegistry.js +207 -60
- package/dist/registries/artifactSchemaProjection.js +45 -0
- package/dist/registries/capabilityContract.js +5 -21
- package/dist/registries/evaluatorHandoffContract.js +0 -1
- 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 +273 -0
- package/dist/registries/packageRegistry.js +184 -209
- package/dist/registries/todoReadinessContract.js +448 -0
- package/dist/registries/triggerLoader.js +7 -44
- package/dist/registries/verbosityBudgetContract.js +205 -0
- package/dist/release/releaseMetadata.js +155 -5
- 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 -13
- package/dist/setup/opencodeConstants.js +1 -0
- package/dist/setup/sharedSkill.js +45 -0
- package/dist/setup/smokeChecks.js +14 -75
- 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 +840 -0
- package/dist/state/entityMigrationTodo.js +133 -0
- package/dist/state/entityPublicationContext.js +859 -0
- package/dist/state/entityRetrievalHelp.js +506 -0
- package/dist/state/entityStorage.js +899 -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 +15 -7
- 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 +1027 -0
- package/dist/state/planIdentity.js +47 -0
- package/dist/state/planLineageValidation.js +52 -0
- package/dist/state/planReplacementTransaction.js +475 -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/progressWritePolicy.js +33 -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 +70 -9
- package/dist/state/startupAnalysis/contract.js +44 -10
- package/dist/state/startupAnalysis/helpers.js +1 -2
- 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 +13 -1
- package/dist/state/startupAnalysis.js +0 -1
- package/dist/state/startupProjection.js +499 -0
- package/dist/state/stateMode.js +222 -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/todoActivationSafety.js +58 -0
- package/dist/state/todoDocsEntities.js +1124 -0
- package/dist/state/todoDocsEntityValidation.js +158 -0
- package/dist/state/todoMarkdownProjection.js +51 -0
- package/dist/state/todoReconciliationActivation.js +182 -0
- package/dist/state/todoReconciliationInspection.js +171 -0
- package/dist/state/todoReconciliationRepair.js +318 -0
- package/dist/state/todoReconciliationTransaction.js +595 -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 +377 -0
- package/dist/state/write/fields.js +61 -0
- package/dist/state/write/glossaryPublication.js +263 -0
- package/dist/state/write/grammar.js +285 -0
- package/dist/state/write/helpers.js +29 -0
- package/dist/state/write/index.js +12 -0
- package/dist/state/write/input.js +391 -0
- package/dist/state/write/lock.js +837 -0
- package/dist/state/write/mutation.js +234 -0
- package/dist/state/write/operations.js +170 -0
- package/dist/state/write/planEvaluation.js +128 -0
- package/dist/state/write/planPublication.js +179 -0
- package/dist/state/write/runtimeOperations.js +146 -0
- package/dist/state/write/serialize.js +1 -0
- package/dist/state/write/transaction.js +57 -0
- package/dist/state/write/validate.js +7 -0
- package/dist/upgrade/appContentRefresh.js +77 -36
- package/dist/upgrade/appModel.js +0 -1
- package/dist/upgrade/atomicWriter.js +1 -0
- package/dist/upgrade/bundleEvidence.js +0 -1
- package/dist/upgrade/channels.js +6 -9
- package/dist/upgrade/compatibility.js +43 -17
- package/dist/upgrade/doctor.js +55 -32
- package/dist/upgrade/doctorClassifier.js +11 -1
- package/dist/upgrade/installedHooksRetirement.js +46 -40
- package/dist/upgrade/legacyAgentCleanup.js +187 -21
- package/dist/upgrade/lifecycleUpgrade.js +113 -0
- package/dist/upgrade/migrateArtifactsV2ToV3.js +334 -64
- package/dist/upgrade/migrationPublication.js +122 -0
- package/dist/upgrade/nextMajorDoctor.js +0 -1
- package/dist/upgrade/npxPlatformStatus.js +0 -1
- package/dist/upgrade/projectIntegration.js +121 -159
- package/dist/upgrade/projectIntegrationDecision.js +42 -85
- package/dist/upgrade/retiredResourceDiagnostics.js +117 -0
- package/dist/upgrade/runtimeMigration.js +262 -453
- 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 +2 -3
- package/dist/upgrade/versionResolution.js +0 -1
- package/dist/validate/activationArtifactEvidence.js +852 -0
- package/dist/validate/activationArtifactEvidenceTypes.js +12 -0
- package/dist/validate/activationConjunction.js +816 -0
- package/dist/validate/activationEvidenceManifest.js +531 -0
- package/dist/validate/activationPackageSemantics.js +29 -0
- package/dist/validate/appHomeContract.js +1 -7
- package/dist/validate/bootstrapAuthority.js +44 -0
- package/dist/validate/capability.js +11 -3
- package/dist/validate/crossCapability.js +14 -9
- package/dist/validate/retainedReferenceAuthority.js +879 -0
- package/dist/validate/selfAudit.js +39 -45
- package/dist/validate/v1LegacyCruft.js +131 -0
- package/dist/validate/vocabularyAuthority.js +8 -8
- package/package.json +41 -13
- package/bundle/references/adapters/cursor.md +0 -214
- 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 -554
- 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 -369
- package/bundle/references/cli/bundle-skill-vocabulary.yaml +0 -250
- 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/routing-execution-vocabulary.yaml +0 -281
- package/bundle/references/cli/single-name-protocol.yaml +0 -42
- package/bundle/references/cli/upgrade-repair-wording.md +0 -45
- package/bundle/references/cli/v3-handoff-manifest.schema.yaml +0 -98
- package/bundle/references/meta/documentation-inventory.md +0 -49
- package/bundle/skills/agentera/.claude-plugin/plugin.json +0 -27
- package/bundle/skills/agentera/agents/audit.toml +0 -6
- package/bundle/skills/agentera/agents/build.toml +0 -6
- package/bundle/skills/agentera/agents/design.toml +0 -6
- package/bundle/skills/agentera/agents/discuss.toml +0 -6
- package/bundle/skills/agentera/agents/document.toml +0 -6
- package/bundle/skills/agentera/agents/optimize.toml +0 -6
- package/bundle/skills/agentera/agents/orchestrate.toml +0 -6
- package/bundle/skills/agentera/agents/plan.toml +0 -6
- package/bundle/skills/agentera/agents/profile.toml +0 -6
- package/bundle/skills/agentera/agents/research.toml +0 -6
- package/bundle/skills/agentera/agents/status.toml +0 -6
- package/bundle/skills/agentera/agents/vision.toml +0 -6
- package/bundle/skills/agentera/references/contract.md +0 -1048
- 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/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.js.map +0 -1
- package/dist/analytics/usageStats.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/dokumentera/instructions.js +0 -6
- package/dist/capabilities/dokumentera/instructions.js.map +0 -1
- package/dist/capabilities/hej/instructions.js +0 -6
- package/dist/capabilities/hej/instructions.js.map +0 -1
- package/dist/capabilities/index.js.map +0 -1
- package/dist/capabilities/inspektera/instructions.js +0 -6
- package/dist/capabilities/inspektera/instructions.js.map +0 -1
- package/dist/capabilities/inspirera/instructions.js +0 -6
- package/dist/capabilities/inspirera/instructions.js.map +0 -1
- package/dist/capabilities/optimera/instructions.js +0 -6
- package/dist/capabilities/optimera/instructions.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/orkestrera/instructions.js +0 -6
- package/dist/capabilities/orkestrera/instructions.js.map +0 -1
- package/dist/capabilities/plan/instructions.js.map +0 -1
- package/dist/capabilities/planera/instructions.js +0 -6
- package/dist/capabilities/planera/instructions.js.map +0 -1
- package/dist/capabilities/profile/instructions.js.map +0 -1
- package/dist/capabilities/profilera/instructions.js +0 -6
- package/dist/capabilities/profilera/instructions.js.map +0 -1
- package/dist/capabilities/realisera/instructions.js +0 -6
- package/dist/capabilities/realisera/instructions.js.map +0 -1
- package/dist/capabilities/research/instructions.js.map +0 -1
- package/dist/capabilities/resonera/instructions.js +0 -6
- package/dist/capabilities/resonera/instructions.js.map +0 -1
- package/dist/capabilities/status/instructions.js.map +0 -1
- package/dist/capabilities/vision/instructions.js.map +0 -1
- package/dist/capabilities/visionera/instructions.js +0 -6
- package/dist/capabilities/visionera/instructions.js.map +0 -1
- package/dist/capabilities/visualisera/instructions.js +0 -5
- package/dist/capabilities/visualisera/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/realisera.js +0 -174
- package/dist/cli/capabilityContext/realisera.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/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/bundleStatus.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/routeOutput.js +0 -50
- package/dist/cli/commands/prime/routeOutput.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/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/decisions.js.map +0 -1
- package/dist/cli/commands/state/docs.js.map +0 -1
- package/dist/cli/commands/state/experiments.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/objective.js.map +0 -1
- package/dist/cli/commands/state/plan.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.js +0 -1023
- 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/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/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/prime-blob.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/todoSeverity.js.map +0 -1
- package/dist/core/difflib.js.map +0 -1
- package/dist/core/envPaths.js.map +0 -1
- package/dist/core/git.js +0 -43
- package/dist/core/git.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/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/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/todoResolved.js +0 -137
- package/dist/hooks/compaction/todoResolved.js.map +0 -1
- package/dist/hooks/compaction/types.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 -79
- package/dist/hooks/cursorSessionStart.js.map +0 -1
- package/dist/hooks/sessionStart.js +0 -216
- package/dist/hooks/sessionStart.js.map +0 -1
- package/dist/hooks/sessionStop.js +0 -206
- package/dist/hooks/sessionStop.js.map +0 -1
- package/dist/hooks/todoLayout.js +0 -177
- package/dist/hooks/todoLayout.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/hooks/validateArtifact.js +0 -924
- package/dist/hooks/validateArtifact.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/capabilityContract.js.map +0 -1
- package/dist/registries/evaluatorHandoffContract.js.map +0 -1
- package/dist/registries/packageRegistry.js.map +0 -1
- package/dist/registries/runtimeAdapterRegistry.js +0 -316
- package/dist/registries/runtimeAdapterRegistry.js.map +0 -1
- package/dist/registries/triggerLoader.js.map +0 -1
- package/dist/release/releaseMetadata.js.map +0 -1
- package/dist/routing/index.js +0 -2
- package/dist/routing/index.js.map +0 -1
- package/dist/routing/routeEngine.js +0 -189
- package/dist/routing/routeEngine.js.map +0 -1
- package/dist/setup/codex/agents.js +0 -96
- package/dist/setup/codex/agents.js.map +0 -1
- package/dist/setup/codex/cli.js +0 -161
- package/dist/setup/codex/cli.js.map +0 -1
- package/dist/setup/codex/configToml.js +0 -639
- package/dist/setup/codex/configToml.js.map +0 -1
- package/dist/setup/codex/constants.js +0 -29
- 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 -270
- package/dist/setup/codex/state.js.map +0 -1
- package/dist/setup/codex.js +0 -12
- 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 -129
- package/dist/setup/cursor.js.map +0 -1
- package/dist/setup/cursorSurfaces.js +0 -67
- package/dist/setup/cursorSurfaces.js.map +0 -1
- package/dist/setup/doctor/core.js +0 -300
- package/dist/setup/doctor/core.js.map +0 -1
- package/dist/setup/doctor/diagnostics.js +0 -240
- package/dist/setup/doctor/diagnostics.js.map +0 -1
- package/dist/setup/doctor/opencode.js +0 -313
- package/dist/setup/doctor/opencode.js.map +0 -1
- package/dist/setup/doctor/report.js +0 -425
- package/dist/setup/doctor/report.js.map +0 -1
- package/dist/setup/doctor.js +0 -10
- package/dist/setup/doctor.js.map +0 -1
- package/dist/setup/opencode.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/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/upgrade/appContentRefresh.js.map +0 -1
- package/dist/upgrade/appModel.js.map +0 -1
- package/dist/upgrade/bundleEvidence.js.map +0 -1
- package/dist/upgrade/channels.js.map +0 -1
- package/dist/upgrade/cliProbe.js +0 -22
- package/dist/upgrade/cliProbe.js.map +0 -1
- package/dist/upgrade/coexistenceProbe.js +0 -107
- 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/migrateArtifactsV1ToV2.js +0 -570
- package/dist/upgrade/migrateArtifactsV1ToV2.js.map +0 -1
- package/dist/upgrade/migrateArtifactsV2ToV3.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/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/lifecycleAdapters/legacyPythonParity.js +0 -93
- package/dist/validate/lifecycleAdapters/legacyPythonParity.js.map +0 -1
- package/dist/validate/lifecycleAdapters/nodeFormChecks.js +0 -488
- package/dist/validate/lifecycleAdapters/nodeFormChecks.js.map +0 -1
- package/dist/validate/lifecycleAdapters/shared.js +0 -198
- package/dist/validate/lifecycleAdapters/shared.js.map +0 -1
- package/dist/validate/lifecycleAdapters.js +0 -62
- package/dist/validate/lifecycleAdapters.js.map +0 -1
- package/dist/validate/selfAudit.js.map +0 -1
- package/dist/validate/vocabularyAuthority.js.map +0 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
1
|
import os from "node:os";
|
|
3
2
|
import path from "node:path";
|
|
4
|
-
import { pyJsonIndent } from "../../core/pyjson.js";
|
|
5
3
|
import { defaultOutputPath, } from "./core.js";
|
|
4
|
+
import { defaultTiersDir, publishEvidenceTiers } from "./evidenceTiers.js";
|
|
6
5
|
import { buildCorpus } from "./corpus.js";
|
|
7
6
|
import { COVERAGE_EXIT_FLAGGED, corpusEnvelopeCoverage, formatCoverageSummaryText, runCoverageAudit, } from "./coverageAudit.js";
|
|
8
7
|
import { formatTruncationWarnings, resolveSqliteCaps } from "./sqliteCaps.js";
|
|
@@ -11,6 +10,7 @@ export function parseExtractArgs(argv, env = process.env, platform = process.pla
|
|
|
11
10
|
const home = env.HOME || (platform === "win32" ? env.USERPROFILE : undefined) || os.homedir();
|
|
12
11
|
const args = {
|
|
13
12
|
output: defaultOutputPath(env, platform),
|
|
13
|
+
tierOutput: null,
|
|
14
14
|
projectRoot: [],
|
|
15
15
|
codexSessionsDir: path.join(home, ".codex", "sessions"),
|
|
16
16
|
claudeProjectsDir: path.join(home, ".claude", "projects"),
|
|
@@ -19,7 +19,7 @@ export function parseExtractArgs(argv, env = process.env, platform = process.pla
|
|
|
19
19
|
cursorProjectsDir: null,
|
|
20
20
|
cursorChatsDir: null,
|
|
21
21
|
noCodex: false,
|
|
22
|
-
|
|
22
|
+
importSources: [],
|
|
23
23
|
noOpencode: false,
|
|
24
24
|
noCopilot: false,
|
|
25
25
|
noCursor: false,
|
|
@@ -27,6 +27,7 @@ export function parseExtractArgs(argv, env = process.env, platform = process.pla
|
|
|
27
27
|
coverageAuditOnly: false,
|
|
28
28
|
format: "text",
|
|
29
29
|
};
|
|
30
|
+
let claudeProjectsDirExplicit = false;
|
|
30
31
|
for (let i = 0; i < argv.length; i++) {
|
|
31
32
|
const a = argv[i];
|
|
32
33
|
const val = (name) => {
|
|
@@ -37,14 +38,28 @@ export function parseExtractArgs(argv, env = process.env, platform = process.pla
|
|
|
37
38
|
return null;
|
|
38
39
|
};
|
|
39
40
|
let v;
|
|
41
|
+
// `--output` is a deprecated no-op for back-compat: it targeted the
|
|
42
|
+
// eliminated monolithic corpus.json write. Refresh now publishes bounded
|
|
43
|
+
// tiers via `--tier-output` (default: `defaultTiersDir`). `--output` is
|
|
44
|
+
// accepted to keep older callers from hard-crashing but has no effect.
|
|
40
45
|
if ((v = val("--output")) !== null)
|
|
41
46
|
args.output = v;
|
|
47
|
+
else if ((v = val("--tier-output")) !== null)
|
|
48
|
+
args.tierOutput = v;
|
|
42
49
|
else if ((v = val("--project-root")) !== null)
|
|
43
50
|
args.projectRoot.push(v);
|
|
44
51
|
else if ((v = val("--codex-sessions-dir")) !== null)
|
|
45
52
|
args.codexSessionsDir = v;
|
|
46
|
-
else if ((v = val("--claude-projects-dir")) !== null)
|
|
53
|
+
else if ((v = val("--claude-projects-dir")) !== null) {
|
|
47
54
|
args.claudeProjectsDir = v;
|
|
55
|
+
claudeProjectsDirExplicit = true;
|
|
56
|
+
}
|
|
57
|
+
else if ((v = val("--import-source")) !== null) {
|
|
58
|
+
if (v !== "claude")
|
|
59
|
+
throw new Error(`extract-corpus: unsupported historical import source '${v}'; valid source: claude`);
|
|
60
|
+
if (!args.importSources.includes(v))
|
|
61
|
+
args.importSources.push(v);
|
|
62
|
+
}
|
|
48
63
|
else if ((v = val("--opencode-conversations-dir")) !== null)
|
|
49
64
|
args.opencodeConversationsDir = v;
|
|
50
65
|
else if ((v = val("--copilot-conversations-dir")) !== null)
|
|
@@ -55,8 +70,6 @@ export function parseExtractArgs(argv, env = process.env, platform = process.pla
|
|
|
55
70
|
args.cursorChatsDir = v;
|
|
56
71
|
else if (a === "--no-codex")
|
|
57
72
|
args.noCodex = true;
|
|
58
|
-
else if (a === "--no-claude")
|
|
59
|
-
args.noClaude = true;
|
|
60
73
|
else if (a === "--no-opencode")
|
|
61
74
|
args.noOpencode = true;
|
|
62
75
|
else if (a === "--no-copilot")
|
|
@@ -87,6 +100,9 @@ export function parseExtractArgs(argv, env = process.env, platform = process.pla
|
|
|
87
100
|
else
|
|
88
101
|
throw new Error(`extract-corpus: unrecognized argument: ${a}`);
|
|
89
102
|
}
|
|
103
|
+
if (claudeProjectsDirExplicit && !args.importSources.includes("claude")) {
|
|
104
|
+
throw new Error("extract-corpus: --claude-projects-dir requires explicit --import-source claude");
|
|
105
|
+
}
|
|
90
106
|
return args;
|
|
91
107
|
}
|
|
92
108
|
/** Engine entry point mirroring scripts/extract_corpus.py main(). */
|
|
@@ -105,6 +121,10 @@ export function extractCorpusMain(argv, io = {}) {
|
|
|
105
121
|
return 2;
|
|
106
122
|
}
|
|
107
123
|
const projectRoots = args.projectRoot.length > 0 ? args.projectRoot : [cwd];
|
|
124
|
+
if (args.importSources.includes("claude")) {
|
|
125
|
+
err("Historical import warning: Claude transcripts can contain secrets, file contents, and command output. " +
|
|
126
|
+
"Import is local and read-only; records are labeled historical_import and excluded from active-runtime analytics.");
|
|
127
|
+
}
|
|
108
128
|
const audit = runCoverageAudit(args, env, platform, args.acceptCoverageGap);
|
|
109
129
|
if (args.format === "json") {
|
|
110
130
|
out(JSON.stringify({ coverage_audit: audit }, null, 2));
|
|
@@ -126,7 +146,7 @@ export function extractCorpusMain(argv, io = {}) {
|
|
|
126
146
|
const corpus = buildCorpus({
|
|
127
147
|
projectRoots,
|
|
128
148
|
codexSessionsDir: args.noCodex ? null : args.codexSessionsDir,
|
|
129
|
-
claudeProjectsDir: args.
|
|
149
|
+
claudeProjectsDir: args.importSources.includes("claude") ? args.claudeProjectsDir : null,
|
|
130
150
|
opencodeConversationsDir: args.noOpencode ? null : args.opencodeConversationsDir || resolveOpencodeDbPath(env),
|
|
131
151
|
copilotConversationsDir: args.noCopilot ? null : args.copilotConversationsDir || resolveCopilotStorePath(env),
|
|
132
152
|
cursorProjectsDir: skipCursor ? null : args.cursorProjectsDir || resolveCursorProjectsPath(env),
|
|
@@ -134,8 +154,6 @@ export function extractCorpusMain(argv, io = {}) {
|
|
|
134
154
|
coverage: corpusEnvelopeCoverage(audit),
|
|
135
155
|
sqliteCaps,
|
|
136
156
|
});
|
|
137
|
-
fs.mkdirSync(path.dirname(args.output), { recursive: true });
|
|
138
|
-
fs.writeFileSync(args.output, pyJsonIndent(corpus) + "\n", "utf-8");
|
|
139
157
|
const truncationWarning = formatTruncationWarnings(corpus.metadata.runtime_statuses);
|
|
140
158
|
if (truncationWarning)
|
|
141
159
|
err(truncationWarning);
|
|
@@ -143,7 +161,30 @@ export function extractCorpusMain(argv, io = {}) {
|
|
|
143
161
|
const familyBits = Object.entries(corpus.metadata.families)
|
|
144
162
|
.map(([name, summary]) => `${name}=${summary.count}`)
|
|
145
163
|
.join(", ");
|
|
146
|
-
|
|
164
|
+
// Publish bounded evidence tiers as the canonical bounded publication output.
|
|
165
|
+
// The monolithic corpus envelope write is eliminated: all bounded consumers
|
|
166
|
+
// (usage, report, prime coverage, startup analysis, profile synthesis) read
|
|
167
|
+
// the signal tier and full-evidence shards directly. Legacy monolithic state
|
|
168
|
+
// receives deterministic refresh guidance rather than read compatibility.
|
|
169
|
+
const tiersDir = args.tierOutput ?? defaultTiersDir(env, platform);
|
|
170
|
+
const publication = publishEvidenceTiers(corpus.records, {
|
|
171
|
+
tiersDir,
|
|
172
|
+
adapterVersion: corpus.metadata.adapter_version,
|
|
173
|
+
runtimeStatuses: corpus.metadata.runtime_statuses,
|
|
174
|
+
env,
|
|
175
|
+
platform,
|
|
176
|
+
corpusMetadata: {
|
|
177
|
+
extracted_at: corpus.metadata.extracted_at,
|
|
178
|
+
runtime_statuses: corpus.metadata.runtime_statuses,
|
|
179
|
+
coverage_envelope: {
|
|
180
|
+
available_runtimes: corpus.metadata.available_runtimes,
|
|
181
|
+
selected_runtimes: corpus.metadata.selected_runtimes,
|
|
182
|
+
available_but_not_selected: corpus.metadata.available_but_not_selected,
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
out(`published tiers: ${tiersDir} (generation ${publication.generation}; ` +
|
|
187
|
+
`${publication.shard_count} shards; ${publication.signal_count} signals; ` +
|
|
188
|
+
`${publication.signal_bytes} bytes${publication.signal_selection.capped ? "; selection applied" : ""}) [${total} records; ${familyBits}]`);
|
|
147
189
|
return 0;
|
|
148
190
|
}
|
|
149
|
-
//# sourceMappingURL=cli.js.map
|
|
@@ -233,7 +233,8 @@ export function extractCopilotSessions(storePath, errors, ctx) {
|
|
|
233
233
|
sourceKind: "conversation_turn",
|
|
234
234
|
timestamp,
|
|
235
235
|
projectPath,
|
|
236
|
-
runtime: "
|
|
236
|
+
runtime: "copilot",
|
|
237
|
+
sourceProduct: "github-copilot",
|
|
237
238
|
sourceParts: [resolvePath(dbPath), index, role, content.slice(0, 80)],
|
|
238
239
|
sessionId: String(row.session_id),
|
|
239
240
|
data,
|
|
@@ -246,7 +247,8 @@ export function extractCopilotSessions(storePath, errors, ctx) {
|
|
|
246
247
|
sourceKind: "tool_call",
|
|
247
248
|
timestamp,
|
|
248
249
|
projectPath,
|
|
249
|
-
runtime: "
|
|
250
|
+
runtime: "copilot",
|
|
251
|
+
sourceProduct: "github-copilot",
|
|
250
252
|
sourceParts: [resolvePath(dbPath), index, toolIndex, "tool", toolItem.tool_name, row.turn_id],
|
|
251
253
|
sessionId: String(row.session_id),
|
|
252
254
|
data: { tool_name: String(toolItem.tool_name), arguments: toolItem.arguments || {} },
|
|
@@ -259,7 +261,8 @@ export function extractCopilotSessions(storePath, errors, ctx) {
|
|
|
259
261
|
sourceKind: "history_prompt",
|
|
260
262
|
timestamp,
|
|
261
263
|
projectPath,
|
|
262
|
-
runtime: "
|
|
264
|
+
runtime: "copilot",
|
|
265
|
+
sourceProduct: "github-copilot",
|
|
263
266
|
sourceParts: [resolvePath(dbPath), index, "history", content.slice(0, 120)],
|
|
264
267
|
sessionId: String(row.session_id),
|
|
265
268
|
data: { prompt: content, signal_type: sig },
|
|
@@ -270,4 +273,3 @@ export function extractCopilotSessions(storePath, errors, ctx) {
|
|
|
270
273
|
}
|
|
271
274
|
return records;
|
|
272
275
|
}
|
|
273
|
-
//# sourceMappingURL=copilotSessions.js.map
|
|
@@ -5,7 +5,7 @@ import { resolveProfileDirOverride, resolveXdgDataHome } from "../../core/envPat
|
|
|
5
5
|
import { expanduser } from "../../core/paths.js";
|
|
6
6
|
import crypto from "node:crypto";
|
|
7
7
|
import { resolvePath } from "../../core/paths.js";
|
|
8
|
-
export const ADAPTER_VERSION = "agentera-
|
|
8
|
+
export const ADAPTER_VERSION = "agentera-v3-corpus-2";
|
|
9
9
|
export const FAMILIES = [
|
|
10
10
|
"instruction_document",
|
|
11
11
|
"history_prompt",
|
|
@@ -15,12 +15,14 @@ export const FAMILIES = [
|
|
|
15
15
|
];
|
|
16
16
|
export const RUNTIME_STORE_GLOBS = {
|
|
17
17
|
codex: "*.jsonl",
|
|
18
|
-
"claude-code": "*.jsonl",
|
|
19
18
|
cursor: "*.jsonl",
|
|
20
|
-
"cursor-agent": "store.db",
|
|
21
19
|
opencode: "opencode.db",
|
|
22
|
-
|
|
20
|
+
copilot: "session-store.db",
|
|
21
|
+
};
|
|
22
|
+
export const HISTORICAL_IMPORT_STORE_GLOBS = {
|
|
23
|
+
"claude-code": "*.jsonl",
|
|
23
24
|
};
|
|
25
|
+
const ACTIVE_ANALYTICS_RUNTIMES = new Set(["opencode", "codex", "cursor", "copilot"]);
|
|
24
26
|
export const MAX_TOOL_ARG_TEXT = 500;
|
|
25
27
|
export const MAX_SQLITE_ROWS = 100_000;
|
|
26
28
|
export const MAX_SQLITE_SESSIONS = 60;
|
|
@@ -85,7 +87,15 @@ export function defaultOutputPath(env = process.env, platform = process.platform
|
|
|
85
87
|
return path.join(defaultProfileDir(env, platform), "intermediate", "corpus.json");
|
|
86
88
|
}
|
|
87
89
|
export function runtimeStatus(runtime, opts) {
|
|
88
|
-
const
|
|
90
|
+
const activeRuntime = opts.activeRuntime ?? (runtime !== null && ACTIVE_ANALYTICS_RUNTIMES.has(runtime));
|
|
91
|
+
const item = {
|
|
92
|
+
runtime,
|
|
93
|
+
source_class: opts.sourceClass ?? (activeRuntime ? "active_runtime" : "historical_import"),
|
|
94
|
+
source_product: opts.sourceProduct ?? runtime ?? "unknown",
|
|
95
|
+
active_runtime: activeRuntime,
|
|
96
|
+
status: opts.status,
|
|
97
|
+
reason: opts.reason,
|
|
98
|
+
};
|
|
89
99
|
if (opts.storePath !== null && opts.storePath !== undefined)
|
|
90
100
|
item.store_path = opts.storePath;
|
|
91
101
|
if (opts.fileCount !== null && opts.fileCount !== undefined)
|
|
@@ -146,24 +156,31 @@ function rglob(root, pattern) {
|
|
|
146
156
|
walk(root);
|
|
147
157
|
return out.sort();
|
|
148
158
|
}
|
|
149
|
-
export function discoverRuntimeStore(runtime, storePath) {
|
|
159
|
+
export function discoverRuntimeStore(runtime, storePath, opts = {}) {
|
|
160
|
+
const statusOpts = {
|
|
161
|
+
sourceProduct: opts.sourceProduct,
|
|
162
|
+
sourceClass: opts.sourceClass,
|
|
163
|
+
activeRuntime: opts.activeRuntime,
|
|
164
|
+
};
|
|
150
165
|
if (storePath === null) {
|
|
151
|
-
return runtimeStatus(runtime, { status: "skipped", reason: "disabled", storePath: null });
|
|
166
|
+
return runtimeStatus(runtime, { status: "skipped", reason: "disabled", storePath: null, ...statusOpts });
|
|
152
167
|
}
|
|
153
168
|
if (!fs.existsSync(storePath)) {
|
|
154
169
|
return runtimeStatus(runtime, {
|
|
155
170
|
status: "missing",
|
|
156
171
|
reason: "store_absent",
|
|
157
172
|
storePath,
|
|
158
|
-
remediationLabels: runtime === "
|
|
173
|
+
remediationLabels: runtime === "copilot" ? [COPILOT_SPARSE_REMEDIATION] : null,
|
|
174
|
+
...statusOpts,
|
|
159
175
|
});
|
|
160
176
|
}
|
|
161
|
-
if (
|
|
177
|
+
if (isFilePath(storePath)) {
|
|
162
178
|
return runtimeStatus(runtime, {
|
|
163
179
|
status: "available",
|
|
164
180
|
reason: "candidate_files_found",
|
|
165
181
|
storePath,
|
|
166
182
|
fileCount: 1,
|
|
183
|
+
...statusOpts,
|
|
167
184
|
});
|
|
168
185
|
}
|
|
169
186
|
if (!isDir(storePath)) {
|
|
@@ -171,7 +188,10 @@ export function discoverRuntimeStore(runtime, storePath) {
|
|
|
171
188
|
}
|
|
172
189
|
let candidates;
|
|
173
190
|
try {
|
|
174
|
-
|
|
191
|
+
const pattern = opts.pattern ?? (runtime === null ? undefined : RUNTIME_STORE_GLOBS[runtime]);
|
|
192
|
+
if (!pattern)
|
|
193
|
+
throw new Error("no declared store pattern");
|
|
194
|
+
candidates = rglob(storePath, pattern);
|
|
175
195
|
}
|
|
176
196
|
catch {
|
|
177
197
|
return runtimeStatus(runtime, { status: "degraded", reason: "store_unreadable", storePath });
|
|
@@ -182,7 +202,8 @@ export function discoverRuntimeStore(runtime, storePath) {
|
|
|
182
202
|
reason: "no_candidate_files",
|
|
183
203
|
storePath,
|
|
184
204
|
fileCount: 0,
|
|
185
|
-
remediationLabels: runtime === "
|
|
205
|
+
remediationLabels: runtime === "copilot" ? [COPILOT_SPARSE_REMEDIATION] : null,
|
|
206
|
+
...statusOpts,
|
|
186
207
|
});
|
|
187
208
|
}
|
|
188
209
|
return runtimeStatus(runtime, {
|
|
@@ -190,6 +211,7 @@ export function discoverRuntimeStore(runtime, storePath) {
|
|
|
190
211
|
reason: "candidate_files_found",
|
|
191
212
|
storePath,
|
|
192
213
|
fileCount: candidates.length,
|
|
214
|
+
...statusOpts,
|
|
193
215
|
});
|
|
194
216
|
}
|
|
195
217
|
// ── record builders + content helpers ──────────────────────────────
|
|
@@ -200,12 +222,16 @@ export function splitLines(text) {
|
|
|
200
222
|
return parts;
|
|
201
223
|
}
|
|
202
224
|
export function record(opts) {
|
|
225
|
+
const activeRuntime = opts.activeRuntime ?? (opts.runtime !== null && ACTIVE_ANALYTICS_RUNTIMES.has(opts.runtime));
|
|
203
226
|
const item = {
|
|
204
227
|
source_id: stableId(opts.sourceKind, ...opts.sourceParts),
|
|
205
228
|
timestamp: opts.timestamp,
|
|
206
229
|
project_id: projectIdFromPath(opts.projectPath),
|
|
207
230
|
source_kind: opts.sourceKind,
|
|
208
231
|
runtime: opts.runtime,
|
|
232
|
+
source_class: opts.sourceClass ?? (activeRuntime ? "active_runtime" : "project"),
|
|
233
|
+
source_product: opts.sourceProduct ?? opts.runtime ?? "unknown",
|
|
234
|
+
active_runtime: activeRuntime,
|
|
209
235
|
adapter_version: ADAPTER_VERSION,
|
|
210
236
|
data: opts.data,
|
|
211
237
|
};
|
|
@@ -352,6 +378,9 @@ export function toolCallRecordFromItem(args) {
|
|
|
352
378
|
timestamp: eventTimestamp(event, args.fallbackTimestamp),
|
|
353
379
|
projectPath: args.projectPath,
|
|
354
380
|
runtime: args.runtime,
|
|
381
|
+
sourceClass: args.sourceClass,
|
|
382
|
+
sourceProduct: args.sourceProduct,
|
|
383
|
+
activeRuntime: args.activeRuntime,
|
|
355
384
|
sourceParts: [resolvePath(args.sourcePath), args.index, "tool", toolName],
|
|
356
385
|
sessionId: args.sessionId,
|
|
357
386
|
data: { tool_name: toolName, arguments: argumentsVal }, // cast: parsed JSON IO boundary
|
|
@@ -361,4 +390,3 @@ export function toolCallRecord(args) {
|
|
|
361
390
|
return toolCallRecordFromItem({ ...args, item: payloadItem(args.event) });
|
|
362
391
|
}
|
|
363
392
|
export { isPlainObject, rglob, isDir, isFilePath };
|
|
364
|
-
//# sourceMappingURL=core.js.map
|
|
@@ -10,8 +10,12 @@ import { resolvePath } from "../../core/paths.js";
|
|
|
10
10
|
import { applyTruncationToStatus } from "./sqliteCaps.js";
|
|
11
11
|
export class ExtractionNotImplementedError extends Error {
|
|
12
12
|
}
|
|
13
|
-
function extractRuntimeStore(runtime, storePath, errors, extractor, sqliteCaps
|
|
14
|
-
|
|
13
|
+
function extractRuntimeStore(runtime, storePath, errors, extractor, sqliteCaps, provenance = {
|
|
14
|
+
sourceProduct: runtime ?? "unknown",
|
|
15
|
+
sourceClass: "active_runtime",
|
|
16
|
+
activeRuntime: true,
|
|
17
|
+
}) {
|
|
18
|
+
const discovery = discoverRuntimeStore(runtime, storePath, provenance);
|
|
15
19
|
if (discovery.status !== "available")
|
|
16
20
|
return [[], discovery];
|
|
17
21
|
const errorStart = errors.length;
|
|
@@ -23,17 +27,17 @@ function extractRuntimeStore(runtime, storePath, errors, extractor, sqliteCaps)
|
|
|
23
27
|
catch (exc) {
|
|
24
28
|
const fc = (discovery.file_count ?? null); // cast: discovery payload IO boundary
|
|
25
29
|
if (exc instanceof ExtractionNotImplementedError) {
|
|
26
|
-
return [[], runtimeStatus(runtime, { status: "degraded", reason: "extractor_unimplemented", storePath, fileCount: fc, recordCount: 0, errorCount: 0 })];
|
|
30
|
+
return [[], runtimeStatus(runtime, { status: "degraded", reason: "extractor_unimplemented", storePath, fileCount: fc, recordCount: 0, errorCount: 0, ...provenance })];
|
|
27
31
|
}
|
|
28
32
|
if (exc instanceof PermissionDeniedError) {
|
|
29
|
-
return [[], runtimeStatus(runtime, { status: "degraded", reason: "store_locked", storePath, fileCount: fc })];
|
|
33
|
+
return [[], runtimeStatus(runtime, { status: "degraded", reason: "store_locked", storePath, fileCount: fc, ...provenance })];
|
|
30
34
|
}
|
|
31
|
-
return [[], runtimeStatus(runtime, { status: "degraded", reason: "store_unreadable", storePath, fileCount: fc })];
|
|
35
|
+
return [[], runtimeStatus(runtime, { status: "degraded", reason: "store_unreadable", storePath, fileCount: fc, ...provenance })];
|
|
32
36
|
}
|
|
33
37
|
const fc = (discovery.file_count ?? null); // cast: discovery payload IO boundary
|
|
34
38
|
const errorCount = errors.length - errorStart;
|
|
35
39
|
if (errorCount) {
|
|
36
|
-
return [records, runtimeStatus(runtime, { status: "degraded", reason: "schema_divergent", storePath, fileCount: fc, recordCount: records.length, errorCount })];
|
|
40
|
+
return [records, runtimeStatus(runtime, { status: "degraded", reason: "schema_divergent", storePath, fileCount: fc, recordCount: records.length, errorCount, ...provenance })];
|
|
37
41
|
}
|
|
38
42
|
if (records.length === 0) {
|
|
39
43
|
return [records, runtimeStatus(runtime, {
|
|
@@ -42,12 +46,13 @@ function extractRuntimeStore(runtime, storePath, errors, extractor, sqliteCaps)
|
|
|
42
46
|
storePath,
|
|
43
47
|
fileCount: fc,
|
|
44
48
|
recordCount: 0,
|
|
45
|
-
remediationLabels: runtime === "
|
|
49
|
+
remediationLabels: runtime === "copilot" ? [COPILOT_SPARSE_REMEDIATION] : null,
|
|
50
|
+
...provenance,
|
|
46
51
|
})];
|
|
47
52
|
}
|
|
48
53
|
return [
|
|
49
54
|
records,
|
|
50
|
-
applyTruncationToStatus(runtimeStatus(runtime, { status: "ok", reason: "records_extracted", storePath, fileCount: fc, recordCount: records.length, errorCount: 0 }), ctx.truncation),
|
|
55
|
+
applyTruncationToStatus(runtimeStatus(runtime, { status: "ok", reason: "records_extracted", storePath, fileCount: fc, recordCount: records.length, errorCount: 0, ...provenance }), ctx.truncation),
|
|
51
56
|
];
|
|
52
57
|
}
|
|
53
58
|
export function dedupeRecords(records) {
|
|
@@ -90,7 +95,9 @@ export function buildMetadata(records, errors, runtimeStatuses, coverage) {
|
|
|
90
95
|
if (count === 0)
|
|
91
96
|
families[family].error = "no records extracted for this family";
|
|
92
97
|
}
|
|
93
|
-
const runtimes = Array.from(new Set(records.filter((
|
|
98
|
+
const runtimes = Array.from(new Set(records.filter((item) => item.active_runtime === true && item.runtime).map((item) => String(item.runtime)))).sort();
|
|
99
|
+
const sourceClasses = Array.from(new Set(records.map((item) => String(item.source_class)))).sort();
|
|
100
|
+
const sourceProducts = Array.from(new Set(records.map((item) => String(item.source_product)))).sort();
|
|
94
101
|
const coverageFields = coverage ?? {
|
|
95
102
|
available_runtimes: [],
|
|
96
103
|
selected_runtimes: [],
|
|
@@ -107,6 +114,8 @@ export function buildMetadata(records, errors, runtimeStatuses, coverage) {
|
|
|
107
114
|
available_but_not_selected: coverageFields.available_but_not_selected,
|
|
108
115
|
total_records: records.length,
|
|
109
116
|
errors,
|
|
117
|
+
source_classes: sourceClasses,
|
|
118
|
+
source_products: sourceProducts,
|
|
110
119
|
};
|
|
111
120
|
}
|
|
112
121
|
export function buildCorpus(opts) {
|
|
@@ -123,23 +132,36 @@ export function buildCorpus(opts) {
|
|
|
123
132
|
records.push(...extractProjectConfigSignals(normalizedRoots, errors));
|
|
124
133
|
const runtimeStatuses = [];
|
|
125
134
|
const runtimes = [
|
|
126
|
-
["codex", opts.codexSessionsDir, extractCodexSessions],
|
|
127
|
-
["
|
|
128
|
-
["cursor", opts.cursorProjectsDir ?? null, (sp, err) => extractCursorSessions(sp, err, normalizedRoots)],
|
|
135
|
+
["codex", "codex", "active_runtime", true, opts.codexSessionsDir, extractCodexSessions, undefined],
|
|
136
|
+
["cursor", "cursor", "active_runtime", true, opts.cursorProjectsDir ?? null, (sp, err) => extractCursorSessions(sp, err, normalizedRoots), undefined],
|
|
129
137
|
[
|
|
138
|
+
"cursor",
|
|
130
139
|
"cursor-agent",
|
|
140
|
+
"active_runtime",
|
|
141
|
+
true,
|
|
131
142
|
opts.cursorChatsDir ?? null,
|
|
132
143
|
(sp, err) => extractCursorAgentSessions(sp, err, normalizedRoots, opts.cursorProjectsDir ?? null),
|
|
144
|
+
"store.db",
|
|
133
145
|
],
|
|
134
|
-
["opencode", opts.opencodeConversationsDir ?? null, extractOpencodeSessions],
|
|
135
|
-
["github-copilot", opts.copilotConversationsDir ?? null, extractCopilotSessions],
|
|
146
|
+
["opencode", "opencode", "active_runtime", true, opts.opencodeConversationsDir ?? null, extractOpencodeSessions, undefined],
|
|
147
|
+
["copilot", "github-copilot", "active_runtime", true, opts.copilotConversationsDir ?? null, extractCopilotSessions, undefined],
|
|
136
148
|
];
|
|
137
|
-
|
|
138
|
-
|
|
149
|
+
if (opts.claudeProjectsDir !== null) {
|
|
150
|
+
runtimes.push([
|
|
151
|
+
null,
|
|
152
|
+
"claude-code",
|
|
153
|
+
"historical_import",
|
|
154
|
+
false,
|
|
155
|
+
opts.claudeProjectsDir,
|
|
156
|
+
extractClaudeProjectSessions,
|
|
157
|
+
"*.jsonl",
|
|
158
|
+
]);
|
|
159
|
+
}
|
|
160
|
+
for (const [runtime, sourceProduct, sourceClass, activeRuntime, storePath, extractor, pattern] of runtimes) {
|
|
161
|
+
const [runtimeRecords, status] = extractRuntimeStore(runtime, storePath, errors, extractor, opts.sqliteCaps, { sourceProduct, sourceClass, activeRuntime, pattern });
|
|
139
162
|
records.push(...runtimeRecords);
|
|
140
163
|
runtimeStatuses.push(status);
|
|
141
164
|
}
|
|
142
165
|
const deduped = dedupeRecords(records);
|
|
143
166
|
return { metadata: buildMetadata(deduped, errors, runtimeStatuses, opts.coverage), records: deduped };
|
|
144
167
|
}
|
|
145
|
-
//# sourceMappingURL=corpus.js.map
|
|
@@ -14,36 +14,27 @@ export function corpusEnvelopeCoverage(audit) {
|
|
|
14
14
|
})),
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
export function resolveRuntimeStoreConfigs(args, env = process.env,
|
|
17
|
+
export function resolveRuntimeStoreConfigs(args, env = process.env, _platform = process.platform) {
|
|
18
18
|
const configs = [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
args.cursorChatsDir || resolveCursorChatsPath(env),
|
|
25
|
-
!args.noCursor,
|
|
26
|
-
args.noCursor ? "disabled_by_flag" : null,
|
|
27
|
-
],
|
|
28
|
-
[
|
|
29
|
-
"opencode",
|
|
30
|
-
args.opencodeConversationsDir || resolveOpencodeDbPath(env),
|
|
31
|
-
!args.noOpencode,
|
|
32
|
-
args.noOpencode ? "disabled_by_flag" : null,
|
|
33
|
-
],
|
|
34
|
-
[
|
|
35
|
-
"github-copilot",
|
|
36
|
-
args.copilotConversationsDir || resolveCopilotStorePath(env),
|
|
37
|
-
!args.noCopilot,
|
|
38
|
-
args.noCopilot ? "disabled_by_flag" : null,
|
|
39
|
-
],
|
|
19
|
+
{ runtime: "codex", sourceProduct: "codex", sourceClass: "active_runtime", activeRuntime: true, storePath: args.codexSessionsDir, selected: !args.noCodex, skipReason: args.noCodex ? "disabled_by_flag" : null },
|
|
20
|
+
{ runtime: "cursor", sourceProduct: "cursor", sourceClass: "active_runtime", activeRuntime: true, storePath: args.cursorProjectsDir || resolveCursorProjectsPath(env), selected: !args.noCursor, skipReason: args.noCursor ? "disabled_by_flag" : null },
|
|
21
|
+
{ runtime: "cursor", sourceProduct: "cursor-agent", sourceClass: "active_runtime", activeRuntime: true, pattern: "store.db", storePath: args.cursorChatsDir || resolveCursorChatsPath(env), selected: !args.noCursor, skipReason: args.noCursor ? "disabled_by_flag" : null },
|
|
22
|
+
{ runtime: "opencode", sourceProduct: "opencode", sourceClass: "active_runtime", activeRuntime: true, storePath: args.opencodeConversationsDir || resolveOpencodeDbPath(env), selected: !args.noOpencode, skipReason: args.noOpencode ? "disabled_by_flag" : null },
|
|
23
|
+
{ runtime: "copilot", sourceProduct: "github-copilot", sourceClass: "active_runtime", activeRuntime: true, storePath: args.copilotConversationsDir || resolveCopilotStorePath(env), selected: !args.noCopilot, skipReason: args.noCopilot ? "disabled_by_flag" : null },
|
|
40
24
|
];
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
25
|
+
if ((args.importSources ?? []).includes("claude")) {
|
|
26
|
+
configs.push({
|
|
27
|
+
runtime: null,
|
|
28
|
+
sourceProduct: "claude-code",
|
|
29
|
+
sourceClass: "historical_import",
|
|
30
|
+
activeRuntime: false,
|
|
31
|
+
pattern: "*.jsonl",
|
|
32
|
+
storePath: args.claudeProjectsDir,
|
|
33
|
+
selected: true,
|
|
34
|
+
skipReason: null,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return configs.map((config) => ({ ...config, storePath: config.storePath ?? null }));
|
|
47
38
|
}
|
|
48
39
|
function trackEarliest(current, candidate) {
|
|
49
40
|
if (!candidate)
|
|
@@ -78,10 +69,10 @@ function probeJsonlTimestamps(storePath) {
|
|
|
78
69
|
}
|
|
79
70
|
return { earliest, latest };
|
|
80
71
|
}
|
|
81
|
-
function probeSqliteTimestamps(storePath,
|
|
82
|
-
const dbPaths =
|
|
72
|
+
function probeSqliteTimestamps(storePath, sourceProduct) {
|
|
73
|
+
const dbPaths = sourceProduct === "opencode"
|
|
83
74
|
? [storePath]
|
|
84
|
-
:
|
|
75
|
+
: sourceProduct === "github-copilot"
|
|
85
76
|
? isFilePath(storePath)
|
|
86
77
|
? [storePath]
|
|
87
78
|
: rglob(storePath, "session-store.db")
|
|
@@ -102,7 +93,7 @@ function probeSqliteTimestamps(storePath, runtime) {
|
|
|
102
93
|
continue;
|
|
103
94
|
}
|
|
104
95
|
try {
|
|
105
|
-
if (
|
|
96
|
+
if (sourceProduct === "opencode") {
|
|
106
97
|
const cols = tableColumns(conn, "session");
|
|
107
98
|
const timeCol = firstColumn(cols, ["time_created", "time", "timestamp", "created_at", "createdAt"]);
|
|
108
99
|
if (timeCol) {
|
|
@@ -117,7 +108,7 @@ function probeSqliteTimestamps(storePath, runtime) {
|
|
|
117
108
|
}
|
|
118
109
|
}
|
|
119
110
|
}
|
|
120
|
-
else if (
|
|
111
|
+
else if (sourceProduct === "github-copilot") {
|
|
121
112
|
const sessionCols = tableColumns(conn, "sessions");
|
|
122
113
|
const turnCols = tableColumns(conn, "turns");
|
|
123
114
|
const sessionTime = firstColumn(sessionCols, ["time", "timestamp", "created_at", "createdAt"]);
|
|
@@ -135,7 +126,7 @@ function probeSqliteTimestamps(storePath, runtime) {
|
|
|
135
126
|
}
|
|
136
127
|
}
|
|
137
128
|
}
|
|
138
|
-
else if (
|
|
129
|
+
else if (sourceProduct === "cursor-agent") {
|
|
139
130
|
const rows = conn.prepare("SELECT data FROM blobs ORDER BY id").all();
|
|
140
131
|
for (const row of rows) {
|
|
141
132
|
const payload = row.data;
|
|
@@ -173,26 +164,31 @@ function probeSqliteTimestamps(storePath, runtime) {
|
|
|
173
164
|
}
|
|
174
165
|
return { earliest, latest };
|
|
175
166
|
}
|
|
176
|
-
function probeRuntimeTimestamps(
|
|
177
|
-
if (
|
|
178
|
-
return probeSqliteTimestamps(storePath,
|
|
167
|
+
function probeRuntimeTimestamps(sourceProduct, storePath) {
|
|
168
|
+
if (sourceProduct === "opencode" || sourceProduct === "github-copilot" || sourceProduct === "cursor-agent") {
|
|
169
|
+
return probeSqliteTimestamps(storePath, sourceProduct);
|
|
179
170
|
}
|
|
180
171
|
if (isDir(storePath))
|
|
181
172
|
return probeJsonlTimestamps(storePath);
|
|
182
173
|
if (isFilePath(storePath))
|
|
183
|
-
return probeSqliteTimestamps(storePath,
|
|
174
|
+
return probeSqliteTimestamps(storePath, sourceProduct);
|
|
184
175
|
return { earliest: null, latest: null };
|
|
185
176
|
}
|
|
186
177
|
export function runCoverageAudit(args, env = process.env, platform = process.platform, acceptCoverageGap = false) {
|
|
187
178
|
const runtimes = [];
|
|
188
179
|
const skippedAvailable = [];
|
|
189
180
|
for (const config of resolveRuntimeStoreConfigs(args, env, platform)) {
|
|
190
|
-
const discovery = discoverRuntimeStore(config.runtime, config.storePath
|
|
181
|
+
const discovery = discoverRuntimeStore(config.runtime, config.storePath, {
|
|
182
|
+
sourceProduct: config.sourceProduct,
|
|
183
|
+
sourceClass: config.sourceClass,
|
|
184
|
+
activeRuntime: config.activeRuntime,
|
|
185
|
+
pattern: config.pattern,
|
|
186
|
+
});
|
|
191
187
|
const available = discovery.status === "available";
|
|
192
188
|
let earliest = null;
|
|
193
189
|
let latest = null;
|
|
194
190
|
if (available && config.storePath) {
|
|
195
|
-
const bounds = probeRuntimeTimestamps(config.
|
|
191
|
+
const bounds = probeRuntimeTimestamps(config.sourceProduct, config.storePath);
|
|
196
192
|
earliest = bounds.earliest;
|
|
197
193
|
latest = bounds.latest;
|
|
198
194
|
}
|
|
@@ -202,6 +198,9 @@ export function runCoverageAudit(args, env = process.env, platform = process.pla
|
|
|
202
198
|
}
|
|
203
199
|
runtimes.push({
|
|
204
200
|
runtime: config.runtime,
|
|
201
|
+
source_product: config.sourceProduct,
|
|
202
|
+
source_class: config.sourceClass,
|
|
203
|
+
active_runtime: config.activeRuntime,
|
|
205
204
|
store_path: config.storePath,
|
|
206
205
|
selected: config.selected,
|
|
207
206
|
discovery_status: String(discovery.status),
|
|
@@ -212,8 +211,8 @@ export function runCoverageAudit(args, env = process.env, platform = process.pla
|
|
|
212
211
|
skip_reason: skipReason,
|
|
213
212
|
});
|
|
214
213
|
}
|
|
215
|
-
const availableRuntimes = runtimes.filter((r) => r.available).map((r) => r.runtime);
|
|
216
|
-
const selectedRuntimes = runtimes.filter((r) => r.selected).map((r) => r.runtime);
|
|
214
|
+
const availableRuntimes = [...new Set(runtimes.filter((r) => r.active_runtime && r.available).map((r) => r.runtime))];
|
|
215
|
+
const selectedRuntimes = [...new Set(runtimes.filter((r) => r.active_runtime && r.selected).map((r) => r.runtime))];
|
|
217
216
|
const coverageGapFlagged = skippedAvailable.length > 0 && !acceptCoverageGap;
|
|
218
217
|
return {
|
|
219
218
|
runtimes,
|
|
@@ -232,10 +231,11 @@ export function formatCoverageSummaryText(audit) {
|
|
|
232
231
|
const span = entry.earliest_session && entry.latest_session
|
|
233
232
|
? `${entry.earliest_session} .. ${entry.latest_session}`
|
|
234
233
|
: "timestamps unavailable";
|
|
235
|
-
|
|
234
|
+
const label = entry.active_runtime ? entry.runtime : `${entry.source_product} [historical import]`;
|
|
235
|
+
lines.push(` ${label}: available store=${store} sessions=${span} selected=${entry.selected ? "yes" : "no"}`);
|
|
236
236
|
}
|
|
237
237
|
else {
|
|
238
|
-
lines.push(` ${entry.runtime}: ${entry.discovery_status} (${entry.discovery_reason}) store=${store} selected=${entry.selected ? "yes" : "no"}`);
|
|
238
|
+
lines.push(` ${entry.active_runtime ? entry.runtime : `${entry.source_product} [historical import]`}: ${entry.discovery_status} (${entry.discovery_reason}) store=${store} selected=${entry.selected ? "yes" : "no"}`);
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
if (audit.skipped_available.length > 0) {
|
|
@@ -258,4 +258,3 @@ export function formatCoverageSummaryText(audit) {
|
|
|
258
258
|
}
|
|
259
259
|
return lines.join("\n");
|
|
260
260
|
}
|
|
261
|
-
//# sourceMappingURL=coverageAudit.js.map
|
|
@@ -364,7 +364,8 @@ export function extractCursorAgentSessions(chatsDir, errors, projectRoots = null
|
|
|
364
364
|
event: message,
|
|
365
365
|
fallbackTimestamp,
|
|
366
366
|
projectPath,
|
|
367
|
-
runtime: "cursor
|
|
367
|
+
runtime: "cursor",
|
|
368
|
+
sourceProduct: "cursor-agent",
|
|
368
369
|
sourcePath: storeDb,
|
|
369
370
|
index: index * 1000 + toolIndex,
|
|
370
371
|
sessionId,
|
|
@@ -397,7 +398,8 @@ export function extractCursorAgentSessions(chatsDir, errors, projectRoots = null
|
|
|
397
398
|
sourceKind: "conversation_turn",
|
|
398
399
|
timestamp,
|
|
399
400
|
projectPath,
|
|
400
|
-
runtime: "cursor
|
|
401
|
+
runtime: "cursor",
|
|
402
|
+
sourceProduct: "cursor-agent",
|
|
401
403
|
sourceParts: [resolvePath(storeDb), blobId, role, content.slice(0, 80)],
|
|
402
404
|
sessionId,
|
|
403
405
|
data,
|
|
@@ -409,7 +411,8 @@ export function extractCursorAgentSessions(chatsDir, errors, projectRoots = null
|
|
|
409
411
|
sourceKind: "history_prompt",
|
|
410
412
|
timestamp,
|
|
411
413
|
projectPath,
|
|
412
|
-
runtime: "cursor
|
|
414
|
+
runtime: "cursor",
|
|
415
|
+
sourceProduct: "cursor-agent",
|
|
413
416
|
sourceParts: [resolvePath(storeDb), blobId, "history", content.slice(0, 120)],
|
|
414
417
|
sessionId,
|
|
415
418
|
data: { prompt: content, signal_type: sig },
|
|
@@ -420,4 +423,3 @@ export function extractCursorAgentSessions(chatsDir, errors, projectRoots = null
|
|
|
420
423
|
}
|
|
421
424
|
return records;
|
|
422
425
|
}
|
|
423
|
-
//# sourceMappingURL=cursorSessions.js.map
|