@nanopm/cli 0.1.3 → 0.1.5

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/dist/index.js CHANGED
@@ -11308,9 +11308,12 @@ function validateItem(item) {
11308
11308
  }
11309
11309
  return null;
11310
11310
  }
11311
- function overFounder(item, stated) {
11312
- if (item.topic !== GOALS_TOPIC || item.provenance === "stated" || !stated.has(item.key)) return null;
11313
- return `the founder set "${item.key}" themselves; drop your proposal, never write it again`;
11311
+ function overFounder(item, stated, definitionLever = null) {
11312
+ if (item.topic !== GOALS_TOPIC || item.provenance === "stated") return null;
11313
+ if (stated.has(item.key)) return `the founder set "${item.key}" themselves; drop your proposal, never write it again`;
11314
+ const lever = item.key === OBJECTIVE_KEY ? LEVER_LINE.exec(item.content)?.[1] : void 0;
11315
+ if (definitionLever && lever && lever !== definitionLever) return `the founder chose ${definitionLever} when they defined their objective: write "${item.key}" for ${definitionLever}, or nothing`;
11316
+ return null;
11314
11317
  }
11315
11318
  function normaliseItem(item) {
11316
11319
  return normalisePersona(item);
@@ -11772,9 +11775,9 @@ ${renderMap()}`,
11772
11775
  valid.push({ ...item, content: fix.content });
11773
11776
  } else valid.push(item);
11774
11777
  }
11775
- const stated = await statedGoals(ctx, valid);
11778
+ const { stated, definitionLever } = await statedGoals(ctx, valid);
11776
11779
  const writable = valid.filter((item) => {
11777
- const why = overFounder(item, stated);
11780
+ const why = overFounder(item, stated, definitionLever);
11778
11781
  if (why) refused.push({ key: item.key, why });
11779
11782
  return !why;
11780
11783
  });
@@ -12340,11 +12343,11 @@ async function listContext(ctx, domain, topic) {
12340
12343
  return { items };
12341
12344
  }
12342
12345
  async function statedGoals(ctx, items) {
12343
- const keys = items.filter((i) => i.topic === GOALS_TOPIC && i.provenance !== "stated").map((i) => i.key);
12344
- if (!keys.length) return /* @__PURE__ */ new Set();
12345
- const { data, error } = await ctx.client.from("memory").select("key").eq("project_id", ctx.projectId).eq("topic", GOALS_TOPIC).in("key", keys).eq("provenance", "stated").is("superseded_by", null);
12346
+ if (!items.some((i) => i.topic === GOALS_TOPIC && i.provenance !== "stated")) return { stated: /* @__PURE__ */ new Set(), definitionLever: null };
12347
+ const { data, error } = await ctx.client.from("memory").select("key, content").eq("project_id", ctx.projectId).eq("topic", GOALS_TOPIC).eq("provenance", "stated").is("superseded_by", null);
12346
12348
  if (error) throw new Error(`write_context failed reading the founder's goals: ${error.message}`);
12347
- return new Set(data.map((r) => r.key));
12349
+ const definition = data.find((r) => r.key === DEFINITION_KEY);
12350
+ return { stated: new Set(data.map((r) => r.key)), definitionLever: definition ? parseDefinition(definition.content)?.lever ?? null : null };
12348
12351
  }
12349
12352
  async function writeContext(ctx, items, refused = []) {
12350
12353
  const written = [];
@@ -13882,7 +13885,7 @@ import { promisify as promisify7 } from "util";
13882
13885
  // package.json
13883
13886
  var package_default = {
13884
13887
  name: "@nanopm/cli",
13885
- version: "0.1.3",
13888
+ version: "0.1.5",
13886
13889
  description: "An autonomous product manager for builders who run several small products. Runs on your machine, drives your own coding harness.",
13887
13890
  type: "module",
13888
13891
  license: "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nanopm/cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "An autonomous product manager for builders who run several small products. Runs on your machine, drives your own coding harness.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -152,7 +152,9 @@ product is.
152
152
  `nanopm personas` deepens them afterwards with the market view in hand.
153
153
  - one aim (`goals`, key `objective-1`), unless a stated one exists: the founder may
154
154
  have written theirs on the web while you were reading, so list_context with topic
155
- `goals` right before this, and propose nothing over a stated one. If the write is
155
+ `goals` right before this, and propose nothing over a stated one. If the founder
156
+ already defined what it counts (`objective-1-definition`, stated), the aim is on **that
157
+ lever**, never another: they chose it. If the write is
156
158
  refused because `objective-1` already exists, the founder set it meanwhile: drop it,
157
159
  never write it again (dogo-3, 2026-10-01: a retry cost a round trip). Its first words
158
160
  name the lever: `Lever: activation.`, `retention`, `acquisition` or `monetization`;