26 Commits

Author SHA1 Message Date
Ralph Chang 06dcf61711 feat(hot-state): section-aware greedy renderer, accounting types, fix docs drift
Replace blunt .slice(0, maxRenderedChars) truncation with a greedy line
accumulator that fits whole lines and suppresses header-only sections.
Add accountHotSessionStateRender() returning prompt + omitted[] accounting.
Export HotStateSection, HotStateOmissionReason, HotStateOmittedItem,
HotSessionStateRenderAccounting types for v2 evidence extension.
Fix configuration.md ranking formula (ACTION_WEIGHT + count*3, weights
50/45/30/20). Clarify README injection order. Add 9 unit tests.
2026-05-05 12:22:09 +08:00
Ralph Chang 3c13773231 feat(memory-diag): publish diagnostics CLI 2026-05-02 20:36:58 +08:00
Ralph Chang 36f00147ca feat(deprecation): remove safetyCritical retention multiplier and type-cap bypass
- Remove SAFETY_CRITICAL_FACTOR = 6.0 from workspace-memory.ts
- Remove safetyFactor from calculateInitialStrength() - all memories now
  fade according to the same rules
- Remove safetyCritical bypass from applyTypeMaxCaps() - safetyCritical
  entries compete normally under TYPE_MAX caps
- Preserve safetyCritical?: boolean in LongTermMemoryEntry type for
  backward compatibility (no producer sets it to true)
- Update memory-diag to show deprecation warning instead of capacity alert
- Update tests: add backward-compatibility fixture test, deprecation
  strength test, normal cap competition test
- Update docs/architecture.md, RELEASE_NOTES.md, CHANGELOG.md,
  docs/configuration.md

Phase 1.5 complete: safetyCritical is now a deprecated field with no
active behavior. Safety rules belong in user-controlled agent.md files.
2026-04-30 17:23:01 +08:00
Ralph Chang 830d97c6c6 fix(security): harden hooks, quarantine corrupt JSON, test locks, fix promotion dedupe
- Wrap hooks with try/catch to prevent OpenCode disruption
- Add warnMemoryHook() for safe error logging
- Quarantine corrupt JSON files before fallback
- Add cross-process lock safety tests
- Fix pending promotion same-batch dedupe
- Update docs/architecture.md with lock semantics
- 242 tests passing
2026-04-30 11:52:01 +08:00
Ralph Chang 1c6e143f4b chore(release): prepare v1.5.0 2026-04-29 16:56:47 +08:00
Ralph Chang 909fec9abb docs: prepare v1.3.0 release notes 2026-04-27 17:06:43 +08:00
Ralph Chang c8c7dbed3b chore: ignore superpowers plans and update architecture doc
- Add docs/superpowers/plans/ to .gitignore
- Remove tracked plan files from git
- Update docs/architecture.md:
  - Change primary extraction format from XML to 'Memory candidates:'
  - Mark XML format as legacy/deprecated
  - Fix hot session state injection example
2026-04-27 14:53:07 +08:00
Ralph Chang 5ed57943d2 docs: add memory quality optimization implementation plan
P0 implementation plan with 3 waves:
- Wave 1: Promotion accounting (fix absorbed duplicate data loss)
- Wave 2: Memory quality eval (fixture-based regression guard)
- Wave 3: Compaction prompt negative examples

Addresses architecture review feedback:
- Distinguish promoted/absorbed/rejected pending memories
- Add clearableKeys.size > 0 guard to prevent journal wipe
- Add regression tests for all edge cases
2026-04-27 14:16:46 +08:00
Ralph Chang eb74a9f03e docs: add workspace memory cache optimization plan 2026-04-27 01:55:48 +08:00
Ralph Chang f6f35e87c1 feat: release v1.2.2 with multilingual memory hardening 2026-04-27 00:21:18 +08:00
Ralph Chang ca71c20a8f docs: add memory dedup & staleness architecture analysis 2026-04-26 16:20:29 +08:00
Ralph Chang 5e9ada6859 fix: replace default compaction template to prevent purple italic rendering
Root cause: OpenCode's default compaction template uses --- separators.
When our plugin adds structured context (Memory candidates: format), the
model strictly follows the template, outputting --- at position 0. The
markdown textmate grammar treats this as YAML frontmatter, applying the
'comment' syntax scope (purple + italic in themes like palenight).

Fix: Set output.prompt in the compacting hook to replace the entire
template with a ---free version. Uses only ## Markdown headings and
explicitly forbids YAML frontmatter, horizontal rules, and delimiter
lines. Preserves context from other plugins by merging output.context.

- Replace compactionContextHeader() with buildCompactionPrompt()
- Set output.prompt instead of pushing to output.context
- Merge existing output.context from other plugins before clearing
- Add 'Instructions' section to the template (per architect review)
- Update tests: verify output.prompt, ---free format, context merging
2026-04-26 15:46:41 +08:00
Ralph Chang 721544e7a8 fix: use plain text labels instead of Markdown headers
- Changed '## Memory Candidates' to 'Memory candidates:' in compaction context
- Changed '## Pending Todos' to 'Pending todos:' in todo rendering
- Updated extractCandidateBlock() to parse plain text format (primary)
- Removed stripXmlTags() function (no longer needed)
- All 42 tests pass

