agentera 3.0.0-dev.21 → 3.0.0-dev.23

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.
Files changed (129) hide show
  1. package/README.md +7 -3
  2. package/bundle/.cursor/agents/agentera.md +1 -1
  3. package/bundle/.opencode/agents/agentera.md +1 -1
  4. package/bundle/CHANGELOG.md +11 -0
  5. package/bundle/references/analysis/evidence-tier-authority.yaml +516 -0
  6. package/bundle/references/artifacts/state-storage-authority.yaml +109 -3
  7. package/bundle/references/artifacts/verbosity-budget-authority.yaml +42 -0
  8. package/bundle/references/cli/agent-ready-state-contract.yaml +22 -14
  9. package/bundle/references/cli/prime-consumer-compatibility.yaml +676 -0
  10. package/bundle/references/cli/vocabulary-index.yaml +3 -3
  11. package/bundle/references/cli/vocabulary.md +10 -3
  12. package/bundle/skills/agentera/SKILL.md +7 -6
  13. package/bundle/skills/agentera/agents/audit.toml +1 -1
  14. package/bundle/skills/agentera/agents/build.toml +1 -1
  15. package/bundle/skills/agentera/agents/design.toml +1 -1
  16. package/bundle/skills/agentera/agents/discuss.toml +1 -1
  17. package/bundle/skills/agentera/agents/document.toml +1 -1
  18. package/bundle/skills/agentera/agents/optimize.toml +1 -1
  19. package/bundle/skills/agentera/agents/orchestrate.toml +1 -1
  20. package/bundle/skills/agentera/agents/plan.toml +1 -1
  21. package/bundle/skills/agentera/agents/profile.toml +1 -1
  22. package/bundle/skills/agentera/agents/research.toml +1 -1
  23. package/bundle/skills/agentera/agents/status.toml +1 -1
  24. package/bundle/skills/agentera/agents/vision.toml +1 -1
  25. package/bundle/skills/agentera/capabilities/profile/schemas/validation.yaml +31 -3
  26. package/bundle/skills/agentera/schemas/artifacts/changelog.yaml +1 -0
  27. package/bundle/skills/agentera/schemas/artifacts/design.yaml +1 -0
  28. package/bundle/skills/agentera/schemas/artifacts/todo.yaml +1 -0
  29. package/dist/analytics/extractCorpus/cli.js +33 -5
  30. package/dist/analytics/extractCorpus/cli.js.map +1 -1
  31. package/dist/analytics/extractCorpus/evidenceTiers.js +561 -0
  32. package/dist/analytics/extractCorpus/evidenceTiers.js.map +1 -0
  33. package/dist/analytics/extractCorpus/extractCorpusParity.js +1 -0
  34. package/dist/analytics/extractCorpus/extractCorpusParity.js.map +1 -1
  35. package/dist/analytics/extractCorpus/index.js +3 -0
  36. package/dist/analytics/extractCorpus/index.js.map +1 -1
  37. package/dist/analytics/extractCorpus/tierReader.js +109 -0
  38. package/dist/analytics/extractCorpus/tierReader.js.map +1 -0
  39. package/dist/analytics/profileSignals.js +212 -0
  40. package/dist/analytics/profileSignals.js.map +1 -0
  41. package/dist/analytics/usageStats.js +104 -20
  42. package/dist/analytics/usageStats.js.map +1 -1
  43. package/dist/capabilities/index.js +2 -1
  44. package/dist/capabilities/index.js.map +1 -1
  45. package/dist/capabilities/profile/instructions.js +1 -1
  46. package/dist/capabilities/profile/instructions.js.map +1 -1
  47. package/dist/capabilities/status/startupInstructions.js +35 -0
  48. package/dist/capabilities/status/startupInstructions.js.map +1 -0
  49. package/dist/cli/capabilityContext/build.js +3 -3
  50. package/dist/cli/capabilityContext/build.js.map +1 -1
  51. package/dist/cli/capabilityContext/closeout.js +5 -5
  52. package/dist/cli/capabilityContext/closeout.js.map +1 -1
  53. package/dist/cli/capabilityContext/contract.js +4 -4
  54. package/dist/cli/capabilityContext/contract.js.map +1 -1
  55. package/dist/cli/capabilityContext/evidence.js +4 -4
  56. package/dist/cli/capabilityContext/evidence.js.map +1 -1
  57. package/dist/cli/capabilityContext/planState.js +7 -6
  58. package/dist/cli/capabilityContext/planState.js.map +1 -1
  59. package/dist/cli/capabilityContext/shared.js +1 -1
  60. package/dist/cli/capabilityContext/shared.js.map +1 -1
  61. package/dist/cli/capabilityContext/startup.js +4 -4
  62. package/dist/cli/capabilityContext/startup.js.map +1 -1
  63. package/dist/cli/commands/lint.js +10 -2
  64. package/dist/cli/commands/lint.js.map +1 -1
  65. package/dist/cli/commands/prime/briefOrientation.js +582 -0
  66. package/dist/cli/commands/prime/briefOrientation.js.map +1 -0
  67. package/dist/cli/commands/prime/collectOrientationState.js +3 -0
  68. package/dist/cli/commands/prime/collectOrientationState.js.map +1 -1
  69. package/dist/cli/commands/prime/orientationOutput.js +117 -23
  70. package/dist/cli/commands/prime/orientationOutput.js.map +1 -1
  71. package/dist/cli/commands/prime.js +30 -3
  72. package/dist/cli/commands/prime.js.map +1 -1
  73. package/dist/cli/commands/report.js +55 -15
  74. package/dist/cli/commands/report.js.map +1 -1
  75. package/dist/cli/commands/schema.js +3 -29
  76. package/dist/cli/commands/schema.js.map +1 -1
  77. package/dist/cli/commands/state/plan.js +3 -2
  78. package/dist/cli/commands/state/plan.js.map +1 -1
  79. package/dist/cli/help.js +1 -1
  80. package/dist/cli/help.js.map +1 -1
  81. package/dist/cli/orientation/corpusCoverage.js +32 -0
  82. package/dist/cli/orientation/corpusCoverage.js.map +1 -1
  83. package/dist/cli/orientation.js +3 -3
  84. package/dist/cli/orientation.js.map +1 -1
  85. package/dist/cli/startupCompletenessContract.js +3 -3
  86. package/dist/cli/startupCompletenessContract.js.map +1 -1
  87. package/dist/cli/stateQuery.js +37 -0
  88. package/dist/cli/stateQuery.js.map +1 -1
  89. package/dist/registries/evidenceTierContract.js +362 -0
  90. package/dist/registries/evidenceTierContract.js.map +1 -0
  91. package/dist/registries/verbosityBudgetContract.js +206 -0
  92. package/dist/registries/verbosityBudgetContract.js.map +1 -0
  93. package/dist/state/decisionLegacyValidation.js +185 -0
  94. package/dist/state/decisionLegacyValidation.js.map +1 -0
  95. package/dist/state/decisionOverlay.js +24 -1
  96. package/dist/state/decisionOverlay.js.map +1 -1
  97. package/dist/state/decisionRevision.js +622 -0
  98. package/dist/state/decisionRevision.js.map +1 -0
  99. package/dist/state/decisionRevisionPublication.js +532 -0
  100. package/dist/state/decisionRevisionPublication.js.map +1 -0
  101. package/dist/state/directRetrieval.js +55 -4
  102. package/dist/state/directRetrieval.js.map +1 -1
  103. package/dist/state/listRetrieval.js +42 -11
  104. package/dist/state/listRetrieval.js.map +1 -1
  105. package/dist/state/startupAnalysis/benchmark.js +70 -8
  106. package/dist/state/startupAnalysis/benchmark.js.map +1 -1
  107. package/dist/state/startupAnalysis/threshold.js +13 -0
  108. package/dist/state/startupAnalysis/threshold.js.map +1 -1
  109. package/dist/state/startupProjection.js +68 -1
  110. package/dist/state/startupProjection.js.map +1 -1
  111. package/dist/state/write/candidateMutation.js +331 -0
  112. package/dist/state/write/candidateMutation.js.map +1 -0
  113. package/dist/state/write/explain.js +36 -12
  114. package/dist/state/write/explain.js.map +1 -1
  115. package/dist/state/write/helpers.js +22 -0
  116. package/dist/state/write/helpers.js.map +1 -1
  117. package/dist/state/write/mutation.js +42 -0
  118. package/dist/state/write/mutation.js.map +1 -1
  119. package/dist/state/write/operations.js +49 -1
  120. package/dist/state/write/operations.js.map +1 -1
  121. package/dist/state/write/transaction.js +23 -357
  122. package/dist/state/write/transaction.js.map +1 -1
  123. package/dist/validate/lifecycleAdapters/lifecycleMain.js +154 -0
  124. package/dist/validate/lifecycleAdapters/lifecycleMain.js.map +1 -0
  125. package/dist/validate/lifecycleAdapters.js +5 -156
  126. package/dist/validate/lifecycleAdapters.js.map +1 -1
  127. package/dist/validate/selfAudit.js +38 -43
  128. package/dist/validate/selfAudit.js.map +1 -1
  129. package/package.json +2 -2
