@openparachute/vault 0.7.3-rc.3 → 0.7.3-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,7 +20,10 @@
20
20
 
21
21
  import { describe, test, expect } from "bun:test";
22
22
  import {
23
+ ALL_NOTES_VIEW_PATH,
23
24
  applySeedPack,
25
+ ARCHIVE_VIEW_PATH,
26
+ ARCHIVED_TAG,
24
27
  CAPTURE_ANYTHING_PATH,
25
28
  CONNECT_AI_PATH,
26
29
  DEFAULT_VAULT_DESCRIPTION,
@@ -33,11 +36,17 @@ import {
33
36
  GUIDE_TAG,
34
37
  listSeedPacks,
35
38
  NOTES_REQUIRED_TAGS,
39
+ PINNED_TAG,
40
+ PINNED_VIEW_PATH,
41
+ RECENT_VIEW_PATH,
36
42
  SEED_PACK_NAMES,
43
+ STARTER_ONTOLOGY_PACK,
37
44
  SURFACE_STARTER_CONTENT,
38
45
  SURFACE_STARTER_PACK,
39
46
  SURFACE_STARTER_PATH,
40
47
  TAGS_GRAPH_PATH,
48
+ VIEW_TAG,
49
+ VIEWS_PATH_PREFIX,
41
50
  WELCOME_PATH,
42
51
  welcomePack,
43
52
  YOURS_TO_KEEP_PATH,
@@ -335,12 +344,119 @@ describe("surface-starter pack", () => {
335
344
  });
336
345
  });
337
346
 
