@brunobracaioli/aibrain 0.1.0-beta.1 → 0.3.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,12 +2,15 @@
2
2
 
3
3
  Assisted AI Brain context beta client for Linux/WSL with Node.js 22 or newer.
4
4
 
5
- The reviewed native compatibility set is Claude Code 2.1.294, 2.1.295, or
6
- 2.1.296, and Codex CLI 0.161.0 or 0.162.0. Other versions require a new
7
- compatibility review before setup.
5
+ The reviewed native compatibility set is Claude Code 2.1.294, 2.1.295, 2.1.296,
6
+ 2.1.299, 2.1.300, 2.1.301 or 2.1.302, and Codex CLI 0.161.0,
7
+ 0.162.0, 0.162.1 or 0.163.0. A newer stable Codex 0.x release may continue only
8
+ after its locally generated experimental protocol schemas and transport flags
9
+ match the bundled adapter contract; prereleases, older releases and new majors
10
+ remain rejected.
8
11
 
9
12
  ```sh
10
- # After the reviewed artifact is published:
13
+ # Install the published beta:
11
14
  npm install -g @brunobracaioli/aibrain@beta
12
15
  aibrain setup --client both
13
16
  aibrain doctor --json
@@ -27,8 +30,8 @@ explicitly acknowledge the displayed disclosure with
27
30
  `aibrain setup --client both --token-file /private/path/brain.pat
28
31
  --accept-disclosure`.
29
32
 
30
- Before registry publication, use the reviewed
31
- `brunobracaioli-aibrain-*.tgz` artifact from CI with
33
+ For a CI-reviewed tarball, use
34
+ `brunobracaioli-aibrain-*.tgz` with
32
35
  `npm install -g ./brunobracaioli-aibrain-*.tgz`; registry installation is gated on
33
36
  the operator's npm review and authentication.
34
37
 
@@ -36,5 +39,83 @@ For users of an earlier unscoped review tarball, close its client sessions,
36
39
  run `npm uninstall -g aibrain`, and install this scoped package. Local
37
40
  `~/.aibrain` state, notes, and checkpoints are retained.
38
41
 
42
+ This `0.3` client adds configurable context profiles. A fresh
43
+ setup defaults to `upstream`: 60% trigger, 0.5 keep threshold, six recent items
44
+ protected, and broader completed text-tool eligibility in Claude. Existing
45
+ schema1 configurations keep their previous behavior. After a reviewed v2 backend
46
+ and client release, opt in explicitly with:
47
+
48
+ ```sh
49
+ aibrain setup --client both --context-profile upstream
50
+ # Or retain conservative retention with the v2 protocol:
51
+ aibrain setup --client both --context-profile conservative
52
+ ```
53
+
54
+ Use `aibrain --help` for individual overrides. Claude-only flags are rejected for
55
+ Codex-only setup. Status and doctor show effective settings without custom goal
56
+ text; they do not claim that a live session is being monitored. Codex keeps native
57
+ compaction and recovery notes in the same thread. The backend checks paid access
58
+ and unchanged shared quotas before any JEV request.
59
+
60
+ The `0.3.0-beta.13` Claude launcher uses the durable context strategy and
61
+ records bounded recovery reasons when native summary proof cannot be confirmed:
62
+ JEV selects compatible historical tool evidence, bounded private notes retain
63
+ the selected text, and Claude core summarizes the reduced input. The next
64
+ prompt restores those notes in the same session after verifying native state.
65
+ The final native context contains a summary; this is not summary-free transcript
66
+ replacement. Direct hook-owned history replacement remains experimental because
67
+ resume can replay older content in affected Claude versions.
68
+
69
+ The notes preserve only the selected retained text that fits the local bound;
70
+ oversized entries are omitted as whole entries and counted. The separate full
71
+ checkpoint has its own retention. Neither path guarantees perfect preservation
72
+ of every internal host field. Shadow prefiltering continues to observe without
73
+ changing tool results. Native qualification and publication evidence is tracked
74
+ in the [release record](https://github.com/brunobracaioli/mcp-ai-brain/blob/main/docs/reference/claude-durable-context-2026-10-14.md).
75
+
76
+ The launcher grants the native clients the provider-free `brain_context_budget`
77
+ read alongside the existing context tools. It is a short-lived advisory snapshot,
78
+ not a billing meter, reservation, or provider authorization; atomic admission
79
+ remains authoritative.
80
+
81
+ Codex diagnostics are kept in the launched adapter's private state directory.
82
+ `aibrain diagnostics --client codex --json` shows only bounded stages, closed
83
+ reasons, pseudonymous session identifiers, client versions, and small numeric
84
+ counters. Prompts, notes, paths, credentials, raw errors, and app-server stdout
85
+ are excluded.
86
+
87
+ Beta12 reads large Codex histories in bounded pages and keeps their complete
88
+ contents in verified private capture segments. It checks history again before
89
+ selection and before native compaction; notes and recovery stay in the same
90
+ thread. Older captures remain readable. A single turn exceeding 8 MiB, a capture
91
+ exceeding the bounded page/item/128 MiB limits, or exhausted private storage is
92
+ reported explicitly. Such a failure does not authorize discarding protected
93
+ history or retrying a paid operation. The private capture directory remains
94
+ bounded to 256 MiB and 128 managed files, with current recovery references
95
+ protected from cleanup.
96
+
97
+ Claude plan diagnostics distinguish response parsing, identity, expiry and
98
+ history changes. A text JSON plan can use the same 256 KiB limit as structured
99
+ plans; smaller budget/error envelopes retain their separate limits. These local
100
+ diagnostics contain format names and numeric sizes, never plan contents.
101
+
102
+ Context dashboard telemetry is disabled for fresh and existing configurations.
103
+ Enable it only after reviewing the extended disclosure:
104
+
105
+ ```sh
106
+ aibrain setup --client both --telemetry on --accept-disclosure
107
+ ```
108
+
109
+ Omit `--telemetry` to preserve the stored choice, or use `--telemetry off` to stop
110
+ future-launch reports. Settings are captured when a client starts, so close and
111
+ restart currently monitored sessions after opting out to stop their reporting.
112
+ Enabled reports use the existing authenticated MCP transport and
113
+ contain only a hashed native session key, random lifecycle identifiers, native
114
+ client version, phase, timestamps, numeric counts, and allowed measurements or
115
+ reasons. Prompts, notes, paths, tool names, credentials, and raw errors are not
116
+ reported. The dashboard shows a 30-day visible window; physical cleanup runs on
117
+ the next successful daily cleanup. Delivery failure never fails or triggers a
118
+ context operation.
119
+
39
120
  Read the [canonical subscriber beta guide](https://github.com/brunobracaioli/mcp-ai-brain/blob/main/docs/how-to/aibrain-subscriber-beta.md)
40
121
  for setup, support, disclosure, limits, and disable procedures.
@@ -1,10 +1,16 @@
1
1
  {
2
2
  "name": "ai-brain-context-compaction",
3
- "version": "0.1.0",
3
+ "version": "0.3.0-beta.13",
4
4
  "author": { "name": "AISAC" },
5
5
  "description": "AI Brain paid-plan context monitoring with conservative Claude compaction fallback.",
6
6
  "hooks": "./hooks/hooks.json",
7
7
  "userConfig": {
8
+ "policyVersion": {
9
+ "type": "number",
10
+ "title": "Context policy version",
11
+ "description": "Use 2 for configurable broader parity; omit or use 1 to preserve legacy behavior.",
12
+ "default": 1
13
+ },
8
14
  "brainServer": {
9
15
  "type": "string",
10
16
  "title": "AI Brain MCP server",
@@ -17,6 +23,54 @@
17
23
  "description": "Request host compaction at or above this reported context percentage.",
18
24
  "default": 85
19
25
  },
26
+ "keepThreshold": {
27
+ "type": "number",
28
+ "title": "JEV keep threshold",
29
+ "description": "V2 score threshold for retaining eligible content.",
30
+ "default": 0.5
31
+ },
32
+ "preserveRecentMessages": {
33
+ "type": "number",
34
+ "title": "Recent messages to preserve",
35
+ "description": "Number of recent messages pinned before scoring.",
36
+ "default": 6
37
+ },
38
+ "minReductionRatio": {
39
+ "type": "number",
40
+ "title": "Minimum reduction ratio",
41
+ "description": "Minimum configured reduction required before returning a candidate.",
42
+ "default": 0.25
43
+ },
44
+ "truncateHeadChars": {
45
+ "type": "number",
46
+ "title": "Truncated result head characters",
47
+ "description": "Unicode-safe head size for eligible result truncation.",
48
+ "default": 300
49
+ },
50
+ "maxStateTokens": {
51
+ "type": "number",
52
+ "title": "Maximum scoring state units",
53
+ "description": "Upper bound for the provider scoring state.",
54
+ "default": 25000
55
+ },
56
+ "maxRequestTokens": {
57
+ "type": "number",
58
+ "title": "Maximum scoring request units",
59
+ "description": "Upper bound for the provider scoring request.",
60
+ "default": 30000
61
+ },
62
+ "toolPolicy": {
63
+ "type": "string",
64
+ "title": "Claude tool policy",
65
+ "description": "Use read_only or compatible v2 eligibility.",
66
+ "default": "compatible"
67
+ },
68
+ "goal": {
69
+ "type": "string",
70
+ "title": "Private task goal",
71
+ "description": "Optional bounded private task goal sent in the redacted projection.",
72
+ "default": ""
73
+ },
20
74
  "enabled": {
21
75
  "type": "boolean",
22
76
  "title": "Enable automatic compaction",
@@ -35,11 +89,59 @@
35
89
  "description": "preserve_internal keeps handled messages intact. upstream_compatible rebuilds selected handled read messages from exposed fields and may lose hidden engine metadata.",
36
90
  "default": "preserve_internal"
37
91
  },
92
+ "compactionStrategy": {
93
+ "type": "string",
94
+ "title": "Compaction strategy",
95
+ "description": "direct_experimental returns a hook-owned transcript; native_summary_notes delegates the final summary to Claude core and keeps selected evidence in private notes.",
96
+ "default": "direct_experimental"
97
+ },
38
98
  "diagnosticMode": {
39
99
  "type": "boolean",
40
100
  "title": "Emit runtime diagnostics",
41
101
  "description": "Opt-in content-free hook entry diagnostics for local pilot verification.",
42
102
  "default": false
103
+ },
104
+ "telemetryEnabled": {
105
+ "type": "boolean",
106
+ "title": "Enable context dashboard telemetry",
107
+ "description": "Opt-in operational telemetry for the authenticated Contexto dashboard. The launcher enables this only after the extended AI Brain disclosure.",
108
+ "default": false
109
+ },
110
+ "telemetryDisclosed": {
111
+ "type": "boolean",
112
+ "title": "Context telemetry disclosure acknowledged",
113
+ "description": "Permit content-free lifecycle reports containing a hashed session key, bounded measurements, counts, phases and reasons.",
114
+ "default": false
115
+ },
116
+ "telemetryClientVersion": {
117
+ "type": "string",
118
+ "title": "Native Claude version",
119
+ "description": "Launcher-provided native semver used to label telemetry; empty values keep telemetry inactive.",
120
+ "default": ""
121
+ },
122
+ "telemetryNodePath": {
123
+ "type": "string",
124
+ "title": "Owned telemetry Node path",
125
+ "description": "Launcher-provided absolute Node executable path for the report helper.",
126
+ "default": ""
127
+ },
128
+ "telemetryHelperPath": {
129
+ "type": "string",
130
+ "title": "Owned telemetry helper path",
131
+ "description": "Launcher-provided absolute report-only helper path.",
132
+ "default": ""
133
+ },
134
+ "telemetryStateDir": {
135
+ "type": "string",
136
+ "title": "Owned telemetry state path",
137
+ "description": "Launcher-provided private aibrain state directory for the helper.",
138
+ "default": ""
139
+ },
140
+ "telemetryConfigDigest": {
141
+ "type": "string",
142
+ "title": "Owned telemetry configuration binding",
143
+ "description": "Launcher-provided binding for the private endpoint, token and disclosure state.",
144
+ "default": ""
43
145
  }
44
146
  }
45
147
  }