Root cause: Markdown headings (##) render as purple in OpenCode UI,
same issue as XML tags and HTML comments. Plain text labels avoid
all special markup rendering.
2026-04-26 15:13:58 +08:00
Ralph Chang 9892012d8b chore: prepare for v1.2.0 release
- Bump version to 1.2.0
- Add package.json exports and files whitelist
- Update .gitignore to exclude .opencode/ and .opencode-agenthub/
- Fix docs: active files tracked in tool.execute.after (not before)
- Fix docs: exitCode undefined is ignored (not success)
- Fix docs: session ID is hashed in storage path
- Fix docs: workspace memory survives within same workspace
2026-04-26 14:17:54 +08:00
Ralph Chang 606dcfac12 docs: fix hook names and prompt tags in documentation
- Fix outdated hook names: prompt:before → experimental.chat.system.transform
- Fix outdated hook names: tool.execute.before → (removed, file tracking is in tool.execute.after)
- Fix outdated hook names: compaction:before → experimental.session.compacting
- Add missing event hook documentation
- Fix README example to show correct <hot_session_state> tag instead of <workspace_memory_candidates>
2026-04-26 13:36:49 +08:00
Ralph Chang 802ef62636 docs: update documentation to Memory V2 architecture
- Replace four-tier architecture with three-layer Memory V2
- Remove references to non-existent tools (core_memory_*, working_memory_*)
- Update storage paths to ~/.local/share/opencode-working-memory/
- Update configuration to LONG_TERM_LIMITS and HOT_STATE_LIMITS
- Fix installation verification to check system prompt instead of tools
2026-04-26 13:27:14 +08:00
Ralph Chang 2d7cb6cdf4 fix: strengthen plugin regression test with strong error signals
- Use TS2345 error instead of loose 'errors' word
- Add try/finally for temp directory cleanup
- Remove duplicate placeholder test block
- Clarify quality gate placement in parseWorkspaceMemoryCandidates()
2026-04-26 12:26:42 +08:00
Ralph Chang 9f9763c0e1 docs: add comprehensive memory plugin quality fixes plan
- PR-1: Fix bash error false positive, XML truncation, remove always trigger
- PR-2: Canonical exact dedupe, structured negative guard, quality gate
- Add executable plugin hook regression tests
- Add source priority for explicit > manual > compaction
- Define quality gate predicates with test matrix
2026-04-26 12:23:39 +08:00
Ralph Chang bb929fc578 Clean up comments, fix docs, bump to v1.0.1 2026-02-18 14:13:37 +08:00
Ralph Chang 98e5ecaa91 Fix installation: no npm install needed, OpenCode auto-installs from config 2026-02-18 11:08:09 +08:00
Ralph Chang 75c89747d8 Fix typecheck errors and update install docs for npm release 2026-02-18 10:46:03 +08:00
Ralph Chang 22cfd6ee3a Fix pressure thresholds and ASCII diagram alignment
- Corrected pressure levels: 75% (moderate) / 90% (high)
- Removed incorrect 'critical' level (95%)
- Fixed ASCII diagram alignment in README
- Updated all documentation to match actual code implementation
- Pruning modes: < 75% (normal), 75-89% (aggressive), ≥ 90% (hyper-aggressive)
2026-02-18 10:13:28 +08:00
Ralph Chang 5c7dd0f421 Update GitHub URLs: yourusername → sdwolf4103
- Updated package.json repository URLs
- Updated README.md installation and support links
- Updated docs/installation.md clone URL
- Updated AGENTS.md clone URL
2026-02-18 10:10:03 +08:00
Ralph Chang 484cb420ca Revert "Rename project: opencode-working-memory → oh-my-memory"
This reverts commit bf11c9d55c.
2026-02-18 10:06:20 +08:00
Ralph Chang bf11c9d55c Rename project: opencode-working-memory → oh-my-memory
- Updated package.json name and URLs
- Updated README.md title and references
- Updated docs/installation.md install commands
- Updated AGENTS.md project name
- Follows oh-my-opencode naming convention
2026-02-18 09:57:46 +08:00
Ralph Chang 32d5ddfb50 Initial commit: OpenCode Working Memory Plugin v1.0.0
- Four-tier memory architecture (Core, Working, Pruning, Pressure)
- Phase 1: Core Memory blocks (goal/progress/context)
- Phase 2: Smart Pruning with adaptive thresholds
- Phase 3: Working Memory with slots + pool decay
- Phase 4: Pressure monitoring with interventions
- Phase 4.5: Storage governance (session cleanup + cache sweep)
- Complete documentation (README, AGENTS, installation, architecture, configuration)
- MIT licensed
2026-02-18 09:49:09 +08:00