package/README.md CHANGED
@@ -12,9 +12,13 @@ npx -y agentera@next prime --format json
12
12
  npx -y agentera@next doctor --format json
13
13
  ```
14
14
 
15
- `prime` returns a bounded project and four-runtime lifecycle summary. `doctor`
16
- returns detailed read-only evidence and exact user actions. The status and
17
- project-integration projections consume the same lifecycle snapshot.
15
+ `prime --format json` returns a bounded decision brief (at most 12000 UTF-8
16
+ bytes); use `prime --dashboard --format json` for the full orientation payload.
17
+ Status startup is one call: `prime --context status --format json` returns
18
+ `capability_context.instructions` and bounded
19
+ `capability_context.context.status_context` together (at most 25000 UTF-8
20
+ bytes). Omitted detail names its authoritative recovery command. `doctor`
21
+ returns detailed read-only evidence and exact user actions.
18
22
 
19
23
  ## Runtime lifecycle
20
24
 
@@ -4,4 +4,4 @@ description: Turn your coding agent into an engineering team.
4
4
 
5
5
  <!-- agentera: managed -->
6
6
 
7
- Load the Agentera skill for request routing and project orientation. When a capability is invoked, run `agentera prime --context build --format json` (or the relevant capability name) to fetch the authoritative instructions as a JSON capsule, then dispatch to a general-purpose subagent with the `prose` field as the task prompt. Do not invent unsupported capability-name CLI commands. Do not invoke per-capability subagents; the single Agentera agent handles all capability dispatch.
7
+ Load the Agentera skill for request routing and project orientation. When a capability is invoked, run `agentera prime --context build --format json` (or the relevant capability name) to fetch the authoritative instructions as a JSON capsule, then dispatch to a general-purpose subagent with the `capability_context.instructions` field as the task prompt. Do not invent unsupported capability-name CLI commands. Do not invoke per-capability subagents; the single Agentera agent handles all capability dispatch.
@@ -9,4 +9,4 @@ permission:
9
9
 
10
10
  <!-- agentera: managed -->
11
11
 
12
- Load the Agentera skill for request routing and project orientation. When a capability is invoked, run `agentera prime --context build --format json` (or the relevant capability name) to fetch the authoritative instructions as a JSON capsule, then dispatch to a general-purpose subagent with the `prose` field as the task prompt. Do not invent unsupported capability-name CLI commands. Do not invoke per-capability subagents; the single Agentera agent handles all capability dispatch.
12
+ Load the Agentera skill for request routing and project orientation. When a capability is invoked, run `agentera prime --context build --format json` (or the relevant capability name) to fetch the authoritative instructions as a JSON capsule, then dispatch to a general-purpose subagent with the `capability_context.instructions` field as the task prompt. Do not invent unsupported capability-name CLI commands. Do not invoke per-capability subagents; the single Agentera agent handles all capability dispatch.
@@ -4,11 +4,19 @@
4
4
 
5
5
  ### Changed
6
6
 
7
+ - Split lifecycle validation orchestration from the public validation facade while preserving its import surface and validation behavior.
8
+ - Eliminated the monolithic `corpus.json` publication output from the extract CLI; report dry-run diagnostics now reference tier files and the `privacy.corpus_write` field is renamed to `privacy.tier_write`.
9
+ - Changed `agentera check lint` verbosity checks to consume schema-owned full-file and per-entry word limits, skip no-limit and token-only dimensions, and report authority failures without fallback budgets.
7
10
  - Corrected packaged experiment-publication authority to declare validated objective-scoped archive-before-projection ownership and reject contradictory structured scope metadata.
8
11
  - Synchronized bounded plan, plan-task, and experiment retrieval across help, schema introspection, capability guidance, operator docs, packaged contracts, output bounds, archive ownership, and structured recovery errors.
9
12
 
10
13
  ### Added
11
14
 
15
+ - Added an authoritative evidence-tier contract (`references/analysis/evidence-tier-authority.yaml`) and contract-model loader (`packages/cli/src/registries/evidenceTierContract.ts`) fixing the bounded full-evidence and signal tiers, supported Codex, Cursor, OpenCode, Copilot, and historical Claude source coverage, the consumer field-supply map including the latent startup-analysis reader, reserved signal semantics for the deferred glossary, and deterministic recovery outcomes for oversized, legacy, missing, corrupt, and incomplete state.
16
+ - Added bounded tier publication and direct retrieval (`packages/cli/src/analytics/extractCorpus/evidenceTiers.ts`): complete local evidence is retained as independently bounded, source-family shards that split when exceeding the reader cap; a derived, content-addressable bounded signal tier carries only contract-required fields plus a resolvable `evidence_anchor`; generations are staged and revealed by an atomic current-pointer swap so no consumer observes a partial publication; and direct retrieval resolves a signal identity to its full record. The monolithic `corpus.json` write is eliminated; tiers are the only canonical publication output.
17
+ - Added bounded tier-aware reads for usage analytics, report status, prime corpus coverage, startup analysis, and profile synthesis so every analytics consumer reads from bounded evidence shards one at a time instead of loading the monolithic `corpus.json`. A new `tierReader.ts` module projects contract compatibility states and recovery guidance, streams full-evidence records, and reads signal-tier metadata. A new `profileSignals.ts` module reads the bounded signal tier, assesses per-family retention sufficiency against the contract threshold, and resolves synthesized claims' evidence anchors to retained full-evidence shards. Legacy `corpus.json` remains a fallback when no tiers are published; oversized legacy state is never loaded whole.
18
+ - Added a schema-owned verbosity-budget authority that classifies numeric word limits, explicit no-limit declarations, and token-only budgets while rejecting malformed, ambiguous, unreadable, and unsupported ownership without fallback limits.
19
+ - Added a `profile_sufficiency` section to the evidence-tier authority defining `minimum_family_retention=0.5`, profile signal types (decision, question, correction, instruction, configuration), and insufficiency rules so bounded profile synthesis surfaces underrepresented families without fabricating confidence.
12
20
  - Added `agentera state experiments list|get --objective OBJECTIVE_ID` with newest-first bounded pages, snapshot-bound opaque cursors, merged projection/archive identity, verified archive-first detail, explicit provenance and detail availability, and structured compatibility failures.
13
21
  - Added objective-scoped immutable full-detail archives under `.agentera/optimize/<objective>/archive/experiments/<number>.yaml` before 10/40/50 projection replacement, with explicit provenance, conflict rejection, and crash-consistent idempotent retries.
14
22
  - Added `agentera state experiments publish --objective OBJECTIVE_ID --number N --input EXPERIMENT.yaml` with schema and identity preflight, atomic projection replacement, idempotent interruption retry, collision safety, and existing 10/40/50 projection behavior.
@@ -16,6 +24,7 @@
16
24
  - Added `agentera state plan list` and `agentera state plan get --plan PLAN_ID` for deterministic, cursor-paginated active and archived plan retrieval, full-plan exact reads, lifecycle provenance, and explicit legacy, invalid, missing, and ambiguous archive outcomes.
17
25
  - Added persisted plan identity across active-to-archive transitions, deterministic read-only identity for legacy plans, explicit lifecycle provenance, mirrored-path reporting, and structured ambiguity failures for identity collisions.
18
26
  - Added `agentera state plan tasks list` and `agentera state plan tasks get --task N` for bounded active-plan task retrieval with declared task-number order, opaque snapshot cursors, structured not-found and compatibility errors, and exact omission recovery in text and JSON plan output.
27
+ - Added `agentera state decisions amend --number N [--question ... --context ... --alternative-chosen ... --alternative-rejected ... --choice ... --reasoning ... --confidence firm|provisional|exploratory --feeds-into ...] [--dry-run] --format json`: validates and publishes a record-local revision under `.agentera/revisions/decisions.yaml` that composes over the immutable numbered archive at read time. Apply never rewrites the decisions projection, preserves unrelated decisions' bytes (including comments, block scalars, quoting, and inherited legacy confidence labels), refuses a broken revision document or unsafe record-local boundary without side effects, retries converge on a stable revision identity, and an identical re-submission is an idempotent replay. Append, satisfaction update, and amend tolerate untouched inherited confidence labels as explicit legacy caveats while requiring current vocabulary for new or amended content.
19
28
 
20
29
  - Added an executable bounded-retrieval authority and reserved CLI grammar for plan tasks, plans, and objective-scoped experiments, including stable and legacy identity rules, experiment `0`, opaque cursors, explicit omissions, and structured compatibility errors; retrieval execution remains staged for subsequent tasks.
21
30
  - Added a canonical runtime lifecycle projection with deterministic snapshot identity, applicability, ownership, action classes, counts, and command eligibility for OpenCode, Codex, Cursor, and Copilot.
@@ -73,6 +82,8 @@
73
82
 
74
83
  ### Fixed
75
84
 
85
+ - Fixed the npm shim to diagnose a configured `AGENTERA_HOME` whose managed script is missing or not runnable before continuing through repository and `uvx` fallback resolution.
86
+ - Fixed `agentera check lint` to report findings without failing by default, fail the same findings with `--strict`, and keep invalid input, authority failures, and validated plan publication nonzero.
76
87
  - Fixed schema/runtime alias parity: introspection now advertises exactly the six Phase 3 transitional aliases, Build startup and compaction guidance use canonical `agentera check compact`, check/fix output reports `command: "check compact"`, top-level `compact` remains behavior-compatible, and removed names such as `gate` return structured runnable corrections.
77
88
  - Fixed archive-only plan catalogs to expose executable list/get recovery, plan-task cursors to validate explicit plan selectors before lookup, and legacy plan text to omit oversized whole rows instead of truncating Unicode scalars.
78
89
  - Fixed bounded plan and experiment retrieval to declare legacy projection omissions with public recovery, enforce plan-task YAML byte limits, reject wrong-family and wrong-objective cursors, and fail closed when plan snapshot diagnostics change.
@@ -0,0 +1,516 @@
1
+ schema_version: agentera.evidenceTierAuthority.v1
2
+ status: active_authority
3
+ purpose: >-
4
+ Define the authoritative tier model for local agent-history evidence so that
5
+ bounded consumers receive useful analysis at realistic corpus scale instead
6
+ of degrading solely because complete local evidence exceeds a single-reader
7
+ limit. The contract fixes the tiers, supported source families, the consumer
8
+ map, the required signal semantics, and the deterministic compatibility
9
+ outcomes for oversized, legacy, missing, corrupt, and incomplete state. It is
10
+ the single source of truth for what every bounded input contract must supply.
11
+
12
+ authority:
13
+ source: references/analysis/evidence-tier-authority.yaml
14
+ single_source_rule: >-
15
+ Extraction, readers, validators, tests, help, and capability source
16
+ contracts may project this authority but must not create a second map of
17
+ tiers, source families, consumer required fields, signal semantics,
18
+ compatibility outcomes, or evidence bounds. A consumer that needs a field
19
+ declares it here; a field declared here is the only name a consumer may
20
+ require from a bounded tier.
21
+ implementation_boundary: >-
22
+ This contract defines and verifies the tier model, source coverage, signal
23
+ semantics, consumer field supply, and compatibility outcomes. It does not
24
+ implement the complete extraction writer, migrate consumers to bounded
25
+ tiers, change profile levels, generate a glossary, or alter suite version
26
+ metadata. Tasks 2 through 4 of the approved plan implement publication,
27
+ consumer migration, and bounded profile synthesis against this contract.
28
+
29
+ decision_55_reconciliation:
30
+ decision_number: 55
31
+ date: 2026-05-17
32
+ preserved_intent: >-
33
+ Decision 55 established `agentera stats` as the user-facing analytics
34
+ workflow, forbade a top-level `agentera corpus` command, bound local
35
+ history to explicit consent, and wrote the internal corpus to a single
36
+ `$AGENTERA_PROFILE_DIR/intermediate/corpus.json` envelope. The intent
37
+ survives: analytics remain behind `agentera stats`/`agentera usage`, no
38
+ `agentera corpus` namespace is introduced, and local-history extraction
39
+ remains consent-bound and read-only.
40
+ superseded_surface: >-
41
+ The single monolithic `corpus.json` envelope is superseded by the tier
42
+ model below. Complete local evidence is retained as independently bounded
43
+ shards; a derived bounded signal view replaces the monolithic record array
44
+ as the analytic input. Decision history itself is not rewritten: the
45
+ decision record stands as adopted, and this reconciliation is recorded in
46
+ the tier authority rather than by editing the decision.
47
+ non_goal: >-
48
+ Do not rewrite, renumber, or restate Decision 55's adopted text. Do not
49
+ introduce `agentera corpus` or any new top-level analytics command.
50
+
51
+ tiers:
52
+ full_evidence:
53
+ tier_id: full_evidence
54
+ rank: 1
55
+ definition: >-
56
+ Complete local evidence retained as independently bounded shards. Every
57
+ record ever extracted from a supported source is addressable here; nothing
58
+ is dropped to fit a reader limit. Each shard is independently bounded so a
59
+ single oversized shard cannot poison the whole tier.
60
+ stored_fields:
61
+ required:
62
+ - source_id
63
+ - source_kind
64
+ - timestamp
65
+ - project_id
66
+ - runtime
67
+ - source_class
68
+ - source_product
69
+ - active_runtime
70
+ - adapter_version
71
+ - data
72
+ optional:
73
+ - project_path
74
+ - session_id
75
+ - conversation_key
76
+ source_identity_rule: >-
77
+ `source_id` is the stable, content-addressable identity of one full
78
+ record. It is derived deterministically from source kind and source parts
79
+ and must resolve to exactly one retained full-evidence shard. No other
80
+ tier may invent identities that do not resolve here.
81
+ completeness_rule: >-
82
+ The union of full-evidence shards is the lossless local history for the
83
+ selected source scope. Consumers that need an entire record read it here;
84
+ consumers that need only a derived view read the signal tier instead.
85
+ signal:
86
+ tier_id: signal
87
+ rank: 2
88
+ definition: >-
89
+ A reproducible, bounded, derived view of the full-evidence tier. It
90
+ carries only the fields each declared consumer needs plus a resolvable
91
+ evidence anchor back to full evidence. It is small enough to load under
92
+ the reader bound even when the full-evidence tier is hundreds of
93
+ megabytes.
94
+ stored_fields:
95
+ required:
96
+ - source_id
97
+ - source_kind
98
+ - signal_type
99
+ - timestamp
100
+ - project_id
101
+ - runtime
102
+ - source_product
103
+ - evidence_anchor
104
+ optional:
105
+ - conversation_key
106
+ - session_id
107
+ derivation_rule: >-
108
+ The signal tier is a pure function of the full-evidence tier: identical
109
+ inputs produce identical signal membership and ordering. It never stores
110
+ transcript text, raw tool arguments, raw store paths, or raw session ids
111
+ beyond what a declared consumer requires with provenance visible.
112
+ evidence_anchor_rule: >-
113
+ Every signal record carries `evidence_anchor` resolving to the
114
+ `source_id` of exactly one retained full-evidence shard. A bounded
115
+ consumer that needs the full record follows the anchor; it must not
116
+ re-scan unbounded history.
117
+
118
+ source_families:
119
+ coverage_rule: >-
120
+ The supported source families are fixed. A source family is either supplied
121
+ by an active runtime or imported as historical Claude history. No supported
122
+ family may be silently omitted from the contract, the coverage audit, or
123
+ the compatibility evaluation. An unavailable family reports a deterministic
124
+ discovery status; it is never absent from the map.
125
+ families:
126
+ codex:
127
+ source_class: active_runtime
128
+ source_product: codex
129
+ active_runtime: true
130
+ accepted_input: JSONL session/turn/response_item and tool_call records
131
+ store_glob: "*.jsonl"
132
+ cursor:
133
+ source_class: active_runtime
134
+ source_products:
135
+ - cursor
136
+ - cursor-agent
137
+ active_runtime: true
138
+ accepted_input: >-
139
+ Cursor project JSONL sessions and Cursor Agent CLI store.db SQLite
140
+ conversations. cursor-agent is a Cursor source product, never a
141
+ separate runtime identity.
142
+ store_glob: "*.jsonl"
143
+ opencode:
144
+ source_class: active_runtime
145
+ source_product: opencode
146
+ active_runtime: true
147
+ accepted_input: SQLite opencode.db with session, message, and part tables
148
+ store_glob: opencode.db
149
+ copilot:
150
+ source_class: active_runtime
151
+ source_product: github-copilot
152
+ active_runtime: true
153
+ accepted_input: SQLite session-store.db with conversation message rows
154
+ store_glob: session-store.db
155
+ claude-code:
156
+ source_class: historical_import
157
+ source_product: claude-code
158
+ active_runtime: false
159
+ inclusion_rule: >-
160
+ Explicit `--import-source claude` only. Excluded from default
161
+ active-runtime metrics and never described as runtime health, Claude
162
+ support, or active-runtime coverage.
163
+ accepted_input: JSONL project session files with user/assistant and tool_use events
164
+ store_glob: "*.jsonl"
165
+ filesystem_substrate:
166
+ note: >-
167
+ instruction_document and project_config_signal records are extracted
168
+ from the project filesystem (AGENTS.md, package manifests, config files).
169
+ They are source kinds, not runtime families, and follow source identity
170
+ and bounds rules like any other record.
171
+
172
+ signal_semantics:
173
+ fixed_taxonomy_rule: >-
174
+ The signal semantics below are fixed. Current consumers and the deferred
175
+ glossary consumer depend on their meaning; the contract must preserve that
176
+ meaning even though glossary implementation and profile levels remain out
177
+ of scope. A semantic kind present here must remain derivable from a bounded
178
+ signal record without restoring unbounded transcript content.
179
+ kinds:
180
+ correction:
181
+ meaning: >-
182
+ A user signal that revises a prior position ("no", "not quite",
183
+ "actually", "instead"). Used to detect decision drift and overrides.
184
+ derivable_from: history_prompt and conversation_turn records
185
+ deferred_consumer: glossary
186
+ decision:
187
+ meaning: >-
188
+ A decision-bearing signal (decide, prefer, trade-off, scope, approve,
189
+ reject). The primary profile-synthesis input.
190
+ derivable_from: history_prompt and conversation_turn records
191
+ deferred_consumer: glossary
192
+ current_consumer: profile_synthesis
193
+ question:
194
+ meaning: >-
195
+ An interrogative signal ("why", "how", "should", or a "?"). Surfaces
196
+ uncertainty and information-gathering intent.
197
+ derivable_from: history_prompt and conversation_turn records
198
+ deferred_consumer: glossary
199
+ instruction:
200
+ meaning: >-
201
+ Explicit user-authored instructions (AGENTS.md and project memory
202
+ documents). The highest-signal, most durable evidence.
203
+ derivable_from: instruction_document records
204
+ deferred_consumer: glossary
205
+ current_consumer: profile_synthesis
206
+ configuration:
207
+ meaning: >-
208
+ Recurring config patterns across projects (manifest names, scripts,
209
+ dependencies, build/tool config). Objective evidence of what shipped.
210
+ derivable_from: project_config_signal records
211
+ deferred_consumer: glossary
212
+ current_consumer: profile_synthesis
213
+ record_identity:
214
+ meaning: >-
215
+ The stable, addressable identity (`source_id`) of one full record. Lets
216
+ any consumer cite evidence without retaining its content.
217
+ derivable_from: every record's source_id
218
+ deferred_consumer: glossary
219
+ date:
220
+ meaning: >-
221
+ The record timestamp anchoring evidence in time. Drives decay,
222
+ recency, and watermark windows.
223
+ derivable_from: every record's timestamp field
224
+ deferred_consumer: glossary
225
+ evidence_anchor:
226
+ meaning: >-
227
+ The resolvable link from a bounded signal record back to exactly one
228
+ retained full-evidence shard. Guarantees that bounded analysis never
229
+ severs the citation chain.
230
+ derivable_from: signal record evidence_anchor -> full_evidence source_id
231
+ deferred_consumer: glossary
232
+ preservation_rule: >-
233
+ Fixing the contract must not remove the required meaning of any kind above
234
+ from current or declared deferred consumers. A deferred consumer (glossary)
235
+ is named here so the contract reserves the fields and semantics it will
236
+ need, even though its implementation is out of scope.
237
+
238
+ consumer_map:
239
+ supply_rule: >-
240
+ Each supported consumer maps to exactly one bounded input contract that
241
+ supplies every required field with source identity. The input tier is the
242
+ smallest sufficient tier; consumers that need full records read
243
+ full_evidence, others read signal. No consumer may require a field not
244
+ declared in its input contract.
245
+ consumers:
246
+ usage_stats:
247
+ tier: signal
248
+ purpose: Skill-invocation analytics and USAGE.md reporting
249
+ required_fields:
250
+ - source_kind
251
+ - timestamp
252
+ - project_id
253
+ - runtime
254
+ - source_product
255
+ source_identity: source_id with source_product provenance
256
+ input_contract: signal tier conversation_turn projection
257
+ report_status:
258
+ tier: signal
259
+ purpose: Truthful corpus/coverage status (missing, stale, available)
260
+ required_fields:
261
+ - source_kind
262
+ - source_product
263
+ source_identity: tier presence and discovery status per source family
264
+ input_contract: signal tier metadata projection
265
+ prime_coverage:
266
+ tier: signal
267
+ purpose: Prime startup coverage of supported sources and selected scope
268
+ required_fields:
269
+ - runtime
270
+ - source_product
271
+ - source_class
272
+ - active_runtime
273
+ source_identity: available/selected/skipped per source family
274
+ input_contract: signal tier coverage projection
275
+ startup_analysis:
276
+ tier: signal
277
+ purpose: >-
278
+ Latent startup-analysis reader measuring state-gathering overhead. Reads
279
+ conversation_turn and tool_call signals; full tool arguments stay in
280
+ full_evidence.
281
+ required_fields:
282
+ - source_kind
283
+ - timestamp
284
+ - runtime
285
+ - source_class
286
+ - source_product
287
+ - evidence_anchor
288
+ source_identity: source_id and evidence_anchor to full evidence
289
+ input_contract: signal tier conversation_turn + tool_call projection
290
+ profile_synthesis:
291
+ tier: signal
292
+ purpose: Current profile synthesis (PROFILE.md) from bounded signals
293
+ required_fields:
294
+ - source_kind
295
+ - signal_type
296
+ - timestamp
297
+ - project_id
298
+ - runtime
299
+ - source_product
300
+ - evidence_anchor
301
+ source_identity: source_id and evidence_anchor for every synthesized claim
302
+ input_contract: signal tier instruction/decision/question/config projection
303
+ deferred_consumers:
304
+ glossary:
305
+ tier: signal
306
+ status: declared_deferred
307
+ required_semantics:
308
+ - correction
309
+ - decision
310
+ - question
311
+ - instruction
312
+ - configuration
313
+ - record_identity
314
+ - date
315
+ - evidence_anchor
316
+ rule: >-
317
+ The glossary is out of scope to implement, but its required semantics
318
+ are fixed here so the signal contract reserves them. Implementation must
319
+ not drop a reserved semantic or remove the field that carries it.
320
+
321
+ profile_sufficiency:
322
+ question: >-
323
+ Does bounded profile synthesis preserve useful evidence distribution
324
+ compared with the current full-corpus intent? (planning Unknown 2)
325
+ profile_signal_types:
326
+ - decision
327
+ - question
328
+ - correction
329
+ - instruction
330
+ - configuration
331
+ prior_intended_distribution: >-
332
+ The prior intended distribution is the complete set of profile-relevant
333
+ signals (the profile_signal_types above) across all supported source
334
+ families, mirroring what a full-corpus read would have surfaced before
335
+ tiering. The signal tier's derivation is total when no cap is applied:
336
+ every full-evidence record yields exactly one signal, so the bounded and
337
+ intended distributions are identical. The comparison below is the safety
338
+ net that detects when signal selection reduces a family below a useful
339
+ threshold.
340
+ threshold_rule: >-
341
+ Profile synthesis is sufficient when the signal tier is uncapped (retained
342
+ == total) or every profile-relevant source family retains at least the
343
+ minimum representative fraction of its intended decision-bearing signals.
344
+ A family with zero intended signals is not a sufficiency violation; a
345
+ family with intended signals that retains none is.
346
+ minimum_family_retention: 0.5
347
+ minimum_family_retention_note: >-
348
+ The minimum per-family retention is 0.5 (half of the family's intended
349
+ profile-relevant signals). Below this, a family is underrepresented and
350
+ profile synthesis must surface the limitation rather than silently reduce
351
+ confidence for that family's contributions. The threshold is deliberately
352
+ lenient because proportional-per-family selection already preserves the
353
+ relative distribution; the check exists to catch a cap severe enough to
354
+ distort a family's evidence below a useful floor.
355
+ insufficiency_rule: >-
356
+ When insufficient, profile synthesis surfaces the underrepresented families
357
+ with their retained and intended counts, caps confidence for affected
358
+ categories to the single-signal band (CS4, 30-49) or below, and never
359
+ fabricates high-confidence claims from sparse or missing evidence. The
360
+ limitation is reported in the profile output and exit signal, not silently
361
+ absorbed.
362
+ derivation: >-
363
+ Resolves planning Unknown 2. The comparison is reproducible: identical
364
+ full evidence yields an identical sufficiency assessment because signal
365
+ derivation and selection are deterministic (Unknown 1). The prior
366
+ intended distribution is reconstructed from the signal tier's selection
367
+ report (total per family) and the retained distribution from the published
368
+ signal records (retained per family), so the comparison needs no separate
369
+ full-corpus read.
370
+
371
+ bounds:
372
+ reader_byte_cap: 67108864
373
+ reader_byte_cap_note: >-
374
+ 64 MiB. Existing bounded readers cap monolithic reads at this size and
375
+ safely degrade. The tier model replaces "safely degrade" with "useful
376
+ analysis" by feeding consumers bounded tiers that fit under this cap even
377
+ when complete local evidence is hundreds of megabytes.
378
+ shard_bound_rule: >-
379
+ Each full-evidence shard is independently bounded. A single oversized shard
380
+ is reported and recoverable; it cannot make the whole tier unloadable.
381
+ shard_byte_cap: 67108864
382
+ shard_byte_cap_note: >-
383
+ A full-evidence shard encodes no more than `reader_byte_cap` bytes. Shards
384
+ are grouped by source family; when a family's encoded records exceed the
385
+ cap the family is split into numbered sub-shards so no shard exceeds it and
386
+ no record is dropped. This is the measured bound a bounded reader loads.
387
+ signal_bound_rule: >-
388
+ The signal tier is bounded to fit under the reader cap. Selection must
389
+ preserve representative evidence across all supported sources rather than
390
+ silently truncating one source.
391
+ signal_byte_cap: 67108864
392
+ signal_byte_cap_note: >-
393
+ The whole signal tier encodes no more than `reader_byte_cap` bytes. A signal
394
+ record carries only the contract's required fields plus `evidence_anchor` and
395
+ no transcript text, raw tool arguments, or raw store paths; measured
396
+ per-record size is far below the cap for realistic corpora, so the natural
397
+ outcome is to retain every derived signal. The selection below is the
398
+ deterministic safety net that keeps the bound when a real-scale corpus would
399
+ otherwise exceed it.
400
+ signal_selection:
401
+ rule: >-
402
+ Applied only when the derived signal tier exceeds `signal_byte_cap`. The
403
+ derivation is otherwise total: identical full evidence yields identical
404
+ signal membership and ordering.
405
+ algorithm: >-
406
+ Group derived signal records by source family. Allocate a per-family record
407
+ quota proportional to that family's share of the total record count, with a
408
+ minimum of one record per family so no supported source is silently
409
+ truncated to zero. Within each family, keep the most recent records first
410
+ (timestamp descending, then `source_id` ascending as the deterministic
411
+ tie-break). Reassemble the kept records in the stable tier order
412
+ (timestamp ascending, then `source_id` ascending). The generation identity
413
+ is derived from the retained membership so identical input reproduces an
414
+ identical selected tier.
415
+ derivation: >-
416
+ Resolves planning Unknown 1. The bound is the existing reader cap reused as
417
+ the signal cap because a bounded consumer must load the whole signal tier in
418
+ one read. Proportional-per-family selection preserves the relative evidence
419
+ distribution across all supported sources; recency-within-family preserves
420
+ the most decision-relevant signals; the fixed `(timestamp, source_id)`
421
+ ordering makes membership and ordering reproducible.
422
+ real_scale_acknowledgement: >-
423
+ Real corpora exceed 500 MB. The goal is useful analysis, not merely
424
+ graceful failure; bounded tiers exist so consumers analyze real scale
425
+ rather than reporting unavailable or stale results.
426
+
427
+ compatibility_states:
428
+ determinism_rule: >-
429
+ Every compatibility state has a fixed status, reason, recovery action, and
430
+ outcome. Recovery is actionable: it names the command or correction that
431
+ restores useful analysis. outcomes are limited to `recover` and `degrade`;
432
+ a `degrade` outcome must keep provenance visible and never fabricate
433
+ coverage. These outcomes are covered by passing and failing checks.
434
+ states:
435
+ oversized:
436
+ trigger: A full-evidence shard or legacy monolithic corpus exceeds the reader cap.
437
+ status: stale
438
+ reason: oversized
439
+ outcome: degrade
440
+ recovery: >-
441
+ Refresh bounded tiers with `agentera stats refresh --consent
442
+ local-history` or read the signal tier, which is bounded to fit. Do not
443
+ attempt to load the oversized artifact whole.
444
+ determinism: >-
445
+ Size is computed before read; the artifact is never partially loaded.
446
+ The signal tier remains usable.
447
+ legacy:
448
+ trigger: >-
449
+ A pre-tiering monolithic corpus.json exists but no bounded tiers have
450
+ been published.
451
+ status: stale
452
+ reason: legacy_monolithic_state
453
+ outcome: degrade
454
+ recovery: >-
455
+ Emit deterministic refresh guidance: run `agentera stats refresh
456
+ --consent local-history` to publish bounded tiers. Legacy monolithic
457
+ state receives refresh guidance rather than indefinite read
458
+ compatibility.
459
+ determinism: >-
460
+ Legacy state is detected by envelope shape and missing tier markers; it
461
+ is never silently treated as current.
462
+ missing:
463
+ trigger: No evidence artifact or tier exists at the resolved path.
464
+ status: missing
465
+ reason: no_evidence
466
+ outcome: degrade
467
+ recovery: >-
468
+ Report `agentera stats refresh --consent local-history` and the
469
+ `--corpus PATH` override. Must not auto-build, scan home directories, or
470
+ run live extraction without consent.
471
+ determinism: >-
472
+ Missing is reported as a concrete status with a path, never as an empty
473
+ success.
474
+ corrupt:
475
+ trigger: An artifact exists but is not readable JSON or fails schema validation.
476
+ status: stale
477
+ reason: unreadable_or_schema_divergent
478
+ outcome: degrade
479
+ recovery: >-
480
+ Refresh from source history. If a single shard is corrupt, the other
481
+ shards and the signal tier remain usable; only the corrupt shard is
482
+ flagged.
483
+ determinism: >-
484
+ Parse errors are caught per artifact/shard and reported with the
485
+ failing reason; one corrupt shard cannot crash tier reads.
486
+ incomplete:
487
+ trigger: >-
488
+ Tiers exist but a supported source family is unavailable, skipped
489
+ without acceptance, or extracted zero records.
490
+ status: flagged
491
+ reason: coverage_gap_or_sparse
492
+ outcome: degrade
493
+ recovery: >-
494
+ Surface the skipped/sparse family with its reason. Available skipped
495
+ sources require explicit `--accept-coverage-gap`; sparse (zero-record)
496
+ extraction is distinct from schema divergence.
497
+ determinism: >-
498
+ Coverage gaps and sparse extraction are reported per family with
499
+ discovery status; none is silently omitted.
500
+
501
+ scope:
502
+ in_scope:
503
+ - Tier contract definition, source coverage, consumer field supply.
504
+ - Signal semantics reservation for current and deferred consumers.
505
+ - Compatibility state definitions and deterministic recovery outcomes.
506
+ - Small contract-model code and focused tests making invariants executable.
507
+ out_of_scope:
508
+ - Complete extraction writer implementation.
509
+ - Migration of all consumers to bounded tiers.
510
+ - Bounded profile synthesis runtime.
511
+ - Glossary implementation.
512
+ - Profile level selection.
513
+ - Suite version bump, release, or publish.
514
+ version_constraint: >-
515
+ Suite and version metadata remain at 3.0.0. This contract does not bump,
516
+ release, or publish anything.