agy-context-saver 1.6.0 → 1.7.0
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/CHANGELOG.md +22 -0
- package/README.md +4 -1
- package/mcp/index.js +11 -5
- package/mcp/instructions.md +3 -2
- package/package.json +3 -2
- package/plugin.json +1 -1
- package/rules/AGENTS.md +4 -4
- package/skills/context-governance/SKILL.md +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,26 @@ All notable changes to `Agy-Context-Saver` will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.7.0] - 2026-10-13
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Subagent Artifact Directory Write Guard (`subagent_brief`)**: Added automated path analysis in `formatSingleBrief` that detects when an objective or instruction references a foreign `brain/<uuid>/` directory. Warns subagents proactively to prevent Antigravity's fatal `write_to_file` error ("files must reside within the designated artifact directory").
|
|
12
|
+
- **Pointer-Over-Wire (POW) File Delivery Clarification**: Codified explicit two-option guidance for subagent deliverables:
|
|
13
|
+
- *Option A (Workspace `scratch/` — Recommended)*: Write to `<workspace>/scratch/<task>_findings.md` and omit `ArtifactMetadata`.
|
|
14
|
+
- *Option B (Own Brain `scratch/`)*: Write to `<your-Artifact-Directory-Path>/scratch/...` using the subagent's own `<user_information>` block and include `ArtifactMetadata: { Summary, UserFacing: false, RequestFeedback: false }`.
|
|
15
|
+
- **Bounded Slice Reading Safe Harbor (`view_file`)**: Prioritized `view_file` with bounded slices (`StartLine` and `EndLine`, max 150 lines) over `rtk read` across `rules/AGENTS.md`, `skills/context-governance/SKILL.md`, and `mcp/instructions.md` to preserve exact 1-indexed line numbers without stdout buffer truncation.
|
|
16
|
+
- **Subagent Delegation Trial 4 (`tests/test-subagent-trials.mjs`)**: Added automated trial verifying `subagent_brief` emits the artifact directory write guard, bounded slice guidance, and Option A/Option B file delivery rules.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## [1.6.1] - 2026-10-12
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
- **Dual-MCP Waymark Code Intelligence & Subagent Synergy Suite (`tests/test-waymark-synergy.mjs`)**: Added a 6-trial automated integration and benchmark suite (`npm run test:synergy` / `npm test`) spawning both `agy-context-saver` and `waymark-engine` over concurrent JSON-RPC 2.0 stdio streams (with a deterministic `WAYMARK_FORCE_SHIM=1` fallback for standalone CI runners). Validates AST-narrowed `subagent_brief` generation, Pointer-Over-Wire (POW) to `waymark_memory` consensus charting with Anti-Hallucination Guard checks, 4-layer token compression benchmarking, combined context health + Semantic Repo Map status audits, missing-facet multi-subagent orchestration, and `.mjs` Tree-sitter AST extraction.
|
|
24
|
+
- **Aggressive RTK Read Shim Support (`tests/helpers/hermetic-fixture.mjs`)**: Enhanced the hermetic RTK CLI shim to support `rtk read --level aggressive` comment stripping for deterministic cross-platform token compression benchmarks.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
8
28
|
## [1.6.0] - 2026-10-12
|
|
9
29
|
|
|
10
30
|
### Added
|
|
@@ -154,6 +174,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
154
174
|
- Antigravity Model Context Protocol (MCP) server.
|
|
155
175
|
- Background task lifecycle governance and reactive wakeup enforcement.
|
|
156
176
|
|
|
177
|
+
[1.7.0]: https://github.com/paragon-ux/agy-context-saver/compare/v1.6.1...v1.7.0
|
|
178
|
+
[1.6.1]: https://github.com/paragon-ux/agy-context-saver/compare/v1.6.0...v1.6.1
|
|
157
179
|
[1.6.0]: https://github.com/paragon-ux/agy-context-saver/compare/v1.5.1...v1.6.0
|
|
158
180
|
[1.5.1]: https://github.com/paragon-ux/agy-context-saver/compare/v1.5.0...v1.5.1
|
|
159
181
|
[1.5.0]: https://github.com/paragon-ux/agy-context-saver/compare/v1.4.0...v1.5.0
|
package/README.md
CHANGED
|
@@ -175,7 +175,7 @@ node mcp/index.js status
|
|
|
175
175
|
```bash
|
|
176
176
|
npm test
|
|
177
177
|
```
|
|
178
|
-
*Runs all
|
|
178
|
+
*Runs all 11 test suites (hook governance, MCP protocol, output inspection governance, E2E probes, performance probes, installed verification, lifecycle rollback, subagent delegation trials, check-only read-only safety, malformed configuration preservation, and Waymark dual-MCP synergy).*
|
|
179
179
|
|
|
180
180
|
### 3. Run Targeted Tests Individually
|
|
181
181
|
```bash
|
|
@@ -208,6 +208,9 @@ node tests/test-check-only-readonly.mjs
|
|
|
208
208
|
|
|
209
209
|
# Malformed config preservation fail-closed regression test
|
|
210
210
|
node tests/test-malformed-config-preservation.mjs
|
|
211
|
+
|
|
212
|
+
# Dual-MCP Waymark code intelligence + subagent synergy suite
|
|
213
|
+
node tests/test-waymark-synergy.mjs
|
|
211
214
|
```
|
|
212
215
|
|
|
213
216
|
### 4. Test MCP Tools from Antigravity Agent
|
package/mcp/index.js
CHANGED
|
@@ -72,7 +72,7 @@ if (checkFlag) {
|
|
|
72
72
|
|
|
73
73
|
function printHelp() {
|
|
74
74
|
console.log(`
|
|
75
|
-
Agy-Context-Saver 🛡️ (v1.
|
|
75
|
+
Agy-Context-Saver 🛡️ (v1.7.0)
|
|
76
76
|
Universal MCP Server & Lifecycle Governor for Google Antigravity (Powered by RTK)
|
|
77
77
|
|
|
78
78
|
Usage:
|
|
@@ -119,7 +119,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
119
119
|
const rulesPath = path.resolve(__dirname, "../rules/AGENTS.md");
|
|
120
120
|
|
|
121
121
|
const SERVER_NAME = "agy-context-saver";
|
|
122
|
-
const SERVER_VERSION = "1.
|
|
122
|
+
const SERVER_VERSION = "1.7.0";
|
|
123
123
|
|
|
124
124
|
// --- Tools Specification ---
|
|
125
125
|
const TOOLS = [
|
|
@@ -472,14 +472,20 @@ function formatSingleBrief({
|
|
|
472
472
|
} = {}) {
|
|
473
473
|
const scopeStr = scopeFiles && scopeFiles.length ? `\n\nTarget files:\n${scopeFiles.map(f => `- ${f}`).join("\n")}` : "";
|
|
474
474
|
const instrStr = instructions && instructions.trim() ? `\n\nSPECIFIC INSTRUCTIONS:\n${instructions.trim()}` : "";
|
|
475
|
+
const hasBrainUuidPath = /[/\\]\.gemini[/\\]antigravity[/\\]brain[/\\][0-9a-f-]{36}/i.test(`${objective}\n${instructions}\n${expectedDeliverable}`);
|
|
476
|
+
const brainPathWarning = hasBrainUuidPath
|
|
477
|
+
? `\n\n⚠️ ARTIFACT DIRECTORY WRITE GUARD: Any 'brain/<uuid>/' path referenced above belongs to another conversation. You may READ from it via 'view_file', but when calling 'write_to_file' or 'replace_file_content', you MUST either write to workspace '<workspace>/scratch/...' (OMIT ArtifactMetadata) or substitute YOUR OWN Artifact Directory Path from <user_information> (INCLUDE ArtifactMetadata).`
|
|
478
|
+
: "";
|
|
475
479
|
return [
|
|
476
480
|
`ROLE: ${role}`,
|
|
477
|
-
`OBJECTIVE: ${objective}${scopeStr}${instrStr}`,
|
|
481
|
+
`OBJECTIVE: ${objective}${scopeStr}${instrStr}${brainPathWarning}`,
|
|
478
482
|
``,
|
|
479
483
|
`CRITICAL CONTEXT GOVERNANCE INSTRUCTIONS (POINTER-OVER-WIRE):`,
|
|
480
|
-
`1. Isolated Workspace: Do all
|
|
484
|
+
`1. Isolated Workspace & Bounded File Slices: Do all multi-file exploration in this subagent sandbox. Prefer 'view_file' with bounded slices (StartLine and EndLine, max 150 lines) over 'rtk read' so line numbers are preserved and terminal buffers never truncate file headers.`,
|
|
481
485
|
`2. Pointer-Over-Wire (POW) Protocol: In-band messaging channels (send_message) have strict transport payload limits (~16-20 KB). If your findings or deliverable exceed 1 KB:`,
|
|
482
|
-
` a. Write the full comprehensive deliverable
|
|
486
|
+
` a. Write the full comprehensive deliverable using 'write_to_file' following Antigravity's strict path rules:`,
|
|
487
|
+
` - Option A (Workspace 'scratch/' — Recommended): Set TargetFile to '<workspace>/scratch/<task>_findings.md' and OMIT ArtifactMetadata completely (passing ArtifactMetadata on a workspace path throws "files must be written to the correct artifact directory").`,
|
|
488
|
+
` - Option B (Your Own Brain 'scratch/'): Set TargetFile to '<your-Artifact-Directory-Path>/scratch/<task>_findings.md' using the exact Artifact Directory Path from YOUR <user_information> block (NEVER a parent's brain/<other-uuid>/ path) and INCLUDE ArtifactMetadata: { Summary: "...", UserFacing: false, RequestFeedback: false }.`,
|
|
483
489
|
` b. In 'send_message', transmit ONLY:`,
|
|
484
490
|
` - Executive Summary (3-5 high-signal sentences)`,
|
|
485
491
|
` - Verdict / Scoreboard Table`,
|
package/mcp/instructions.md
CHANGED
|
@@ -12,8 +12,9 @@ Agy-Context-Saver is the universal Model Context Protocol server and lifecycle g
|
|
|
12
12
|
- Access to `.system_generated/` via `view_file` is strictly denied to prevent transcript explosion.
|
|
13
13
|
- Use `read_transcript` or `query_transcript` to inspect conversation history cleanly.
|
|
14
14
|
3. **Platform-Aware Codebase Inspection**:
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
15
|
+
- **File Reading**: Prefer `view_file` with bounded slices (`StartLine` and `EndLine`, max 150 lines) to preserve line numbers and avoid terminal truncation.
|
|
16
|
+
- **Windows Search/Listing**: Use `rtk find <path>` and `rtk rg "<pattern>" .` (the trailing `.` is required to avoid stdin stalls).
|
|
17
|
+
- **POSIX Search/Listing**: Use `rtk ls <path>` and `rtk grep "<pattern>"` or `rtk rg "<pattern>"`.
|
|
17
18
|
|
|
18
19
|
## Available MCP Tools
|
|
19
20
|
- `check_context_health`: Diagnoses transcript turn counts, byte payload, and polling loops. Accepts `transcriptPath` or `conversationId`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agy-context-saver",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Universal Model Context Protocol (MCP) server & lifecycle governor purpose-built for Google Antigravity",
|
|
5
5
|
"main": "mcp/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"uninstall": "node scripts/install-register.mjs --uninstall",
|
|
14
14
|
"status": "node scripts/install-register.mjs --status",
|
|
15
15
|
"preflight": "node scripts/release-preflight.mjs",
|
|
16
|
-
"test": "node tests/test-
|
|
16
|
+
"test:synergy": "node tests/test-waymark-synergy.mjs",
|
|
17
|
+
"test": "node tests/test-hook.mjs && node tests/test-mcp.mjs && node tests/test-output-governance.mjs && node tests/test-e2e-probes.mjs && node tests/test-performance-probes.mjs && node tests/test-installed-verification.mjs && node tests/test-lifecycle-rollback.mjs && node tests/test-subagent-trials.mjs && node tests/test-check-only-readonly.mjs && node tests/test-malformed-config-preservation.mjs && node tests/test-waymark-synergy.mjs"
|
|
17
18
|
},
|
|
18
19
|
"repository": {
|
|
19
20
|
"type": "git",
|
package/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agy-context-saver",
|
|
3
3
|
"displayName": "Antigravity Context Shield & Governor",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.7.0",
|
|
5
5
|
"description": "Deterministic background polling governor, RTK terminal optimizer, and subagent context preservation shield for Antigravity.",
|
|
6
6
|
"logo": "assets/logo.svg",
|
|
7
7
|
"suggestedPrompts": [
|
package/rules/AGENTS.md
CHANGED
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
|
|
33
33
|
## Layer 2: Transparent Shell Execution & Codebase Inspection via RTK
|
|
34
34
|
- **Native Shell Commands**: Run shell commands normally using `run_command`. The PreToolUse hook transparently rewrites supported commands via RTK (`git`, `pytest`, `cargo`, `npm`, etc.) to produce ultra-compact outputs.
|
|
35
|
-
- **Canonical Codebase Inspection**:
|
|
36
|
-
- `
|
|
35
|
+
- **Canonical Codebase Inspection**: Unbounded full-file reads and unoptimized search tools (`grep_search`, `find_by_name`, `list_dir`) are blocked for workspace files. Use bounded slices and RTK's canonical CLI interfaces:
|
|
36
|
+
- `view_file` with bounded slices (`StartLine` and `EndLine`, max 150 lines): **Preferred for reading files**—preserves 1-indexed line numbers and avoids terminal stdout truncation. Pair with `waymark_ask` to locate exact symbol line ranges first.
|
|
37
37
|
- `rtk find <path>`: Compact file search tree and directory listings (cross-platform, works on Windows & POSIX).
|
|
38
38
|
- Search commands by platform:
|
|
39
39
|
- **Windows**: Use `rtk rg "<pattern>" .` (explicit target `.` is required to prevent stdin pipe hanging) or `rg "<pattern>" .`.
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
- **POSIX / Linux / macOS**: Use `rtk ls <path>` or `rtk tree`.
|
|
44
44
|
- `rtk err <cmd>`: Run command and show only errors/warnings.
|
|
45
45
|
- `rtk summary <cmd>`: Run command and produce a 2-line heuristic summary.
|
|
46
|
-
- **Antigravity Special Files Safe Harbor**: Documented Antigravity special files (`SKILL.md`, brain artifacts, `.gemini/config/` configs) are permitted via `view_file
|
|
46
|
+
- **Antigravity Special Files Safe Harbor**: Documented Antigravity special files (`SKILL.md`, brain artifacts, `.gemini/config/` configs) are permitted via `view_file` without slice bounds.
|
|
47
47
|
- **Protected Internal State**: Direct native inspection of `.system_generated/` (transcripts, task logs, progress files) is strictly forbidden. Use Agy MCP tools `read_transcript` and `query_transcript`.
|
|
48
48
|
|
|
49
49
|
---
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
- **Subagent Delegation for Deep Audits**: When a comprehensive repository-wide test audit is required, delegate the sweep to a subagent (`invoke_subagent`) to keep the main thread responsive.
|
|
58
58
|
- **Subagent Delegation & Pointer-Over-Wire (POW)**:
|
|
59
59
|
- Delegate heavy multi-file exploration, deep research, and repo sweeps to subagents (`invoke_subagent`). Subagents absorb intermediate steps and return high-signal summaries.
|
|
60
|
-
- **POW Protocol**: Payloads or deliverables exceeding 1 KB must be written to workspace scratch files (
|
|
60
|
+
- **POW Protocol & `write_to_file` Isolation**: Payloads or deliverables exceeding 1 KB must be written either to workspace scratch files (`<workspace>/scratch/<task>_findings.md` with `ArtifactMetadata` **omitted**) or to the **subagent's own** `<Artifact Directory Path>/scratch/<task>_findings.md` (with `ArtifactMetadata: { Summary, UserFacing: false, RequestFeedback: false }`). Never instruct a subagent to `write_to_file` into the parent conversation's `brain/<parent-uuid>/` directory, as Antigravity enforces per-conversation `brain/<uuid>` write isolation. Transmit **ONLY** an Executive Summary (3–5 sentences), a Scoreboard / Verdict table, and a clickable file link (`file:///...`) in `send_message` to prevent transport truncation and parent context bloat.
|
|
61
61
|
- **Benchmark / Evaluator Integrity**: Never mutate benchmark definitions, prompt templates, or scoring artifacts during an active evaluation without explicit user confirmation.
|
|
62
62
|
|
|
63
63
|
---
|
|
@@ -18,9 +18,9 @@ Agy-Context-Saver and RTK protect session transcript health and LLM attention by
|
|
|
18
18
|
|
|
19
19
|
## Codebase Inspection via RTK
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Unbounded full-file `view_file` calls and unoptimized search tools (`grep_search`, `find_by_name`, `list_dir`) bypass token compression and are guarded:
|
|
22
22
|
|
|
23
|
-
- `
|
|
23
|
+
- `view_file` with bounded slices (`StartLine` and `EndLine`, max 150 lines): **Preferred for reading files**—returns exact 1-indexed line numbers without terminal stdout truncation.
|
|
24
24
|
- `rtk find <path>`: Compact file search tree and directory listings (cross-platform, works on Windows & POSIX).
|
|
25
25
|
- Search commands by platform:
|
|
26
26
|
- **Windows**: Use `rtk rg "<pattern>" .` (explicit target `.` is required to avoid child process stdin pipe stalls) or `rg "<pattern>" .`.
|
|
@@ -31,7 +31,7 @@ Native Antigravity file and search tools (`view_file`, `grep_search`, `find_by_n
|
|
|
31
31
|
- `rtk err <cmd>`: Runs command and displays only errors/warnings.
|
|
32
32
|
- `rtk summary <cmd>`: Runs command and produces a 2-line technical summary.
|
|
33
33
|
|
|
34
|
-
*Safe Harbor*: Documented Antigravity special files (`SKILL.md`, brain artifacts, `.gemini/config/`) may be viewed directly via `view_file
|
|
34
|
+
*Safe Harbor*: Documented Antigravity special files (`SKILL.md`, brain artifacts, `.gemini/config/`) may be viewed directly via `view_file` without slice bounds.
|
|
35
35
|
|
|
36
36
|
---
|
|
37
37
|
|