Skip to content

feat: pick the paper's PaperBell project when scaffolding it - #25

Merged
SongshGeo merged 1 commit into
mainfrom
dev
Aug 17, 2026
Merged

SongshGeo merged 1 commit into
mainfrom
dev

Conversation

@SongshGeo

Copy link
Copy Markdown

What

The New PaperBell paper project… modal now asks which PaperBell project the paper is a deliverable of, and writes the answer as a top-level project: key in the frontmatter of every draft index note it creates.

docs/PAPERBELL_SUITE.md has always described outputs linking back to their project via project: <acronym>, but nothing wrote it — so a paper scaffolded into 50 - Outputs carried no field naming its project, and Project Manager could not recognize it as a deliverable.

Decisions

Where Note frontmatter only — metadata.json stays pure publication metadata
Value Plain acronym (project: ColMemo), not a wikilink
No host / old host Degrades to a free-text box; no folder scanning, no new settings
Scope New-paper modal only

project (the project's acronym) and _longform.acronym (the paper's own, used for PDF filenames) are different values with different jobs; the UI labels them apart. An empty selection omits the key entirely rather than writing an empty project:.

Host integration — a proposal, inert today

The project list comes from a proposed projects scope (requestProjects(), paperbell:projects-changed, PPBProject). No shipped host implements it. It is vendored into src/paperbell/shared-config.ts and flagged there as ours, with the client methods declared optional and every caller gating on capabilities and typeof method === "function" — so it stays completely inert against the 0.4.4 host. PPB_SCHEMA_VERSION deliberately stays at 1 so the "host schema is newer than vendored" warning keeps working for a real upstream v2.

docs/PROPOSAL_PROJECTS_SCOPE.md writes it up for the host team, including the two questions that matter more than the API itself:

  1. Which frontmatter shape does Project Manager actually query? We write a plain acronym per the existing convention. If it wants [[wikilink]], changing the writer is one line — migrating users' notes is not.
  2. One paper is up to four notes, all carrying the same project:. Dedupe key is longform.title, identical across a paper's drafts.

MAINTAINING.md records the re-vendoring hazard: a straight copy from upstream, for any reason, deletes the proposal block and breaks the build.

Verification

  • 438 tests pass (22 new), lint 0 errors, production build OK.
  • Degradation paths covered by unit tests: host absent, host too old, capability missing, consent denied, ok: false, host throws.
  • test/paperbell/host-conformance.test.ts gains a block that stays skipped today and arms itself once a host bundle carrying requestProjects is installed.

Still owed (manual, needs a real vault): confirming the new top-level project: doesn't affect strip-frontmatter / pandoc export. It sits outside the longform: block and goes through the existing whole-block strip, so no impact is expected — but it hasn't been run in Obsidian.

🤖 Generated with Claude Code

PAPERBELL_SUITE.md has always described outputs linking back to their
project via `project: <acronym>`, but nothing wrote it: a paper scaffolded
into 50 - Outputs carried no field naming the project it belongs to, so
Project Manager could not recognize it as a deliverable.

The new-paper modal now asks. The answer is written as a top-level
`project:` key in the frontmatter of every draft index note it creates —
main, supplementary, response, and cover letter alike. metadata.json is
left alone; it stays pure publication metadata. Leaving the field empty
omits the key entirely, since an empty `project:` reads as a null
association to a sibling querying frontmatter.

Note that `project` (the project's acronym) and `_longform.acronym` (the
paper's own, used for PDF filenames) are different values with different
jobs; the UI labels them apart.

The field's contents come from the host when it can serve them, and from
the user otherwise. `fetchProjects()` returns null for a missing host, a
host too old to implement the call, a denied consent prompt, a host-side
error, and an empty list — all of which leave the plain text box the field
was built as. The fetch is fire-and-forget, so creating a paper never
waits on, or fails because of, PaperBell.

That host call is a proposal, not something any shipped host implements:
a `projects` scope with requestProjects(), a paperbell:projects-changed
event, and the PPBProject shape. It is vendored into shared-config.ts and
flagged there as ours, with the client methods declared optional and every
caller gating on capability + typeof — so it stays inert against the 0.4.4
host in the test vault. PPB_SCHEMA_VERSION deliberately stays at 1 so the
"host schema is newer than vendored" warning keeps working for a real
upstream v2. docs/PROPOSAL_PROJECTS_SCOPE.md writes the whole thing up for
the host team, including the two questions that matter more than the API:
which frontmatter shape Project Manager actually queries, and the fact
that one paper is up to four notes needing dedupe by longform.title.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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