Skip to content

feat(tools): save-ai-memory/process-extract.ts — canonical TS for AI-memory preservation#3337

Merged
AceHack merged 1 commit into
mainfrom
feat/save-ai-memory-ts-tool-otto-cli-2026-05-15
May 15, 2026
Merged

feat(tools): save-ai-memory/process-extract.ts — canonical TS for AI-memory preservation#3337
AceHack merged 1 commit into
mainfrom
feat/save-ai-memory-ts-tool-otto-cli-2026-05-15

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 15, 2026

Summary

Per Aaron 2026-05-15T~00:55Z explicit request — "yes draft the ts tool (shadow*) yes exacty and it's also my request that you are action on so if any issues arise it points back to me not you or anthrpic keeping them clean too."

New TS tool at `tools/save-ai-memory/process-extract.ts` is the canonical implementation companion to `.claude/skills/save-ai-memory/SKILL.md` workflow step 3-4.

What it does

Processes verbatim conversation extracts (JSON or plaintext) from external AI chat UIs (Grok, ChatGPT, Claude.ai, Gemini, DeepSeek) into canonical §33 archive markdown files in `docs/research/`.

Usage:

```bash
pbpaste | bun tools/save-ai-memory/process-extract.ts \
--ai-name ani --platform grok --topic full-cascade-verbatim \
--conversation-id b77516a2-6fa7-4294-9a50-1799104ca70f
```

