Skip to content

feat(journal): Discord !journal sessions → encrypted ShadowNote write-back - #438

Draft
nolanmak wants to merge 1 commit into
shadownote-ingestfrom
shadownote-discord-journal
Draft

feat(journal): Discord !journal sessions → encrypted ShadowNote write-back#438
nolanmak wants to merge 1 commit into
shadownote-ingestfrom
shadownote-discord-journal

Conversation

@nolanmak

Copy link
Copy Markdown
Owner

Closes #428, documents #429 (the /loop cron prompts, docs/journaling.md). Part of epic #425 (Phase 3 — write path). Stacked on #437 (base shadownote-ingest); retarget after it merges.

What's in it

  • JournalOps trait in approval-discord (the InvoiceOps pattern): grammar + dispatch live in the discord crate, the cli implements the encrypt/AppSync/wiki plumbing — no AWS deps in the discord crate, no circular dep.
  • !journal grammar (journal_cmd.rs, pure + unit-tested): !journal <text> verbatim save; !journal done [title] composes from the recent conversation via fetch_conversation_context (no new session state machine); !journal/help usage; !journals… correctly not matched.
  • Compose (compose.rs in the journal crate): no-tools Haiku call — first-person entry from the user's own statements only, TITLE: line + <p> HTML; tolerant parser wraps bare text if the model ignores the format.
  • CliJournalOps: compose → KMS GenerateDataKey → CryptoJS-format encrypt → createEntry (renders in the app like a hand-written entry) → immediate spawn_ingest(IngestTrigger::Journal). Failure replies always include the entry text — a failed save never loses what you wrote. Unconfigured boxes get an honest notice and the daemon is otherwise untouched.
  • docs/journaling.md — the three /loop cron prompts (morning/evening/weekly review, Phase 0: morning/night/weekly journaling prompts via /loop crons (config only) #429), !journal usage, config keys.

Testing

  • cargo test -p: approval-discord 118, journal 31 — green (grammar, compose parsing, escaping).
  • cargo build -p augmentagent-cli clean.
  • Verify-gate receipt at .claude/agent-test-receipts/abbed4d….txt is explicit about what was NOT exercised: a live !journal DM needs the AWS actionables (nolanmak/ShadowNoteReborn#20) plus an owner-sent DM. Post-config checklist before merge: send !journal test entry → expect 📓 confirmation, entry visible in the ShadowNote app, wiki ingest fired. Then !journal done after a morning-prompt conversation.

…e-back (#428)

Write path for the ShadowNote integration (epic #425), stacked on #437:

- approval-discord: JournalOps trait (InvoiceOps pattern — grammar +
  dispatch here, AWS/encrypt plumbing in the cli, no aws deps in this
  crate); pure parse_journal_command (!journal / done [title] / <text>)
  with unit tests; event_handler branch mirrors !invoice and runs the
  slow path off the event loop. Ops absent -> honest not-configured
  reply, nothing saved.
- journal crate: compose module — no-tools Haiku opts + system prompt
  (first-person entry from conversation, TITLE: line + <p> HTML),
  text_to_paragraphs escaping/wrapping, tolerant output parser.
- cli: CliJournalOps — compose (for done) -> KMS GenerateDataKey ->
  CryptoJS-format encrypt -> createEntry (entry renders in the app),
  then immediate spawn_ingest(IngestTrigger::Journal) so wiki-ask sees
  it before the next poller pass. Every failure reply carries the entry
  text back so a failed save never loses what the user wrote.
- docs/journaling.md: /loop cron prompts (#429) + !journal usage +
  config keys.

cargo test: approval-discord 118, journal 31 — green. Live !journal DM
exercise pending the AWS actionables (ShadowNoteReborn#20); receipt
documents exactly what was and wasn't exercised.
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ecfbd1e6-6e67-4405-93f6-3ea69e3c36f6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch shadownote-discord-journal

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.

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