Skip to content

feat(SUP-462): add executable module stubs for memory, ontology, secondbrain - #11

Merged
levineam merged 1 commit into
mainfrom
feat/sup-462-module-stubs
Mar 27, 2026
Merged

feat(SUP-462): add executable module stubs for memory, ontology, secondbrain#11
levineam merged 1 commit into
mainfrom
feat/sup-462-module-stubs

Conversation

@levineam

@levineam levineam commented Mar 27, 2026

Copy link
Copy Markdown
Owner

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/memorycreateMemoryRecord, validateMemoryRecord, getMemoryClasses; memory schema with 5 classes (fact/preference/decision/lesson/project-state)
  • @jarvos/ontologycreateLayer, validateEntry, getLayerDef; 6 worldview layers (higher-order/belief/prediction/core-self/goal/project)
  • @jarvos/secondbraincreateJournalEntry, 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-test CI job. Gates ci-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)

  • ✅ Decision documented: real module stubs in modules/ (npm packages, no new separate repos needed; full implementation lives in private monorepo and can be promoted when ready)
  • ✅ Public repo contains all three modules
  • ✅ New user can clone and run: node tests/modules-smoke-test.js (17/17 pass, zero deps)
  • ✅ README updated with real getting-started steps
  • ✅ starter-kit/ wired to use modules

Verification

node tests/modules-smoke-test.js
→ @jarvos/memory       6/6
→ @jarvos/ontology     6/6
→ @jarvos/secondbrain  5/5
17 checks: 17 passed, 0 failed.

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced three npm modules: @jarvos/memory (agent-state memory), @jarvos/ontology (worldview beliefs and principles), and @jarvos/secondbrain (journaling and notes management).
  • Documentation

    • Added comprehensive module documentation with architecture diagrams, API usage examples, and installation instructions.
  • Tests

    • Added smoke test for modules verification.
  • Chores

    • Updated CI/CD pipeline, test scripts, and .gitignore configuration.

… 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
@coderabbitai

coderabbitai Bot commented Mar 27, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 59be0a2d-a2ee-4165-9419-d7982173539c

📥 Commits

Reviewing files that changed from the base of the PR and between daf2303 and 59007f7.

📒 Files selected for processing (16)
  • .github/workflows/ci.yml
  • .gitignore
  • README.md
  • modules/README.md
  • modules/jarvos-memory/README.md
  • modules/jarvos-memory/package.json
  • modules/jarvos-memory/src/index.js
  • modules/jarvos-ontology/README.md
  • modules/jarvos-ontology/package.json
  • modules/jarvos-ontology/src/index.js
  • modules/jarvos-secondbrain/README.md
  • modules/jarvos-secondbrain/package.json
  • modules/jarvos-secondbrain/src/index.js
  • package.json
  • starter-kit/README.md
  • tests/modules-smoke-test.js

📝 Walkthrough

Walkthrough

This PR introduces three new npm modules (@jarvos/memory, @jarvos/ontology, @jarvos/secondbrain) with complete implementation, documentation, and test coverage. Each module defines core APIs for agent memory records, worldview ontology layers, and journalized content capture. The PR also updates CI workflows and test scripts to verify module functionality via smoke testing.

Changes

Cohort / File(s) Summary
Module Implementation (Memory)
modules/jarvos-memory/src/index.js, modules/jarvos-memory/package.json, modules/jarvos-memory/README.md
Implements memory module with createMemoryRecord, getMemoryClasses, getMemoryClassDef, and validateMemoryRecord functions. Defines five core memory classes (fact, preference, decision, lesson, project-state) and generates deterministic SHA-256-based record IDs. Includes package metadata and comprehensive documentation.
Module Implementation (Ontology)
modules/jarvos-ontology/src/index.js, modules/jarvos-ontology/package.json, modules/jarvos-ontology/README.md
Implements ontology module with createLayer, validateEntry, and getLayerDef functions. Defines layer types with required fields, generates deterministic IDs, and validates entry schema compliance. Includes package metadata and usage documentation.
Module Implementation (SecondBrain)
modules/jarvos-secondbrain/src/index.js, modules/jarvos-secondbrain/package.json, modules/jarvos-secondbrain/README.md
Implements secondbrain module with createJournalEntry, createNote, and path resolution functions. Supports environment variable configuration for journal/notes/tags directories with tilde expansion. Generates sanitized file paths and deterministic content-based IDs. Includes package metadata and environment variable documentation.
Module Documentation
modules/README.md
Adds overview documentation for all three core modules, architecture diagram showing data flow (capture → secondbrain → memory → ontology → Paperclip), and smoke test verification instructions.
Test Infrastructure
tests/modules-smoke-test.js
Comprehensive smoke-test script executing 40+ runtime checks across all three modules, validating function signatures, return structures, error handling, and schema compliance. Tracks pass/fail counts and exits with error code on failures.
Workflow & Configuration Updates
.github/workflows/ci.yml, package.json, .gitignore
Adds new modules-smoke-test CI job and updates ci-summary to depend on and report its result. Updates package.json with test:modules and test:bootstrap scripts. Adds tmp/ directory to .gitignore.
Documentation Updates
README.md, starter-kit/README.md
Adds "Modules" section to root README and starter-kit README documenting module entry points, smoke test command, and usage examples with CommonJS require() patterns.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Three sisters born beneath the warren's code,
Memory recalls, Ontology bestows,
SecondBrain captures all that flows,
Deterministic hashes light the road,
Data dances through the nodes! 📚✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/sup-462-module-stubs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@levineam
levineam merged commit e806ecf into main Mar 27, 2026
5 of 7 checks passed
@levineam
levineam deleted the feat/sup-462-module-stubs branch March 27, 2026 20:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment on lines +26 to +30
function resolveJournalDir() {
if (process.env.JARVOS_JOURNAL_DIR) {
return resolveTilde(process.env.JARVOS_JOURNAL_DIR);
}
return path.join(os.homedir(), 'Documents', 'Vault v3', 'Journal');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

1 participant