@creator-notes/cnotes 0.107.14 → 0.108.0
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.
- package/.claude-plugin/plugin.json +1 -1
- package/dist/commands/notes.js +54 -5
- package/dist/commands/types.js +126 -0
- package/dist/lib/decision-citation.js +1 -1
- package/dist/lib/note-dimensions.js +74 -0
- package/dist/lib/themes.js +1 -0
- package/dist/lib/type-dimensions.js +46 -0
- package/package.json +1 -1
- package/skills/cnotes/SKILL.md +3 -3
- package/skills/cnotes/references/notes.md +43 -0
package/dist/commands/notes.js
CHANGED
|
@@ -5,7 +5,7 @@ import { parseJsonOption, readFileSafe } from "../lib/fs-utils.js";
|
|
|
5
5
|
import { outputJson, outputTable, outputQuiet, timeAgo, truncate } from "../lib/output.js";
|
|
6
6
|
import { readHeadlineWarnings, reportHeadlineWarnings } from "../lib/headline-warnings.js";
|
|
7
7
|
import { resolveNoteId } from "../lib/resolve-note.js";
|
|
8
|
-
import {
|
|
8
|
+
import { formatNoteDimensionLines, parseDimensionFilter, readNoteDimensions } from "../lib/note-dimensions.js";
|
|
9
9
|
import { formatLinkedItemHeading, groupLinkedByRelation, parseExpandArgs, projectExpandPayload, renderExpandContentOnly, } from "../lib/expand-notes.js";
|
|
10
10
|
import { lintMentionMarkdown, describeUnresolvedMentions, lintNarratedVerbMentions, lintPlainTextDisplayIdsBatch, hasGenericMention, fetchRelationshipTypeOptions, } from "../lib/mention-lint.js";
|
|
11
11
|
import { attachRubricsToResults, loadRubricMap, rubricsForTypes, } from "../lib/rubrics.js";
|
|
@@ -24,12 +24,22 @@ export function registerNotesCommands(program) {
|
|
|
24
24
|
.option("--pinned", "Only show pinned notes")
|
|
25
25
|
.option("--no-canvas", "Only notes that are on no canvas at all, at most 500 per list (combines with --type, --tags, --limit)")
|
|
26
26
|
.option("--limit <n>", "Maximum number of results", "20")
|
|
27
|
+
.option("--dimension <key=state>", "Notes of --type by a dimension's reading, e.g. answered=open")
|
|
28
|
+
.option("--open", "Questions no live answer link answers yet (same as --type Question --dimension answered=open)")
|
|
29
|
+
.option("--answered", "Questions a live answer link answers (same as --type Question --dimension answered=answered)")
|
|
30
|
+
.option("--needs-me", "Open Questions whose \"Whose call\" heading names you (implies --type Question)")
|
|
27
31
|
.addHelpText("after", `
|
|
28
32
|
Examples:
|
|
29
33
|
$ cnotes notes list --type Insight --limit 5
|
|
30
34
|
$ cnotes notes list --search "auth flow" --json
|
|
31
35
|
$ cnotes notes list --fields displayId,title,type --json
|
|
32
36
|
$ cnotes notes list --no-canvas --type Decision --limit 50 # never made it onto a canvas
|
|
37
|
+
$ cnotes notes list --needs-me # Questions still waiting on you
|
|
38
|
+
|
|
39
|
+
Dimensions are readings from live links, declared per type: a Question is
|
|
40
|
+
answered when a link joins it to its answer ([QUESTION-12: Title](relationship:answers)
|
|
41
|
+
on that note, or answered-by on the Question). Write that link whenever a note
|
|
42
|
+
settles a Question. \`notes get\` prints each dimension under the title.
|
|
33
43
|
`)
|
|
34
44
|
.action(async (opts) => {
|
|
35
45
|
const cfg = resolveConfig(program.opts());
|
|
@@ -40,13 +50,44 @@ Examples:
|
|
|
40
50
|
if (notOnCanvas && (opts.search || opts.pinned)) {
|
|
41
51
|
throw new ValidationError("--no-canvas combines with --type, --tags and --limit, not --search or --pinned.");
|
|
42
52
|
}
|
|
53
|
+
const shortcuts = [opts.open, opts.answered, opts.needsMe].filter(Boolean).length;
|
|
54
|
+
if (opts.open && opts.answered) {
|
|
55
|
+
throw new ValidationError("Pass --open or --answered, not both.");
|
|
56
|
+
}
|
|
57
|
+
if (opts.answered && opts.needsMe) {
|
|
58
|
+
throw new ValidationError("--needs-me lists open Questions; it does not combine with --answered.");
|
|
59
|
+
}
|
|
60
|
+
if (shortcuts > 0 && opts.dimension) {
|
|
61
|
+
throw new ValidationError("--open, --answered and --needs-me are shortcuts for --dimension; pass one or the other.");
|
|
62
|
+
}
|
|
63
|
+
if (shortcuts > 0 && opts.type && opts.type !== "Question") {
|
|
64
|
+
throw new ValidationError("--open, --answered and --needs-me list Questions only; drop --type or pass --type Question.");
|
|
65
|
+
}
|
|
66
|
+
let dimension;
|
|
67
|
+
if (opts.dimension) {
|
|
68
|
+
const [key, state] = parseDimensionFilter(String(opts.dimension));
|
|
69
|
+
if (!key || !state)
|
|
70
|
+
throw new ValidationError("--dimension takes key=state, e.g. --dimension answered=open.");
|
|
71
|
+
if (!opts.type)
|
|
72
|
+
throw new ValidationError("--dimension filters one type; pass --type too.");
|
|
73
|
+
dimension = [key, state];
|
|
74
|
+
}
|
|
75
|
+
else if (opts.open || opts.needsMe) {
|
|
76
|
+
dimension = ["answered", "open"];
|
|
77
|
+
}
|
|
78
|
+
else if (opts.answered) {
|
|
79
|
+
dimension = ["answered", "answered"];
|
|
80
|
+
}
|
|
43
81
|
const params = {
|
|
44
82
|
workspaceId: cfg.workspaceId,
|
|
45
83
|
notOnCanvas: notOnCanvas ? "true" : undefined,
|
|
46
84
|
// The server applies the limit for this scan, so ask for what will show.
|
|
47
85
|
limit: notOnCanvas ? String(parseInt(opts.limit, 10) || 20) : undefined,
|
|
48
86
|
search: opts.search,
|
|
49
|
-
types: opts.type,
|
|
87
|
+
types: shortcuts > 0 ? "Question" : opts.type,
|
|
88
|
+
dimension: dimension?.[0],
|
|
89
|
+
state: dimension?.[1],
|
|
90
|
+
waitsOnMe: opts.needsMe ? "true" : undefined,
|
|
50
91
|
tags: opts.tags,
|
|
51
92
|
onlyPinned: opts.pinned ? "true" : undefined,
|
|
52
93
|
excludeDrafts: "true",
|
|
@@ -64,6 +105,12 @@ Examples:
|
|
|
64
105
|
else if (truncated === "scan") {
|
|
65
106
|
console.error("Stopped early: more notes on no canvas may exist. Narrow the list with --type or --tags to see them.");
|
|
66
107
|
}
|
|
108
|
+
else if (truncated === "dimension-limit") {
|
|
109
|
+
console.error("Checked 500 notes, the most one list reads; others of this type were not checked. Narrow it with --tags to see the rest.");
|
|
110
|
+
}
|
|
111
|
+
else if (truncated === "dimension-links") {
|
|
112
|
+
console.error("Some notes have more links than one read covers, so a match may be missing. Check a note with `cnotes notes get`.");
|
|
113
|
+
}
|
|
67
114
|
// The server caps results (and ignores `limit` when a search/type
|
|
68
115
|
// filter is active), so apply the requested limit here. This also
|
|
69
116
|
// fixes the JSON path, which previously emitted the entire result
|
|
@@ -1188,9 +1235,11 @@ function printNote(note, version) {
|
|
|
1188
1235
|
const archivedAt = note.archivedAt;
|
|
1189
1236
|
console.log(`Archived: ${archivedAt ? timeAgo(archivedAt) : "yes"}`);
|
|
1190
1237
|
}
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1238
|
+
// What the note is linked to under its type's declared dimensions
|
|
1239
|
+
// ("Answered by", "Superseded by"), and who it waits on.
|
|
1240
|
+
const dimensions = readNoteDimensions(note);
|
|
1241
|
+
for (const line of dimensions ? formatNoteDimensionLines(dimensions) : []) {
|
|
1242
|
+
console.log(line);
|
|
1194
1243
|
}
|
|
1195
1244
|
if (note.updatedAt) {
|
|
1196
1245
|
console.log(`Updated: ${timeAgo(note.updatedAt)}`);
|
package/dist/commands/types.js
CHANGED
|
@@ -3,6 +3,7 @@ import { resolveConfig } from "../lib/config.js";
|
|
|
3
3
|
import { handleError, NotFoundError, ValidationError } from "../lib/errors.js";
|
|
4
4
|
import { outputJson, outputTable, outputQuiet } from "../lib/output.js";
|
|
5
5
|
import { typeEditInDraft } from "../lib/draft-view.js";
|
|
6
|
+
import { formatDimensionSpec, formatBackfillOffer } from "../lib/type-dimensions.js";
|
|
6
7
|
export function registerTypesCommands(program) {
|
|
7
8
|
const types = program
|
|
8
9
|
.command("types")
|
|
@@ -86,6 +87,12 @@ Examples:
|
|
|
86
87
|
else {
|
|
87
88
|
console.log("\nNo rubric defined for this type.");
|
|
88
89
|
}
|
|
90
|
+
const dims = Array.isArray(match.judgedDimensions) ? match.judgedDimensions : [];
|
|
91
|
+
if (dims.length > 0) {
|
|
92
|
+
console.log("\nJudged dimensions (asked of every note of this type on each save):");
|
|
93
|
+
for (const d of dims)
|
|
94
|
+
console.log(formatDimensionSpec(d));
|
|
95
|
+
}
|
|
89
96
|
}
|
|
90
97
|
catch (error) {
|
|
91
98
|
handleError(error, cfg.json);
|
|
@@ -190,4 +197,123 @@ Examples:
|
|
|
190
197
|
handleError(error, cfg.json);
|
|
191
198
|
}
|
|
192
199
|
});
|
|
200
|
+
const dimension = types
|
|
201
|
+
.command("dimension")
|
|
202
|
+
.description("Judged dimensions: a named question a decision model answers about every note of a type, " +
|
|
203
|
+
"on create and on each new version. Filter by one with `cnotes notes list --type <Type> --dimension key=state`.");
|
|
204
|
+
dimension
|
|
205
|
+
.command("add")
|
|
206
|
+
.description("Add a judged dimension to a type, or change the one with the same key. Workspace admin or owner only")
|
|
207
|
+
.argument("<type>", "Type name (e.g. Decision)")
|
|
208
|
+
.requiredOption("--key <key>", "Stable key, lowercase with underscores (e.g. revenue_risk)")
|
|
209
|
+
.requiredOption("--prompt <text>", "The question, written as a statement or question about one note")
|
|
210
|
+
.requiredOption("--kind <kind>", "boolean (yes / no / unsure), category (one of --options) or percentage (0% to 100%)")
|
|
211
|
+
.option("--label <label>", "What people read (defaults from the key)")
|
|
212
|
+
.option("--options <list>", "Comma-separated options for a category dimension (2 to 8)")
|
|
213
|
+
.option("--backfill <when>", "all: also judge every existing note of the type now (one model call each). forward: only new and edited notes. Ask the person before passing all.")
|
|
214
|
+
.addHelpText("after", `
|
|
215
|
+
Examples:
|
|
216
|
+
$ cnotes types dimension add Decision --key revenue_risk --kind boolean \\
|
|
217
|
+
--prompt "This decision puts current revenue at risk if it turns out wrong."
|
|
218
|
+
$ cnotes types dimension add Opportunity --key stage --kind category \\
|
|
219
|
+
--options discovery,shaping,delivery --prompt "Which stage is this opportunity at?"
|
|
220
|
+
$ cnotes types dimension add Slice --key readiness --kind percentage \\
|
|
221
|
+
--prompt "How ready is this slice to build, from 0% to 100%?" --backfill forward
|
|
222
|
+
|
|
223
|
+
Without --backfill nothing existing is judged: the output says how many notes
|
|
224
|
+
have no answer and about what judging them costs. Changing the prompt, kind or
|
|
225
|
+
options makes earlier answers stop counting until each note is judged again.
|
|
226
|
+
`)
|
|
227
|
+
.action(async (type, opts) => {
|
|
228
|
+
const cfg = resolveConfig(program.opts());
|
|
229
|
+
const api = new ApiClient(cfg.serverUrl, cfg.token, cfg.workspaceId);
|
|
230
|
+
try {
|
|
231
|
+
const inDraft = typeEditInDraft(cfg.proposal);
|
|
232
|
+
if (inDraft)
|
|
233
|
+
throw inDraft;
|
|
234
|
+
if (opts.backfill && opts.backfill !== "all" && opts.backfill !== "forward") {
|
|
235
|
+
throw new ValidationError("--backfill takes all or forward.");
|
|
236
|
+
}
|
|
237
|
+
const data = await api.post("/api/supertags/dimensions", {
|
|
238
|
+
workspaceId: cfg.workspaceId,
|
|
239
|
+
typeName: type,
|
|
240
|
+
key: opts.key,
|
|
241
|
+
label: opts.label,
|
|
242
|
+
prompt: opts.prompt,
|
|
243
|
+
kind: opts.kind,
|
|
244
|
+
options: opts.options ? String(opts.options).split(",").map((o) => o.trim()).filter(Boolean) : undefined,
|
|
245
|
+
backfill: opts.backfill,
|
|
246
|
+
});
|
|
247
|
+
if (cfg.json) {
|
|
248
|
+
outputJson(data);
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
const dim = data.dimension;
|
|
252
|
+
console.log(`${data.changed ? "Saved" : "Relabelled"} dimension on ${data.typeName}:`);
|
|
253
|
+
console.log(formatDimensionSpec(dim));
|
|
254
|
+
for (const line of formatBackfillOffer(data, String(data.typeName), dim.key))
|
|
255
|
+
console.log(line);
|
|
256
|
+
}
|
|
257
|
+
catch (error) {
|
|
258
|
+
handleError(error, cfg.json);
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
dimension
|
|
262
|
+
.command("remove")
|
|
263
|
+
.description("Remove a judged dimension from a type and delete its answers. Workspace admin or owner only")
|
|
264
|
+
.argument("<type>", "Type name")
|
|
265
|
+
.argument("<key>", "Dimension key")
|
|
266
|
+
.action(async (type, key) => {
|
|
267
|
+
const cfg = resolveConfig(program.opts());
|
|
268
|
+
const api = new ApiClient(cfg.serverUrl, cfg.token, cfg.workspaceId);
|
|
269
|
+
try {
|
|
270
|
+
const query = new URLSearchParams({ workspaceId: String(cfg.workspaceId), typeName: type, key });
|
|
271
|
+
const data = await api.delete(`/api/supertags/dimensions?${query}`);
|
|
272
|
+
if (cfg.json)
|
|
273
|
+
outputJson(data);
|
|
274
|
+
else
|
|
275
|
+
console.log(`Removed dimension ${key} from ${type}.`);
|
|
276
|
+
}
|
|
277
|
+
catch (error) {
|
|
278
|
+
handleError(error, cfg.json);
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
dimension
|
|
282
|
+
.command("backfill")
|
|
283
|
+
.description("Judge a type's existing notes on one dimension. Without --yes it only reports the count and the cost")
|
|
284
|
+
.argument("<type>", "Type name")
|
|
285
|
+
.argument("<key>", "Dimension key")
|
|
286
|
+
.option("--yes", "Start judging (one model call per note). Ask the person first")
|
|
287
|
+
.action(async (type, key, opts) => {
|
|
288
|
+
const cfg = resolveConfig(program.opts());
|
|
289
|
+
const api = new ApiClient(cfg.serverUrl, cfg.token, cfg.workspaceId);
|
|
290
|
+
try {
|
|
291
|
+
if (!opts.yes) {
|
|
292
|
+
const estimate = await api.get("/api/supertags/dimensions/backfill", {
|
|
293
|
+
workspaceId: cfg.workspaceId,
|
|
294
|
+
typeName: type,
|
|
295
|
+
key,
|
|
296
|
+
});
|
|
297
|
+
if (cfg.json) {
|
|
298
|
+
outputJson(estimate);
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
for (const line of formatBackfillOffer(estimate, type, key))
|
|
302
|
+
console.log(line);
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
const data = await api.post("/api/supertags/dimensions/backfill", {
|
|
306
|
+
workspaceId: cfg.workspaceId,
|
|
307
|
+
typeName: type,
|
|
308
|
+
key,
|
|
309
|
+
});
|
|
310
|
+
if (cfg.json)
|
|
311
|
+
outputJson(data);
|
|
312
|
+
else
|
|
313
|
+
console.log(`Judging ${data.unjudged} ${type} notes on ${key} in the background.`);
|
|
314
|
+
}
|
|
315
|
+
catch (error) {
|
|
316
|
+
handleError(error, cfg.json);
|
|
317
|
+
}
|
|
318
|
+
});
|
|
193
319
|
}
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* hint (convex/lib/decisionCitation.ts); this sentence is the rule those
|
|
7
7
|
* surfaces quote. Keep the skill's copy in step with it.
|
|
8
8
|
*/
|
|
9
|
-
export const DECISION_CARD_RULE = "Anything settled in conversation that shapes what we build or say publicly gets its own Decision card, citing the cards it depends on (typed links such as depends-on / grounded-in). If something is stated as decided but no Decision card exists, say so and create one.";
|
|
9
|
+
export const DECISION_CARD_RULE = "Anything settled in conversation that shapes what we build or say publicly gets its own Decision card, citing the cards it depends on (typed links such as depends-on / grounded-in). If something is stated as decided but no Decision card exists, say so and create one. When a card settles a Question, link the Question with answers, [QUESTION-12: Title](relationship:answers), so the Question reads answered.";
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Note dimensions as GET /api/notes reports them on a read by id: what a note
|
|
3
|
+
* is linked to under the rules declared in convex/lib/noteDimensions.ts
|
|
4
|
+
* ("Answered by", "Superseded by"), and who a note waits on.
|
|
5
|
+
*
|
|
6
|
+
* The server sends only dimensions that say something, so nothing here
|
|
7
|
+
* invents a reading when a field is missing.
|
|
8
|
+
*/
|
|
9
|
+
/** The fields off a raw note row, or undefined when there is nothing to read. */
|
|
10
|
+
export function readNoteDimensions(note) {
|
|
11
|
+
const dimensions = Array.isArray(note.dimensions)
|
|
12
|
+
? note.dimensions
|
|
13
|
+
.filter((d) => !!d && typeof d === "object" && typeof d.key === "string")
|
|
14
|
+
.map((d) => ({
|
|
15
|
+
key: String(d.key),
|
|
16
|
+
label: typeof d.label === "string" ? d.label : String(d.key),
|
|
17
|
+
state: typeof d.state === "string" ? d.state : "",
|
|
18
|
+
...(d.source === "judged" ? { source: "judged" } : {}),
|
|
19
|
+
...(typeof d.kind === "string" ? { kind: d.kind } : {}),
|
|
20
|
+
...(typeof d.value === "number" ? { value: d.value } : {}),
|
|
21
|
+
notes: Array.isArray(d.notes)
|
|
22
|
+
? d.notes
|
|
23
|
+
.filter((r) => !!r && typeof r.displayId === "string")
|
|
24
|
+
.map((r) => ({ displayId: String(r.displayId), title: typeof r.title === "string" ? r.title : null }))
|
|
25
|
+
: [],
|
|
26
|
+
}))
|
|
27
|
+
: [];
|
|
28
|
+
const waitsOn = Array.isArray(note.waitsOn) ? note.waitsOn.filter((n) => typeof n === "string") : [];
|
|
29
|
+
if (dimensions.length === 0 && waitsOn.length === 0)
|
|
30
|
+
return undefined;
|
|
31
|
+
return { dimensions, waitsOn, waitsOnYou: note.waitsOnYou === true };
|
|
32
|
+
}
|
|
33
|
+
const refs = (notes) => notes.map((r) => (r.title ? `${r.displayId} (${r.title})` : r.displayId)).join(", ");
|
|
34
|
+
/**
|
|
35
|
+
* One value per dimension: the notes that fill a link dimension, or "none yet
|
|
36
|
+
* (open)"; a judged answer with the probability behind it ("yes (0.82)"), or a
|
|
37
|
+
* percentage as it is ("75%").
|
|
38
|
+
*/
|
|
39
|
+
export function formatDimension(d) {
|
|
40
|
+
if (d.source === "judged") {
|
|
41
|
+
return d.kind !== "percentage" && typeof d.value === "number" ? `${d.state} (${d.value.toFixed(2)})` : d.state;
|
|
42
|
+
}
|
|
43
|
+
return d.notes.length > 0 ? refs(d.notes) : `none yet (${d.state})`;
|
|
44
|
+
}
|
|
45
|
+
/** "you", or the names a note waits on. */
|
|
46
|
+
export function formatWaitsOn(reading) {
|
|
47
|
+
if (reading.waitsOnYou)
|
|
48
|
+
return "you";
|
|
49
|
+
return reading.waitsOn.length > 0 ? reading.waitsOn.join(", ") : null;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The header lines for `notes get`:
|
|
53
|
+
* "Answered by: DECISION-9 (No-card trial)"
|
|
54
|
+
* "Answered by: none yet (open)"
|
|
55
|
+
* "Waits on: you"
|
|
56
|
+
* "Superseded by: DECISION-117 (Wedge pivots)"
|
|
57
|
+
*/
|
|
58
|
+
export function formatNoteDimensionLines(reading) {
|
|
59
|
+
const lines = reading.dimensions.map((d) => `${d.label}: ${formatDimension(d)}`);
|
|
60
|
+
const waits = formatWaitsOn(reading);
|
|
61
|
+
if (waits)
|
|
62
|
+
lines.push(`Waits on: ${waits}`);
|
|
63
|
+
return lines;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* `--dimension key=state` as [key, state], split on the FIRST "=" only: a
|
|
67
|
+
* percentage state is itself ">=50" or "<=25". Either part is "" when missing.
|
|
68
|
+
*/
|
|
69
|
+
export function parseDimensionFilter(raw) {
|
|
70
|
+
const at = raw.indexOf("=");
|
|
71
|
+
if (at < 0)
|
|
72
|
+
return [raw.trim(), ""];
|
|
73
|
+
return [raw.slice(0, at).trim(), raw.slice(at + 1).trim()];
|
|
74
|
+
}
|
package/dist/lib/themes.js
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export const PRESETS = [
|
|
16
16
|
{ id: "cursor-2", name: "Cursor", isDark: true, description: "Quiet graphite greys from the Cursor agents window: a darker canvas under the rail and panels, a white send button and a blue focus." },
|
|
17
|
+
{ id: "claude", name: "Claude", isDark: true, description: "Charcoal panels stepping lighter from the rail to the canvas to the note, with a quiet blue for links and focus." },
|
|
17
18
|
{ id: "ember", name: "Ember", isDark: true, description: "Roasted-coffee dark with glowing ember orange and a cool teal spark." },
|
|
18
19
|
{ id: "ember-2", name: "Ember 2", isDark: true, description: "Roasted-coffee greys in quiet steps, with ember coral kept for what you can act on." },
|
|
19
20
|
{ id: "synapse", name: "Synapse", isDark: true, description: "Neural-network teal firing on pure black, connections lit in the dark." },
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Printing judged dimensions for `cnotes types show` and
|
|
3
|
+
* `cnotes types dimension add | backfill` (CANVAS-448).
|
|
4
|
+
*/
|
|
5
|
+
/** " revenue_risk Revenue risk (boolean, v2) This decision puts…" */
|
|
6
|
+
export function formatDimensionSpec(d) {
|
|
7
|
+
const kind = d.kind === "category" && d.options?.length ? `category: ${d.options.join(" / ")}` : d.kind;
|
|
8
|
+
return ` ${d.key} ${d.label} (${kind}, v${d.version})\n ${d.prompt}`;
|
|
9
|
+
}
|
|
10
|
+
const usd = (n) => {
|
|
11
|
+
const x = typeof n === "number" ? n : 0;
|
|
12
|
+
return x < 0.01 ? "under $0.01" : `about $${x.toFixed(2)}`;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* What adding a dimension or asking for a backfill leaves to decide: how many
|
|
16
|
+
* notes have no answer on the current wording, what judging them costs, and
|
|
17
|
+
* the command that does it. Nothing is judged until someone runs it.
|
|
18
|
+
*/
|
|
19
|
+
export function formatBackfillOffer(data, type, key) {
|
|
20
|
+
const lines = [];
|
|
21
|
+
const unjudged = typeof data.unjudged === "number" ? data.unjudged : 0;
|
|
22
|
+
const capped = data.capped === true ? " (counted up to 2,000)" : "";
|
|
23
|
+
const backfill = data.backfill;
|
|
24
|
+
const judge = data.judge;
|
|
25
|
+
if (judge && judge.ok === false) {
|
|
26
|
+
lines.push(`Not judged here yet: ${judge.reason ?? "no decision model can run in this workspace."}`);
|
|
27
|
+
}
|
|
28
|
+
// The estimate carries the latest backfill's state; the add response carries whether one started.
|
|
29
|
+
if (backfill?.state === "running") {
|
|
30
|
+
lines.push(`Already judging existing ${type} notes in the background (${backfill.judged ?? 0} so far).`);
|
|
31
|
+
return lines;
|
|
32
|
+
}
|
|
33
|
+
if (backfill?.state === "stalled") {
|
|
34
|
+
lines.push(`The last backfill stopped after ${backfill.judged ?? 0} notes: ${backfill.reason ?? "no reason recorded."}`);
|
|
35
|
+
}
|
|
36
|
+
if (backfill?.scheduled) {
|
|
37
|
+
lines.push(`Judging ${backfill.notes ?? unjudged} existing ${type} notes in the background.`);
|
|
38
|
+
}
|
|
39
|
+
else if (unjudged === 0) {
|
|
40
|
+
lines.push(`Every existing ${type} note already has an answer on this wording.`);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
lines.push(`${unjudged} existing ${type} notes have no answer on this${capped}. New and edited notes are judged from now on.`, `To judge the existing ones too (${usd(data.estimatedCostUsd)}), ask the person, then run:`, ` cnotes types dimension backfill ${type} ${key} --yes`);
|
|
44
|
+
}
|
|
45
|
+
return lines;
|
|
46
|
+
}
|
package/package.json
CHANGED
package/skills/cnotes/SKILL.md
CHANGED
|
@@ -33,13 +33,13 @@ Reads, and a single metadata change (`notes update`), need no run.
|
|
|
33
33
|
5. **Place declaratively, edit in place.** Use `canvas place` / `canvas arrange`, never hand-computed x/y. Add to a section with `place --into SECTION-n` (or `--section` on a single add); tidy one with `arrange --section SECTION-n`. Change a text card with `canvas update-text` and a frame with `canvas update-section`. Deleting and re-adding mints new ids and drops edges and `[[SECTION-n]]` mentions.
|
|
34
34
|
6. **Content changes are versions.** `cnotes versions create` changes a note's body (the `# h1` is its title); fetch the current body first and edit that, since people edit between sessions. `notes update` changes metadata only (type, tags, pin, archive).
|
|
35
35
|
7. **Inside a draft, propose and stop.** Shared notes change through `cnotes draft propose`; the hand-over is `cnotes draft ask`, then stop. Never merge or approve work you built. Detail: [references/drafts.md](references/drafts.md).
|
|
36
|
-
8. **Ask before spending something the user cannot get back:** `cnotes upgrade` uses the workspace's one-time trial,
|
|
36
|
+
8. **Ask before spending something the user cannot get back:** `cnotes upgrade` uses the workspace's one-time trial, `cnotes feedback submit` files a report in their name, and `cnotes types dimension backfill --yes` spends one model call per existing note.
|
|
37
37
|
9. **Timeline headlines start with a past-tense verb and name the object** ("Shipped the public comic canvas", never "V1"). The server rejects milestone headlines that do not.
|
|
38
38
|
10. **Canvas names use the interpunct** `·` as a separator, never a dash: "Path to Revenue · Funding strategy".
|
|
39
39
|
|
|
40
40
|
### Decisions
|
|
41
41
|
|
|
42
|
-
Anything settled in conversation that shapes what we build or say publicly gets its own Decision card, citing the cards it depends on (typed links such as depends-on / grounded-in). If something is stated as decided but no Decision card exists, say so and create one.
|
|
42
|
+
Anything settled in conversation that shapes what we build or say publicly gets its own Decision card, citing the cards it depends on (typed links such as depends-on / grounded-in). If something is stated as decided but no Decision card exists, say so and create one. When a card settles a Question, link the Question with answers, [QUESTION-12: Title](relationship:answers), so the Question reads answered.
|
|
43
43
|
|
|
44
44
|
Write the citation in the Decision's body, not only as a canvas edge: `[NOTE-12: Title](relationship:depends-on)` or `[[grounded-in::NOTE-12]]`. A `references` chip and an untyped `[[NOTE-12]]` do not cite a dependence. Read the rubric first with `cnotes types show Decision`.
|
|
45
45
|
|
|
@@ -104,7 +104,7 @@ After you create a canvas or finish changing one, end your reply with its link,
|
|
|
104
104
|
| When you are | Open |
|
|
105
105
|
|---|---|
|
|
106
106
|
| Writing any prose a person will read | [references/humanizer.md](references/humanizer.md) |
|
|
107
|
-
| Creating, reading or revising notes; types and
|
|
107
|
+
| Creating, reading or revising notes; types, rubrics and dimensions; markdown rules | [references/notes.md](references/notes.md) |
|
|
108
108
|
| Linking notes, reading backlinks, checking what an edit affects (`deps`) | [references/relationships.md](references/relationships.md) |
|
|
109
109
|
| Deciding what goes on a canvas as a note, text card, list, frame, edge or portal; the banner; completion tests | [references/canvas-elements.md](references/canvas-elements.md) |
|
|
110
110
|
| Placing or rearranging several items (`canvas place`, `arrange`) | [references/canvas-layout.md](references/canvas-layout.md) |
|
|
@@ -195,6 +195,49 @@ cnotes types update <name> [--display-name <name>] [--description <text>] [--col
|
|
|
195
195
|
cnotes notes retype <displayId> --type <NewType>
|
|
196
196
|
```
|
|
197
197
|
|
|
198
|
+
### Dimensions
|
|
199
|
+
|
|
200
|
+
A type can carry dimensions: readings every note of the type gets, shown by
|
|
201
|
+
`notes get` under the title and filterable with `notes list --dimension`.
|
|
202
|
+
|
|
203
|
+
- **Link dimensions** are built in and read from live links: a Question is
|
|
204
|
+
`answered` when a note links it with `answers` (or the Question links its
|
|
205
|
+
answer with `answered-by`); any note is `supersededBy` when a newer note says
|
|
206
|
+
`supersedes`. Write those links and the reading follows.
|
|
207
|
+
- **Judged dimensions** are questions you add to a type, beside its rubric. A
|
|
208
|
+
decision model answers each one about every note of the type on create and on
|
|
209
|
+
each new version. At most three per type; admin or owner only, like the rubric.
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
# Add one: boolean (yes / no / unsure), category (one of --options), percentage (0% to 100%)
|
|
213
|
+
cnotes types dimension add Decision --key revenue_risk --kind boolean \
|
|
214
|
+
--prompt "This decision puts current revenue at risk if it turns out wrong."
|
|
215
|
+
cnotes types dimension add Opportunity --key stage --kind category \
|
|
216
|
+
--options discovery,shaping,delivery --prompt "Which stage is this opportunity at?"
|
|
217
|
+
|
|
218
|
+
# See a type's dimensions (also in `types show`)
|
|
219
|
+
cnotes types show Decision
|
|
220
|
+
|
|
221
|
+
# Filter by any dimension
|
|
222
|
+
cnotes notes list --type Decision --dimension revenue_risk=yes
|
|
223
|
+
cnotes notes list --type Slice --dimension readiness=">=50"
|
|
224
|
+
cnotes notes list --needs-me # open Questions whose "Whose call" names you
|
|
225
|
+
|
|
226
|
+
# Judge the existing notes too: first see the count and cost, then ask the person
|
|
227
|
+
cnotes types dimension backfill Decision revenue_risk # estimate only
|
|
228
|
+
cnotes types dimension backfill Decision revenue_risk --yes # one model call per note
|
|
229
|
+
|
|
230
|
+
cnotes types dimension remove Decision revenue_risk
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Write the prompt the way you would a rubric clause: one plain statement about
|
|
234
|
+
one note, checkable from the note's own text ("names the customer who asked",
|
|
235
|
+
not "is good"). Adding a dimension judges only new and edited notes. Before you
|
|
236
|
+
judge existing notes, tell the person how many and what it costs (the `add`
|
|
237
|
+
output says both) and let them choose all existing or only going forward.
|
|
238
|
+
Changing the prompt, kind or options makes earlier answers stop counting until
|
|
239
|
+
each note is judged again; a new label alone keeps them.
|
|
240
|
+
|
|
198
241
|
|
|
199
242
|
## Note IDs
|
|
200
243
|
- Notes have **display IDs** like `MEETING-12`, `PRD-5`, `IDEA-3` — use these in commands.
|