347
+ describe("starter-ontology pack", () => {
348
+ test("exactly four tags, in constitution order: view, archived, pinned, capture", () => {
349
+ expect(STARTER_ONTOLOGY_PACK.name).toBe("starter-ontology");
350
+ expect(STARTER_ONTOLOGY_PACK.tags.map((t) => t.name)).toEqual([
351
+ "view",
352
+ "archived",
353
+ "pinned",
354
+ "capture",
355
+ ]);
356
+ });
357
+
358
+ test("opt-in, not seeded by default", () => {
359
+ expect(STARTER_ONTOLOGY_PACK.description).toContain("Opt-in — not seeded by default.");
360
+ });
361
+
362
+ test("view is the one meta tag — carries the kind/query/lane_by/date_field schema", () => {
363
+ expect(VIEW_TAG.name).toBe("view");
364
+ expect(VIEW_TAG.description).toContain("meta tag");
365
+ expect(VIEW_TAG.fields).toBeDefined();
366
+ expect(Object.keys(VIEW_TAG.fields!)).toEqual([
367
+ "kind",
368
+ "query",
369
+ "lane_by",
370
+ "date_field",
371
+ ]);
372
+
373
+ const kind = VIEW_TAG.fields!.kind!;
374
+ expect(kind.type).toBe("string");
375
+ expect(kind.enum).toEqual(["list", "board", "calendar", "gallery"]);
376
+ expect(kind.default).toBe("list");
377
+
378
+ const query = VIEW_TAG.fields!.query!;
379
+ expect(query.type).toBe("string");
380
+
381
+ // lane_by / date_field are optional (no default — absent stays absent).
382
+ expect(VIEW_TAG.fields!.lane_by!.default).toBeUndefined();
383
+ expect(VIEW_TAG.fields!.date_field!.default).toBeUndefined();
384
+ });
385
+
386
+ test("archived + pinned are plain tags — no schema", () => {
387
+ expect(ARCHIVED_TAG.name).toBe("archived");
388
+ expect(ARCHIVED_TAG.fields).toBeUndefined();
389
+ expect(ARCHIVED_TAG.description).toContain("out of the flow of the present");
390
+
391
+ expect(PINNED_TAG.name).toBe("pinned");
392
+ expect(PINNED_TAG.fields).toBeUndefined();
393
+ expect(PINNED_TAG.description).toContain("partition");
394
+ });
395
+
396
+ test("capture is reused verbatim from NOTES_REQUIRED_TAGS — byte-equal, no drift risk", () => {
397
+ const capture = STARTER_ONTOLOGY_PACK.tags.find((t) => t.name === "capture");
398
+ expect(capture).toBe(NOTES_REQUIRED_TAGS[0]); // SAME object reference, not just equal content
399
+ expect(capture!.description).toBe(NOTES_REQUIRED_TAGS[0]!.description);
400
+ });
401
+
402
+ test("four seed #view notes mirroring the app's default pages", () => {
403
+ expect(STARTER_ONTOLOGY_PACK.notes.map((n) => n.path)).toEqual([
404
+ ALL_NOTES_VIEW_PATH,
405
+ RECENT_VIEW_PATH,
406
+ PINNED_VIEW_PATH,
407
+ ARCHIVE_VIEW_PATH,
408
+ ]);
409
+ for (const note of STARTER_ONTOLOGY_PACK.notes) {
410
+ expect(note.path.startsWith(VIEWS_PATH_PREFIX)).toBe(true);
411
+ expect(note.tags).toEqual(["view"]);
412
+ expect(note.metadata?.kind).toBe("list");
413
+ expect(typeof note.metadata?.query).toBe("string");
414
+ // Every seeded query must itself be valid JSON — a downstream reader
415
+ // parses it as query-notes params.
416
+ expect(() => JSON.parse(note.metadata!.query as string)).not.toThrow();
417
+ }
418
+ });
419
+
420
+ test("All notes / Recent exclude archived explicitly (authoring-time default, not magic)", () => {
421
+ for (const path of [ALL_NOTES_VIEW_PATH, RECENT_VIEW_PATH]) {
422
+ const note = noteAt(STARTER_ONTOLOGY_PACK, path);
423
+ const query = JSON.parse(note.metadata!.query as string);
424
+ expect(query.exclude_tags).toEqual(["archived"]);
425
+ }
426
+ });
427
+
428
+ test("Recent orders by updated_at desc", () => {
429
+ const query = JSON.parse(noteAt(STARTER_ONTOLOGY_PACK, RECENT_VIEW_PATH).metadata!.query as string);
430
+ expect(query.order_by).toBe("updated_at");
431
+ expect(query.sort).toBe("desc");
432
+ });
433
+
434
+ test("Pinned queries tag:pinned; Archive queries tag:archived (the deliberate exception to exclude_tags)", () => {
435
+ const pinnedQuery = JSON.parse(noteAt(STARTER_ONTOLOGY_PACK, PINNED_VIEW_PATH).metadata!.query as string);
436
+ expect(pinnedQuery.tag).toBe("pinned");
437
+
438
+ const archiveQuery = JSON.parse(noteAt(STARTER_ONTOLOGY_PACK, ARCHIVE_VIEW_PATH).metadata!.query as string);
439
+ expect(archiveQuery.tag).toBe("archived");
440
+ expect(archiveQuery.exclude_tags).toBeUndefined();
441
+ });
442
+
443
+ test("no dangling wikilinks within the pack", () => {
444
+ const seededPaths = new Set(STARTER_ONTOLOGY_PACK.notes.map((n) => n.path));
445
+ for (const note of STARTER_ONTOLOGY_PACK.notes) {
446
+ for (const target of wikilinkTargets(note.content)) {
447
+ expect(seededPaths.has(target)).toBe(true);
448
+ }
449
+ }
450
+ });
451
+ });
452
+
338
453
  describe("pack registry", () => {
339
- test("lists exactly the three packs, in order", () => {
454
+ test("lists exactly the four packs, in order", () => {
340
455
  expect([...SEED_PACK_NAMES]).toEqual([
341
456
  "welcome",
342
457
  "getting-started",
343
458
  "surface-starter",
459
+ "starter-ontology",
344
460
  ]);
345
461
  expect(listSeedPacks().map((p) => p.name)).toEqual([...SEED_PACK_NAMES]);
346
462
  for (const p of listSeedPacks()) {
@@ -14,6 +14,13 @@
14
14
  * surface (UI) over the vault. NOT default-seeded (ratified 2026-07-02:
15
15
  * Surface Starter is out of the default seed) — added on demand via
16
16
  * `parachute-vault add-pack surface-starter` or a console affordance.
17
+ * - `starter-ontology` — four starter **meta tags** (`view`, `archived`,
18
+ * `pinned`, `capture`) with constitution-style descriptions, plus seed
19
+ * `#view` notes mirroring the app's default pages (All notes, Recent,
20
+ * Pinned, Archive). NOT default-seeded (ratified 2026-07-16 design
21
+ * dialogue — deliberately opt-in; a fresh-vault materialization change
22
+ * needs its own decision) — added on demand via `parachute-vault
23
+ * add-pack starter-ontology` or a console affordance.
17
24
  *
18
25
  * Guides are the vault's skill files — the Parachute equivalent of a
19
26
  * `SKILL.md`. They're tagged `#guide` (GUIDE_TAG): notes that teach how this
@@ -798,6 +805,172 @@ export const SURFACE_STARTER_PACK: SeedPack = {
798
805
  ],
799
806
  };
800
807
 
808
+ // ---------------------------------------------------------------------------
809
+ // `starter-ontology` pack — four starter meta tags (opt-in)
810
+ // ---------------------------------------------------------------------------
811
+
812
+ /**
813
+ * The starter ontology, ratified in the 2026-07-16 design dialogue (Letter 1,
814
+ * Q5: "yes — tiny, opinionated, removable"): exactly four tags, no more.
815
+ * "Really want to start simple" / "don't be too prescriptive" — the vault
816
+ * ships the mechanisms; each parachute writes its own rules on top.
817
+ *
818
+ * A **meta tag** (the ratified user-facing term for "a tag with a schema")
819
+ * is `view` alone here — it carries `fields`. `archived`, `pinned`, and
820
+ * `capture` are plain tags: no schema, just a description that teaches the
821
+ * convention. Every description below is written as a constitution — it's
822
+ * read by both a human deciding whether to use the tag and an agent deciding
823
+ * how to behave around it — plain and warm, describing the DEFAULT
824
+ * convention rather than dictating one ("different people will draw that
825
+ * line differently").
826
+ *
827
+ * `capture` is NOT redeclared with new text — it's the exact `NOTES_REQUIRED_TAGS`
828
+ * entry, reused verbatim, because notes-ui's connect-time schema audit
829
+ * compares its `description` byte-for-byte (see the comment on
830
+ * `NOTES_REQUIRED_TAGS` above). Applying this pack must never be able to
831
+ * drift that string out from under the welcome pack, in either apply order.
832
+ *
833
+ * `pinned` shipped once before and was dropped as vestigial (PR #547,
834
+ * 2026-07-07): it was seeded onto `Welcome` with old sort-first semantics,
835
+ * which did nothing visible on a fresh vault (the Notes app had no list
836
+ * badge, and Welcome was already first). This is a different tag: the
837
+ * ratified semantics are partition-not-sort, it isn't stamped onto any
838
+ * existing note, and the pack ships a `Pinned` view that actually surfaces
839
+ * it.
840
+ */
841
+ export const VIEW_TAG: SeedPackTag = {
842
+ name: "view",
843
+ description:
844
+ 'A meta tag — it carries a schema, which is what makes a #view note a saved view rather than just a label. Tag a note #view and its metadata becomes the definition: `query` is the saved query itself (the same JSON shape query-notes accepts — tag, exclude_tags, search, metadata, order_by, ...), and `kind` says how to render the result (list, board, calendar, or gallery; an unrecognized or missing kind should degrade to list rather than fail — a view is never wrong to render as a list). `lane_by` names the metadata field a board\'s lanes come from; `date_field` names the date-typed field a calendar plots against — both only meaningful for their matching `kind`, and unset otherwise. The note\'s body is for people: what this view is for, when to reach for it. Because the definition lives in the vault as an ordinary note, any surface can read it and render the same view, and any agent can write one — "make me a board of my active drafts" is just creating a note. Authoring convention worth keeping: most views should write `exclude_tags: ["archived"]` into their own query rather than leaning on some surface-side default — an Archive view is the deliberate exception.',
845
+ fields: {
846
+ kind: {
847
+ type: "string",
848
+ description:
849
+ "How to render this view. Unrecognized or absent degrades to list — a view is never wrong to render as a list.",
850
+ enum: ["list", "board", "calendar", "gallery"],
851
+ default: "list",
852
+ },
853
+ query: {
854
+ type: "string",
855
+ description:
856
+ "The saved query — a JSON string of query-notes parameters (tag, exclude_tags, search, metadata, order_by, sort, ...). This is what actually determines which notes the view shows; kind only says how to draw them.",
857
+ },
858
+ lane_by: {
859
+ type: "string",
860
+ description:
861
+ "Board views only: the metadata field whose distinct values become the board's lanes/columns. Unset outside kind: board.",
862
+ },
863
+ date_field: {
864
+ type: "string",
865
+ description:
866
+ "Calendar views only: the date-typed metadata field the calendar plots notes against. Unset outside kind: calendar.",
867
+ },
868
+ },
869
+ };
870
+
871
+ export const ARCHIVED_TAG: SeedPackTag = {
872
+ name: "archived",
873
+ description:
874
+ "A plain tag — no schema, just a convention: this note is out of the flow of the present. Not deleted, not wrong, just done, closed, or set aside for now. The one behavior worth relying on: default views exclude archived notes unless a view's own query says otherwise (an Archive view, for instance, asks for them back on purpose). Archiving a note doesn't touch its content, tags, or links — it only changes whether it shows up by default. What actually gets archived, and when, is yours to decide: a finished project, last month's drafts, a conversation that's resolved. Different people will draw that line differently, and that's fine — the tag only promises the one thing above.",
875
+ };
876
+
877
+ export const PINNED_TAG: SeedPackTag = {
878
+ name: "pinned",
879
+ description:
880
+ "A plain tag — no schema, just a convention: this note gets surfaced first. Pinning is a partition, not a sort — a view that honors it renders pinned notes as their own small group above everything else, rather than nudging them up the existing order. That also means pinning doesn't fight with however the rest of a view is sorted; it just carves out a \"see this first\" spot above it. There's no built-in limit on how many notes can be pinned, and no rule about what belongs there — a current focus, something you keep needing to find, a note you're mid-thought on. Unpin by removing the tag. Different people, and different views, will use it differently; the tag only promises the placement, not the policy.",
881
+ };
882
+
883
+ export const VIEWS_PATH_PREFIX = "Views/";
884
+ export const ALL_NOTES_VIEW_PATH = `${VIEWS_PATH_PREFIX}All notes`;
885
+ export const RECENT_VIEW_PATH = `${VIEWS_PATH_PREFIX}Recent`;
886
+ export const PINNED_VIEW_PATH = `${VIEWS_PATH_PREFIX}Pinned`;
887
+ export const ARCHIVE_VIEW_PATH = `${VIEWS_PATH_PREFIX}Archive`;
888
+
889
+ /**
890
+ * Build the `starter-ontology` pack: the four meta tags above, plus four
891
+ * seed `#view` notes mirroring the app's default pages — All notes, Recent,
892
+ * Pinned, Archive — so "default app pages are shipped views" has its data
893
+ * half from day one. Each view's `query` is written out explicitly
894
+ * (`exclude_tags: ["archived"]` where it applies) rather than relying on any
895
+ * surface-side default, per the authoring convention in `VIEW_TAG`'s own
896
+ * description. Kept tiny on purpose — these are starting points, not a
897
+ * demonstration of everything the schema can do.
898
+ *
899
+ * NOT applied by `src/onboarding-seed.ts`'s default materialization — opt-in
900
+ * only, via `parachute-vault add-pack starter-ontology` or a console
901
+ * affordance. A fresh-vault UX change (making this part of the default seed)
902
+ * is a separate decision; this pack existing makes that a one-line flip
903
+ * later, deliberately not taken here.
904
+ */
905
+ export const STARTER_ONTOLOGY_PACK: SeedPack = {
906
+ name: "starter-ontology",
907
+ description:
908
+ "The starter ontology: one meta tag (view, with a schema) and three plain tags (archived, pinned, capture), each with a constitution-style description — plus four seed #view notes (All notes, Recent, Pinned, Archive) mirroring the app's default pages. Opt-in — not seeded by default.",
909
+ // `capture` reused verbatim from NOTES_REQUIRED_TAGS (byte-equal to the
910
+ // welcome pack's — see the module doc above and NOTES_REQUIRED_TAGS'
911
+ // comment). Order matches the constitution ordering, not upsert order.
912
+ tags: [VIEW_TAG, ARCHIVED_TAG, PINNED_TAG, ...NOTES_REQUIRED_TAGS],
913
+ notes: [
914
+ {
915
+ path: ALL_NOTES_VIEW_PATH,
916
+ tags: ["view"],
917
+ content: `# All notes
918
+
919
+ Everything in the vault except what's archived. The default view — no tag
920
+ filter, no sort override, just the whole thing minus the notes you've set
921
+ aside.
922
+ `,
923
+ metadata: {
924
+ kind: "list",
925
+ query: JSON.stringify({ exclude_tags: ["archived"] }),
926
+ },
927
+ },
928
+ {
929
+ path: RECENT_VIEW_PATH,
930
+ tags: ["view"],
931
+ content: `# Recent
932
+
933
+ The vault, newest edits first. Same notes as [[${ALL_NOTES_VIEW_PATH}]] —
934
+ archived excluded — just ordered by when they last changed.
935
+ `,
936
+ metadata: {
937
+ kind: "list",
938
+ query: JSON.stringify({
939
+ exclude_tags: ["archived"],
940
+ order_by: "updated_at",
941
+ sort: "desc",
942
+ }),
943
+ },
944
+ },
945
+ {
946
+ path: PINNED_VIEW_PATH,
947
+ tags: ["view"],
948
+ content: `# Pinned
949
+
950
+ Whatever you've marked #pinned — the notes surfaced first, regardless of how
951
+ anything else in the vault is organized.
952
+ `,
953
+ metadata: {
954
+ kind: "list",
955
+ query: JSON.stringify({ tag: "pinned" }),
956
+ },
957
+ },
958
+ {
959
+ path: ARCHIVE_VIEW_PATH,
960
+ tags: ["view"],
961
+ content: `# Archive
962
+
963
+ Everything tagged #archived — out of the flow of the present, but never
964
+ gone. The one view that asks archived notes back on purpose.
965
+ `,
966
+ metadata: {
967
+ kind: "list",
968
+ query: JSON.stringify({ tag: "archived" }),
969
+ },
970
+ },
971
+ ],
972
+ };
973
+
801
974
  // ---------------------------------------------------------------------------
802
975
  // Registry
803
976
  // ---------------------------------------------------------------------------
@@ -807,6 +980,7 @@ export const SEED_PACK_NAMES = [
807
980
  "welcome",
808
981
  "getting-started",
809
982
  "surface-starter",
983
+ "starter-ontology",
810
984
  ] as const;
811
985
 
812
986
  export type SeedPackName = (typeof SEED_PACK_NAMES)[number];
@@ -835,6 +1009,8 @@ export function getSeedPack(
835
1009
  return GETTING_STARTED_PACK;
836
1010
  case "surface-starter":
837
1011
  return SURFACE_STARTER_PACK;
1012
+ case "starter-ontology":
1013
+ return STARTER_ONTOLOGY_PACK;
838
1014
  default:
839
1015
  return null;
840
1016
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openparachute/vault",
3
- "version": "0.7.3-rc.3",
3
+ "version": "0.7.3-rc.4",
4
4
  "description": "Agent-native knowledge graph. Notes, tags, links over MCP.",
5
5
  "module": "src/cli.ts",
6
6
  "type": "module",