Apply code + prompt review improvements, add test suite (59 tests)#1
Merged
Conversation
High: - Replace GNU sed -i with portable awk in uninstall.sh - Add npx prefix to typecheck, @types/node, package-lock.json, fix tsc - Add vitest plugin unit tests (14 tests for readTruncated, signature) - Add GitHub Actions CI pipeline Medium: - Add MAX_CHARS byte cap alongside line cap in readTruncated - Substitute ~/.config/opencode with resolved OC_DIR at install time - Add opencode v1.17+ version check in install.sh - Log read/stat errors to stderr instead of swallowing silently - Add --dry-run flag to install.sh and uninstall.sh - Add checkOrphanedFiles warning for tools/domain/ files not in index Low: - Add CHANGELOG.md - Add /ocmem-export backup command template - Add CONTRIBUTING.md - Document experimental hook dependency and minimum opencode version in plugin - Clarify .gitignore note about committing project MEMORY.md
Critical: - Shrink REMINDER to one-liner after first call (saves ~80 tokens/call) - Define entry format with good/bad examples (YYYY-MM-DD, one-sentence) - Add anti-patterns section (what NOT to record) - Narrow rule 6: confirm only for removal/content, not formatting/reorg Medium: - Add tools vs domain decision rule (when in doubt, tools/) - Optimize remember dedup to read index only, not every file - Add concrete thresholds to reorganize (30 entries, 3+ sections) - Decouple remember from specific tool API name - Add domain promotion trigger (10 entries or 50 lines) Low: - De-duplicate REMINDER in AGENTS.md (one-line plugin reference) - Trim MEMORY.md template to one-liner comment + example entry - Add conflicting memory guidance (rule 7) - Add concrete examples and usage guidance to general.md
Plugin tests (15 new): - checkOrphanedFiles: no orphans, orphans detected, missing dirs, non-md files - buildMemoryContext: empty, project-only, global-only, both, orphans in context - readTruncated: MAX_CHARS truncation edge cases - Refactored build() into exported buildMemoryContext for testability Shell integration test (30 assertions, 8 suites): - Fresh install, idempotent, --force, --dry-run - Uninstall default, --purge, --dry-run - AGENTS.md fresh/patched handling Updated CI workflow to run shell tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive improvements from two review passes covering code quality, prompt engineering, and test coverage. The plugin now has safer error handling, portable shell scripts, a CI pipeline, and 59 tests across unit and integration.
Why
Code review (H1-H4, M5-M10, L11-L16)
sed -iin uninstall.sh was GNU-only, broke on macOSnpm run typecheckfailed on fresh clone (nonode_modules, no@types/node)~/.config/opencode/, wrong forXDG_CONFIG_HOMEuserstools//domain/not in the index were invisible to the agentPrompt review (P1-P13)
Testing
Unit tests (29):
readTruncated(line/char truncation, errors),signature(mtimes, caching),checkOrphanedFiles,buildMemoryContext(project+global+orphans)Shell tests (30): Fresh install,
--force,--dry-run, uninstall default,--purge, idempotent re-install, fresh AGENTS.md patching — all in an isolated temp$HOMECI runs all three steps on push/PR.