Skip to content

Document musing-ai-service in AGENTS.md and add ai-service.mdc rule - #96

Merged
danibsheehan merged 1 commit into
mainfrom
docs/ai-service-integration
Aug 30, 2026
Merged

Document musing-ai-service in AGENTS.md and add ai-service.mdc rule#96
danibsheehan merged 1 commit into
mainfrom
docs/ai-service-integration

Conversation

@danibsheehan

Copy link
Copy Markdown
Owner

Summary

`AGENTS.md` and `musing-project.mdc` had zero mention of `service/` despite it being a whole second application in this repo by now (8 merged PRs across the AI second-brain build) — any agent working here had no idea it existed, that it's a separate Node/TS backend with its own toolchain, or its conventions. This is the last item from the original architecture plan (`docs/ai-service-integration`).

  • New `.cursor/rules/ai-service.mdc` (scoped to `service/**`): the fail-fast required-env pattern, the two separately-billed/separately-budgeted providers, `requireAuth` as the real access boundary (not GCP IAM), `requireBudget` needing to gate `embed-page` too (correcting the original design doc, which only called out LLM routes), the rate limiter, the `ALLOWED_ORIGINS` comma-escaping gotcha in `deploy-service.yml`, the two locked-down pgvector RPC functions, local dev, and that `service/` needs its own lint/test/build.
  • `AGENTS.md`: intro paragraph, a Conventions table row, two new Constraints (don't assume the AI service is configured; don't assume root checks cover `service/`), a Configure pointer to `VITE_AI_SERVICE_URL`.
  • `musing-project.mdc`: thin pointer section, matching its own "don't duplicate long content" style.
  • README: `VITE_AI_SERVICE_URL` was missing from the Configuration table; `readme.mdc`'s own Configuration bullet was stale too — both fixed.

Note on `/code-review`: it surfaced two real findings, but on `SidebarSearch.tsx` — code from the already-merged #94, not part of this diff (the review scanned the whole repo since this branch has no code diff). Handling those separately, as their own fix, rather than bundling an unrelated bug fix into a docs PR.

Test plan

  • `check_stack_docs.py`, `npm run format:check` — pass
  • Docs-only change, no code paths affected

🤖 Generated with Claude Code

AGENTS.md and musing-project.mdc had zero mention of service/ despite
it being a whole second application in this repo by now (8 merged
PRs) — any agent working here had no idea it existed, that it's a
separate Node/TS backend with its own toolchain, or its conventions.

- New .cursor/rules/ai-service.mdc: scoped to service/**, covering
  the fail-fast required-env pattern, the two separately-billed/
  separately-budgeted providers, requireAuth as the real access
  boundary (not GCP IAM), requireBudget needing to gate embed-page
  too (not just LLM routes, correcting the original design doc),
  the rate limiter, the ALLOWED_ORIGINS comma-escaping gotcha in
  deploy-service.yml, the two locked-down pgvector RPC functions,
  local dev, and that service/ needs its own lint/test/build (root
  scripts don't cover it).
- AGENTS.md: intro paragraph, a Conventions table row, two new
  Constraints entries (don't assume the AI service is configured;
  don't assume root checks cover service/), and a Configure section
  pointer to VITE_AI_SERVICE_URL.
- musing-project.mdc: thin pointer section (matching its own stated
  "don't duplicate long content" style) + added to the scoped-rules
  list.
- README: VITE_AI_SERVICE_URL was missing from the Configuration
  table; readme.mdc's own Configuration bullet was stale too (didn't
  mention it) — both fixed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

PR guide

Auto-generated from changed paths. Fill in Summary and How to verify in the PR description above.

Touches: docs / agent guidance, other

Diff: 5 files changed, 93 insertions(+), 4 deletions(-)

Suggested verify

  • N/A - docs/tooling only; confirm locally if anything user-facing changed

Checklist (applies to this PR)

  • No unintended secrets or local-only config committed

Reviewer focus

  • Scope looks docs- or tooling-only; confirm there is no hidden runtime impact

Commits

  • 4f6b011 Document musing-ai-service in AGENTS.md and add ai-service.mdc rule

Files by area

Area Files
docs / agent guidance 4
other 1

CI

Primary check: CI runs lint, Prettier format check, Vitest coverage, and build for every PR. Coverage tables are posted separately.


Template: pull_request_template.md

@github-actions github-actions Bot added the area: docs Documentation or agent guidance label Aug 30, 2026
@github-actions

Copy link
Copy Markdown

Unit tests (Vitest)

File Coverage Lines Branches
All files 55% 62% 48%
src/components/DatabaseEmbedNodeView.tsx 0% 0% 0%
src/components/DatabaseTableView.tsx 0% 0% 0%
src/components/SlashMenu.tsx 72% 85% 60%
src/context/WorkspaceContext.tsx 25% 35% 14%
src/extensions/blockIdOnBlocks.ts 75% 100% 50%
src/extensions/musingDatabaseEmbed.ts 70% 90% 50%
src/extensions/singleTopLevelBlock.ts 80% 100% 60%
src/hooks/usePageIndexing.ts 95% 90% 100%
src/lib/aiClient.ts 81% 86% 76%
src/lib/blockEditorCommands.ts 42% 50% 35%
src/lib/blockPlainText.ts 55% 60% 50%
src/lib/editorBlockText.ts 13% 13% 14%
src/lib/emojiSuggestionItems.ts 93% 100% 87%
src/lib/htmlToDocx.ts 24% 31% 18%
src/lib/pageToExportHtml.ts 97% 100% 94%
src/lib/resolveWikiPage.ts 91% 100% 83%
src/lib/slashMenuOptions.ts 57% 57% 0%
src/lib/themePreference.ts 32% 25% 40%
src/lib/workspaceStorage.ts 80% 81% 80%
src/lib/pageDocument/blockGutterOps.ts 92% 100% 84%
src/lib/pageDocument/blockIdAtSelection.ts 83% 100% 66%
src/lib/pageDocument/lastBlockNeedsBelowHit.ts 91% 100% 83%
src/lib/pageDocument/serializeDocToBlocks.ts 58% 69% 47%
src/lib/pageDocument/slashMenuDeleteRange.ts 82% 95% 70%
src/lib/pageDocument/tryDeleteEmptyTopLevelBlock.ts 87% 94% 81%

Minimum allowed coverage is 0%

Generated by 🐒 cobertura-action against 4f6b011

@danibsheehan
danibsheehan merged commit 557c4f5 into main Aug 30, 2026
8 checks passed
@danibsheehan
danibsheehan deleted the docs/ai-service-integration branch August 30, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Documentation or agent guidance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant