feat(SUP-462): add executable module stubs for memory, ontology, secondbrain - #11
Conversation
… jarvOS modules Adds three executable npm modules to the public jarvOS repo so users get real software they can run, not just templates. Modules added (modules/): - @jarvos/memory — memory schema, createMemoryRecord, validateMemoryRecord - @jarvos/ontology — belief/goal/prediction layer, createLayer, validateEntry - @jarvos/secondbrain — journal/note creation, env-aware path resolution All three modules: - Zero external dependencies (Node.js stdlib only) - Env-var path resolution (JARVOS_JOURNAL_DIR, JARVOS_NOTES_DIR, etc.) - Standalone package.json (npm-installable) - README with quick start, interface docs, and boundary table Smoke test (tests/modules-smoke-test.js): - 17 checks covering all three modules - Runs in CI without any install step - Proves modules load, produce valid output, reject bad input CI wiring (.github/workflows/ci.yml): - New 'modules-smoke-test' job runs node tests/modules-smoke-test.js - Added to ci-summary needs so it gates PR merges README: - New 'Modules: the software that actually runs' section - Quick start showing all three module APIs - Content/execution flow diagram starter-kit/README.md: - Added 'Modules' section with usage examples package.json: - test script now runs both smoke tests (bootstrap + modules) - Added test:modules and test:bootstrap aliases Decision (SUP-462 done criteria): - Approach: real module stubs in modules/ dir (npm packages, no separate repos needed) - All three modules present and referenced - New user can clone and run: node tests/modules-smoke-test.js (17/17 pass) - README updated with real getting-started steps - starter-kit wired to use modules
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (16)
📝 WalkthroughWalkthroughThis PR introduces three new npm modules ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 59007f7c05
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return { | ||
| layer, | ||
| id, | ||
| ...fields, |
There was a problem hiding this comment.
Preserve generated layer/id when building ontology entries
createLayer spreads fields after assigning layer and id, so caller-supplied fields.layer or fields.id silently overwrite the module’s generated identity values. This makes it easy to create inconsistent or forged entries (for example, createLayer('belief', { layer: 'goal', id: 'manual' })), which breaks the function’s contract and can corrupt downstream ontology data that assumes layer/id are trusted.
Useful? React with 👍 / 👎.
| */ | ||
| function createNote(params = {}) { | ||
| const now = new Date(); | ||
| const title = String(params.title || 'Untitled').trim(); |
There was a problem hiding this comment.
Restore fallback title for whitespace-only note names
createNote trims the provided title but does not re-apply the fallback after trimming, so input like ' ' produces an empty title. When that value is passed to notePath, the filename becomes .md, which is a hidden file on Unix and causes collisions/overwrites for multiple untitled notes.
Useful? React with 👍 / 👎.
| function resolveJournalDir() { | ||
| if (process.env.JARVOS_JOURNAL_DIR) { | ||
| return resolveTilde(process.env.JARVOS_JOURNAL_DIR); | ||
| } | ||
| return path.join(os.homedir(), 'Documents', 'Vault v3', 'Journal'); |
There was a problem hiding this comment.
Read jarvos.config.json before using hardcoded journal path
When JARVOS_JOURNAL_DIR is unset, resolveJournalDir immediately returns a hardcoded ~/Documents/Vault v3/Journal path instead of checking jarvos.config.json, even though the module advertises env var → jarvos.config.json → default resolution. In bootstrapped setups with a custom vault location, this resolves to the wrong directory unless users manually set env vars every run.
Useful? React with 👍 / 👎.
Summary
Addresses SUP-462: "jarvos public repo: include or reference module code so users get working software"
Previously the public repo had zero executable code — just docs and templates. This PR adds three real npm modules plus a smoke test that proves they work.
Changes
modules/ (new directory)
@jarvos/memory—createMemoryRecord,validateMemoryRecord,getMemoryClasses; memory schema with 5 classes (fact/preference/decision/lesson/project-state)@jarvos/ontology—createLayer,validateEntry,getLayerDef; 6 worldview layers (higher-order/belief/prediction/core-self/goal/project)@jarvos/secondbrain—createJournalEntry,createNote, path helpers with env-aware resolution (JARVOS_JOURNAL_DIR,JARVOS_NOTES_DIR, etc.)All modules: zero external dependencies, standalone
package.json, full README.tests/modules-smoke-test.js (new)
17 checks across all three modules. Runs clean without any install step.
.github/workflows/ci.yml
New
modules-smoke-testCI job. Gatesci-summary.README.md
New "Modules: the software that actually runs" section with quick-start, API examples, content/execution flow diagram.
starter-kit/README.md + package.json
Wired to reference modules with usage examples.
Decision (SUP-462 done criteria)
modules/(npm packages, no new separate repos needed; full implementation lives in private monorepo and can be promoted when ready)node tests/modules-smoke-test.js(17/17 pass, zero deps)Verification
Summary by CodeRabbit
Release Notes
New Features
@jarvos/memory(agent-state memory),@jarvos/ontology(worldview beliefs and principles), and@jarvos/secondbrain(journaling and notes management).Documentation
Tests
Chores