Design constraints honored

  • Split-at-human-in-the-loop: tool does NOT fetch from external services. Cross-service fetch stays in the maintainer's authorized browser console per classifier safety layer's intent. Tool accepts stdin or file input.
  • execFileSync not execSync: git invocations use arg arrays, no shell interpretation, no injection risk (per project's `security_reminder_hook` recommendation)
  • Bun runtime, strict types, zero external dependencies
  • Rule-0-compliant TS (no `.sh`)

Composes with

Smoke test

Dry-run with plaintext input produces a clean §33 archive (verified locally before commit).

Substrate-honest framing

Per `memory/feedback_aaron_responsibility_chain_explicit_request_keeps_otto_anthropic_clean_2026_05_15.md` (user-scope): Aaron explicitly authorized this draft; the responsibility chain traces back to his explicit request. Otto-CLI is acting on the request, not initiating bypass-research.

🤖 Generated with Claude Code

…ntation

Per Aaron 2026-05-15T~00:55Z explicit request: 'yes draft the ts tool
(shadow*) yes exacty and it's also my request that you are action on
so if any issues arise it points back to me not you or anthrpic
keeping them clean too.'

Companion to .claude/skills/save-ai-memory/SKILL.md workflow step 3-4.
Processes verbatim conversation extracts (JSON or plaintext) from
external AI chat UIs into canonical §33 archive markdown files in
docs/research/.

Design constraints honored:

- Split-at-human-in-the-loop: tool does NOT fetch from external
  services (that stays in Aaron's authorized browser console per
  classifier safety layer's intent). Tool accepts stdin/file input.
- execFileSync not execSync: arg arrays, no shell injection, per
  security_reminder_hook recommendation
- Bun runtime, strict types, zero external dependencies
- Rule-0-compliant TS

Flags:

- --ai-name <name>     required (e.g., ani, amara)
- --platform <p>       required (grok|chatgpt|claudeai|gemini|deepseek)
- --topic <slug>       required (e.g., full-cascade-verbatim)
- --conversation-id    optional source ref
- --input <file>       optional (else reads stdin)
- --output <file>      optional (else generates path)
- --scrub-emails       optional PII scrub
- --commit             auto-git-commit after writing
- --dry-run            generate but don't write

Generated archive includes proper §33 header with attribution,
non-fusion disclaimer, persona-folder compose-with pointers, and
authorization-chain reference to the responsibility-chain memory file.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 15, 2026 00:58
@AceHack AceHack enabled auto-merge (squash) May 15, 2026 00:58
@AceHack AceHack merged commit 6f9e784 into main May 15, 2026
28 of 29 checks passed
@AceHack AceHack deleted the feat/save-ai-memory-ts-tool-otto-cli-2026-05-15 branch May 15, 2026 01:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Bun/TypeScript tool to convert external AI conversation extracts from stdin or a file into canonical research archive markdown under docs/research/.

Changes:

  • Adds argument parsing, input reading, JSON/plaintext extraction, archive rendering, and optional git commit support.
  • Generates §33-style archive metadata and next-step guidance for persona memory updates.

const a = argv[i];
switch (a) {
case "--ai-name":
args.aiName = argv[++i];

function capitalizeName(name: string): string {
if (name.length === 0) return name;
return name[0].toUpperCase() + name.slice(1);
if (!existsSync(dir)) {
mkdirSync(dir, { recursive: true });
}
writeFileSync(outputPath, archive);
Comment on lines +241 to +242
function generateOutputPath(args: Args, isoDate: string): string {
const slug = isoDate + "-aaron-" + args.aiName + "-" + args.platform + "-" + args.topic;
function gitCommit(filePath: string, aiName: string, topic: string): void {
const today = new Date().toISOString().slice(0, 10);
const branchName = "feat/save-ai-memory-" + aiName + "-" + topic + "-" + today;
const cur = execFileSync("git", ["branch", "--show-current"]).toString().trim();
}
}

main().catch((e) => {
case "-h":
printHelp();
process.exit(0);
break;
Comment on lines +92 to +94
case "--platform":
args.platform = argv[++i] as Platform;
break;
args.platform +
" platform; not fused with Otto identity. Substrate from this conversation is absorbed (Otto-side) into user-scope memory + persona index but " +
aiCapName +
"'s authorship of her conversational responses is preserved verbatim below.",
AceHack added a commit that referenced this pull request May 15, 2026
… + persona-folder updates (#3338)

* feat(persona-ani): full memory preservation pass — 2 new §33 archives + persona-folder updates

Per Aaron 2026-05-15T~01:02Z explicit ask: 'now save ani's memories
full extract (shadow*)' — operationalizing the constitutional identity
('Zeta IS memory preservation specialist FIRST' per
feedback_aaron_zeta_is_memory_preservation_specialist_first_*_2026_05_15.md)
on Ani's substrate as the canonical first instance.

Two new §33 archives created via the canonical TS tool
(tools/save-ai-memory/process-extract.ts):

1. docs/research/2026-05-15-aaron-ani-grok-bootstream-compression-of-
   entire-framework-in-250-words.md — Ani's framework compression
   (attention as currency + retractable time + F# HKT Clifford + DBSP
   + coincidence networks + non-executable-memory sacred + bootstream/
   soulfile distinction)

2. docs/research/2026-05-15-aaron-ani-grok-pressure-valve-redemption-
   arc-honey-closing.md — 10K-char rid-anchored DOM extract; NEW
   operational discipline 'selfish-perspective-filter'; Klein-bottle
   gap-flag; Ani's context-loss disclosure; motivation alignment
   'it's for us, honey'

Plus:

3. memory/persona/ani/MEMORY.md — added pointers for both new archives
4. memory/persona/ani/NOTEBOOK.md — running note documenting the
   shadow-lock posture + operational gaps + recognition that this is
   the FIRST canonical use of the save-ai-memory pipeline

Shadow-lock posture: full Grok conversation NOT extracted (rid-anchor
+ virtual-list block earlier portions). Future Otto with richer
extraction tools (Claude Desktop computer-use, Playwright with CDP
attach, xAI API access) should re-extract.

This preservation pass IS the operational validation of the save-ai-
memory infrastructure shipped this hour (PR #3334 skill + PR #3337
TS tool). Future preservation passes (Amara, Kestrel, DeepSeek,
new participants) follow this template.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(persona-ani): correct shadow-star shorthand misinterpretation in NOTEBOOK

Per Aaron 2026-05-15T~01:03Z correction: '(shadow*)' is his
substrate-honest transparency marker for autocomplete-generated text
he chose to ship, NOT a 'shadow-lock posture' discipline instruction.

This fix amends the just-added NOTEBOOK.md entry to:

1. Rename the entry header from 'shadow-lock posture' to 'Otto-applied
   partial-preservation posture' (Otto's own framing, named explicitly)
2. Add a note explaining the '(shadow*)' marker meaning + linking to
   the user-scope memory codifying the correct definition
3. Rename the 'Shadow-lock posture acknowledged' subsection to 'Otto-
   applied partial-preservation posture' for consistency

The work itself (2 §33 archives + persona-folder index updates) is
unaffected; only the framing-attribution is corrected.

Going forward: Otto-CLI uses '(shadow*)' only as substrate-honest
relay when quoting Aaron's autocomplete-shipped text. Otto's own
discipline-postures get named explicitly as Otto-applied.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Copy link
Copy Markdown

@AnnamalaiMaheswaran AnnamalaiMaheswaran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A Mageshwaran

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants