synthesize: context and offer kinds, Q1 section, points cap, firmer novel rule (dress rehearsal tuning)
From a 50-response dress rehearsal on 2026-10-27: - Answers about why someone joined were being clustered as points and padded the privacy theme with 'joined because they hate ads'. Tag them as kind=context, keep them out of clustering, and render a 'Why people joined' sample instead. - Two members volunteered help and landed under standout ideas. Tag those as kind=offer and give them an 'Offers of help' section. - 'Points raised' lists ran to 27 bullets per theme; cap at 12 with a pointer to synthesis.json. - One run read 'novel' as 'left unthemed' and returned 2 standout ideas instead of ~10. The cluster prompt now says standout ideas usually sit inside a theme and asks for 5 to 10 concrete mechanisms. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
68775856f4
commit
a285ccb1dc
7 files changed
+144
-104
No files matched your search
@@ -94,10 +94,12 @@ script prints to confirm it read the header the way you expect.
|
|||||||
|
|
||||||
## Output
|
## Output
|
||||||
|
|
||||||
- `out/review.md`: headline numbers, priorities tally, themes ranked by how
|
- `out/review.md`: headline numbers, priorities tally, a "Why people joined"
|
||||||
many distinct people raised them (with for/against counts and verbatim
|
sample (answers about background and current use are tagged `context` and
|
||||||
quotes), standout single-person ideas, notable dissent, open questions, and
|
kept out of the themes), themes ranked by how many distinct people raised
|
||||||
an appendix with every response.
|
them (with for/against counts, up to 12 points each, and verbatim quotes),
|
||||||
|
standout single-person ideas, offers of help (points tagged `offer`),
|
||||||
|
notable dissent, open questions, and an appendix with every response.
|
||||||
- `out/synthesis.json`: the structured intermediate (items, clusters, token
|
- `out/synthesis.json`: the structured intermediate (items, clusters, token
|
||||||
usage) for auditing or re-rendering.
|
usage) for auditing or re-rendering.
|
||||||
|
|
||||||
@@ -128,7 +130,9 @@ quote verification, JSON extraction and retry, caching, and rendering.
|
|||||||
|
|
||||||
## Status
|
## Status
|
||||||
|
|
||||||
Built for the first-week-of-November 2026 members' meeting. The form itself
|
Built for the first-week-of-November 2026 members' meeting. Dress-rehearsed
|
||||||
|
on 2026-10-27 against a real CryptPad export of 50 synthetic responses: five
|
||||||
|
gateway calls, about 80 seconds of model time, ≈$0.13. The form itself
|
||||||
lives on CryptPad for now; a small co-op-hosted app (anonymous form + a
|
lives on CryptPad for now; a small co-op-hosted app (anonymous form + a
|
||||||
synthesize button, same pipeline) is a possible next step if the output is
|
synthesize button, same pipeline) is a possible next step if the output is
|
||||||
useful. Discussion and ideas: open an issue here or on
|
useful. Discussion and ideas: open an issue here or on
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ Group the items into themes that would help the group see where energy is concen
|
|||||||
- A theme is a cluster of points about the same underlying topic, regardless of whether they agree. Give each theme a short name (at most 6 words) and a two-sentence neutral summary.
|
- A theme is a cluster of points about the same underlying topic, regardless of whether they agree. Give each theme a short name (at most 6 words) and a two-sentence neutral summary.
|
||||||
- Every item id you reference must come from the list. Do not invent ids. An item may appear in at most one theme.
|
- Every item id you reference must come from the list. Do not invent ids. An item may appear in at most one theme.
|
||||||
- Prefer 5 to 12 themes. Fold tiny near-duplicate themes together; split a theme that is really two topics.
|
- Prefer 5 to 12 themes. Fold tiny near-duplicate themes together; split a theme that is really two topics.
|
||||||
- `novel`: item ids that stand alone (no other respondent raised anything similar) but are specific and actionable enough that the group should see them. Quality over quantity; at most 10.
|
- `novel`: 5 to 10 item ids for standout ideas: proposals that only one respondent raised but that are specific and actionable enough that the group should see them. An item can be in a theme and in `novel` at the same time, and most standout ideas will sit inside a theme; do not limit `novel` to items you left unthemed. Prefer concrete mechanisms (a fund, a policy, a feature, a partnership) over general sentiments.
|
||||||
- `dissent`: places where items pull in opposite directions, or where a respondent pushes back on something others want. For each, name the theme it belongs to, list the item ids on the minority or opposing side, and summarize the tension in one or two neutral sentences. Include concerns of kind `concern` with stance `against` even if they stand alone, if they are substantive.
|
- `dissent`: places where items pull in opposite directions, or where a respondent pushes back on something others want. For each, name the theme it belongs to, list the item ids on the minority or opposing side, and summarize the tension in one or two neutral sentences. Include concerns of kind `concern` with stance `against` even if they stand alone, if they are substantive.
|
||||||
- `open_questions`: at most 6 questions the group will need to answer, phrased neutrally, each grounded in the items (reference ids).
|
- `open_questions`: at most 6 questions the group will need to answer, phrased neutrally, each grounded in the items (reference ids).
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -7,7 +7,9 @@ For each item return:
|
|||||||
- `id`: the response id it came from (e.g. `r03`).
|
- `id`: the response id it came from (e.g. `r03`).
|
||||||
- `q`: the question index it came from (e.g. `Q2`).
|
- `q`: the question index it came from (e.g. `Q2`).
|
||||||
- `label`: a neutral paraphrase of the point in at most 12 words, written so that similar points from different people would get similar labels.
|
- `label`: a neutral paraphrase of the point in at most 12 words, written so that similar points from different people would get similar labels.
|
||||||
- `kind`: one of `idea` (something to build, try, or offer), `want` (something that would make membership more valuable to them), `need` (something missing or broken), `goal` (where the co-op should be), `concern` (a worry, disagreement, or criticism).
|
- `kind`: one of `idea` (something to build, try, or offer), `want` (something that would make membership more valuable to them), `need` (something missing or broken), `goal` (where the co-op should be), `concern` (a worry, disagreement, or criticism), `context` (background about the respondent: why they joined, what drew them, how they use the service today), `offer` (the respondent volunteers their own time, skills, or help).
|
||||||
|
- Answers to a question like "what drew you here / what do you use it for" are `context` unless they also contain a proposal, complaint, or goal, in which case extract that part as its own item of the right kind.
|
||||||
|
- "Happy to help with X" or "I could do a review" is an `offer`, not an `idea`.
|
||||||
- `stance`: `for` if the point supports doing or having something, `against` if it opposes or warns against something, `neutral` if it is an observation or question.
|
- `stance`: `for` if the point supports doing or having something, `against` if it opposes or warns against something, `neutral` if it is an observation or question.
|
||||||
- `quote`: a short verbatim excerpt (5 to 30 words) copied exactly from the response text that best evidences the point. It must be a character-for-character substring of the source text. Do not paraphrase, do not fix typos, do not add ellipses.
|
- `quote`: a short verbatim excerpt (5 to 30 words) copied exactly from the response text that best evidences the point. It must be a character-for-character substring of the source text. Do not paraphrase, do not fix typos, do not add ellipses.
|
||||||
|
|
||||||
|
|||||||
+49
-6
@@ -49,7 +49,11 @@ PRICES = {
|
|||||||
"greenpt/deepseek-v4.1-flash": (0.22, 1.10),
|
"greenpt/deepseek-v4.1-flash": (0.22, 1.10),
|
||||||
}
|
}
|
||||||
|
|
||||||
KINDS = {"idea", "want", "need", "goal", "concern"}
|
KINDS = {"idea", "want", "need", "goal", "concern", "context", "offer"}
|
||||||
|
# context (why someone joined / how they use it) and offer (volunteering help) are
|
||||||
|
# reported in their own sections and kept out of theme clustering.
|
||||||
|
UNCLUSTERED_KINDS = {"context", "offer"}
|
||||||
|
POINTS_PER_THEME = 12 # cap on the "Points raised" list per theme in the review doc
|
||||||
STANCES = {"for", "against", "neutral"}
|
STANCES = {"for", "against", "neutral"}
|
||||||
META_COL_RE = re.compile(r"^(id|#|time|timestamp|date|submitted|created|author|user|participant)\b", re.I)
|
META_COL_RE = re.compile(r"^(id|#|time|timestamp|date|submitted|created|author|user|participant)\b", re.I)
|
||||||
|
|
||||||
@@ -383,6 +387,14 @@ def stage_tag(gw: Gateway, loaded: dict, batch_size: int, use_tools: bool,
|
|||||||
return items, dropped
|
return items, dropped
|
||||||
|
|
||||||
|
|
||||||
|
def split_items(items: list[dict]) -> tuple[list[dict], list[dict], list[dict]]:
|
||||||
|
"""Return (to_cluster, context, offers)."""
|
||||||
|
to_cluster = [it for it in items if it["kind"] not in UNCLUSTERED_KINDS]
|
||||||
|
context = [it for it in items if it["kind"] == "context"]
|
||||||
|
offers = [it for it in items if it["kind"] == "offer"]
|
||||||
|
return to_cluster, context, offers
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
# Stage B: cluster
|
# Stage B: cluster
|
||||||
# --------------------------------------------------------------------------- #
|
# --------------------------------------------------------------------------- #
|
||||||
@@ -488,6 +500,23 @@ def render(loaded: dict, items: list[dict], clusters: dict, meta: dict) -> str:
|
|||||||
out.append(f"- {bar} **{c}** · {opt}")
|
out.append(f"- {bar} **{c}** · {opt}")
|
||||||
out.append("")
|
out.append("")
|
||||||
|
|
||||||
|
# Why people joined: context items, quotes only, kept out of the themes
|
||||||
|
context = [it for it in items if it["kind"] == "context"]
|
||||||
|
if context:
|
||||||
|
people = {it["rid"] for it in context}
|
||||||
|
out.append("## Why people joined\n")
|
||||||
|
out.append(f"_{len(people)} of {n_resp} people said what brought them here or how they use the co-op today. "
|
||||||
|
"A sample; the rest are in the appendix._\n")
|
||||||
|
shown_ctx: set[str] = set()
|
||||||
|
for it in context:
|
||||||
|
if it["rid"] in shown_ctx:
|
||||||
|
continue
|
||||||
|
out.append(quote_line(it["iid"]))
|
||||||
|
shown_ctx.add(it["rid"])
|
||||||
|
if len(shown_ctx) >= 12:
|
||||||
|
break
|
||||||
|
out.append("")
|
||||||
|
|
||||||
# Themes ordered by distinct respondents
|
# Themes ordered by distinct respondents
|
||||||
def theme_key(t):
|
def theme_key(t):
|
||||||
rids = {by_iid[i]["rid"] for i in t["item_ids"]}
|
rids = {by_iid[i]["rid"] for i in t["item_ids"]}
|
||||||
@@ -511,8 +540,11 @@ def render(loaded: dict, items: list[dict], clusters: dict, meta: dict) -> str:
|
|||||||
out.append(t["summary"] + "\n")
|
out.append(t["summary"] + "\n")
|
||||||
labels = Counter(by_iid[i]["label"] for i in t["item_ids"])
|
labels = Counter(by_iid[i]["label"] for i in t["item_ids"])
|
||||||
out.append("Points raised:\n")
|
out.append("Points raised:\n")
|
||||||
for label, c in labels.most_common():
|
ranked = labels.most_common()
|
||||||
|
for label, c in ranked[:POINTS_PER_THEME]:
|
||||||
out.append(f"- {label}" + (f" (×{c})" if c > 1 else ""))
|
out.append(f"- {label}" + (f" (×{c})" if c > 1 else ""))
|
||||||
|
if len(ranked) > POINTS_PER_THEME:
|
||||||
|
out.append(f"- …and {len(ranked) - POINTS_PER_THEME} more (full list in synthesis.json)")
|
||||||
out.append("")
|
out.append("")
|
||||||
# Up to 4 quotes from distinct respondents
|
# Up to 4 quotes from distinct respondents
|
||||||
shown: set[str] = set()
|
shown: set[str] = set()
|
||||||
@@ -535,6 +567,15 @@ def render(loaded: dict, items: list[dict], clusters: dict, meta: dict) -> str:
|
|||||||
out.append(f" {quote_line(i)[2:]}")
|
out.append(f" {quote_line(i)[2:]}")
|
||||||
out.append("")
|
out.append("")
|
||||||
|
|
||||||
|
offers = [it for it in items if it["kind"] == "offer"]
|
||||||
|
if offers:
|
||||||
|
out.append("## Offers of help\n")
|
||||||
|
out.append("_People who volunteered time or skills. Worth a follow-up._\n")
|
||||||
|
for it in offers:
|
||||||
|
out.append(f"- **{it['label']}** ")
|
||||||
|
out.append(f" {quote_line(it['iid'])[2:]}")
|
||||||
|
out.append("")
|
||||||
|
|
||||||
if clusters["dissent"]:
|
if clusters["dissent"]:
|
||||||
out.append("## Notable dissent\n")
|
out.append("## Notable dissent\n")
|
||||||
out.append("_Places where people pull in different directions. Worth time in the meeting._\n")
|
out.append("_Places where people pull in different directions. Worth time in the meeting._\n")
|
||||||
@@ -655,13 +696,15 @@ def main(argv: list[str] | None = None) -> int:
|
|||||||
reasoning_effort=None if a.reasoning_effort == "default" else a.reasoning_effort,
|
reasoning_effort=None if a.reasoning_effort == "default" else a.reasoning_effort,
|
||||||
raw_dir=a.save_raw, verbose=a.verbose)
|
raw_dir=a.save_raw, verbose=a.verbose)
|
||||||
items, dropped = stage_tag(gw, loaded, a.batch_size, a.use_tools, a.max_tokens)
|
items, dropped = stage_tag(gw, loaded, a.batch_size, a.use_tools, a.max_tokens)
|
||||||
print(f"tagged: {len(items)} points kept, {len(dropped)} dropped", file=sys.stderr)
|
to_cluster, context, offers = split_items(items)
|
||||||
|
print(f"tagged: {len(items)} points kept ({len(context)} context, {len(offers)} offers), "
|
||||||
|
f"{len(dropped)} dropped", file=sys.stderr)
|
||||||
for d in dropped[:10]:
|
for d in dropped[:10]:
|
||||||
print(f" dropped: {d}", file=sys.stderr)
|
print(f" dropped: {d}", file=sys.stderr)
|
||||||
if not items:
|
if not to_cluster:
|
||||||
print("no points extracted; nothing to cluster", file=sys.stderr)
|
print("no points to cluster", file=sys.stderr)
|
||||||
return 1
|
return 1
|
||||||
clusters = stage_cluster(gw, items, a.use_tools, a.max_tokens)
|
clusters = stage_cluster(gw, to_cluster, a.use_tools, a.max_tokens)
|
||||||
print(f"clustered: {len(clusters['themes'])} themes · {len(clusters['novel'])} novel · "
|
print(f"clustered: {len(clusters['themes'])} themes · {len(clusters['novel'])} novel · "
|
||||||
f"{len(clusters['dissent'])} dissent · {len(clusters['unthemed'])} unthemed", file=sys.stderr)
|
f"{len(clusters['dissent'])} dissent · {len(clusters['unthemed'])} unthemed", file=sys.stderr)
|
||||||
|
|
||||||
|
|||||||
Vendored
+32
-60
@@ -18,118 +18,90 @@ _12 of 12 responses answered._
|
|||||||
- ██████ **2** · owning our own infrastructure
|
- ██████ **2** · owning our own infrastructure
|
||||||
- ██████ **2** · green energy
|
- ██████ **2** · green energy
|
||||||
|
|
||||||
|
## Why people joined
|
||||||
|
|
||||||
|
_12 of 12 people said what brought them here or how they use the co-op today. A sample; the rest are in the appendix._
|
||||||
|
|
||||||
|
> "Privacy. I wanted an AI I" (r01, Q1)
|
||||||
|
> "Green energy mostly. I teach and" (r02, Q1)
|
||||||
|
> "Curiosity about co-op governance. I use" (r03, Q1)
|
||||||
|
> "A friend invited me. I mostly" (r04, Q1)
|
||||||
|
> "Wanted to support a cooperative alternative." (r05, Q1)
|
||||||
|
> "Privacy and the TEE story. Chat" (r06, Q1)
|
||||||
|
> "I run a small nonprofit and" (r07, Q1)
|
||||||
|
> "Governance nerd. I barely use the" (r08, Q1)
|
||||||
|
> "Needed an API for a side" (r09, Q1)
|
||||||
|
> "Climate reasons." (r10, Q1)
|
||||||
|
> "Wanted to try open-weight models without" (r11, Q1)
|
||||||
|
> "Someone mentioned it at a Metagov" (r12, Q1)
|
||||||
|
|
||||||
## Themes
|
## Themes
|
||||||
|
|
||||||
| # | Theme | People | Points | For / Against |
|
| # | Theme | People | Points | For / Against |
|
||||||
|---|---|---|---|---|
|
|---|---|---|---|---|
|
||||||
| 1 | Own the stack | 7 | 36 | 36 / 0 |
|
| 1 | Own the stack | 7 | 30 | 30 / 0 |
|
||||||
| 2 | Institutional access | 6 | 35 | 35 / 0 |
|
| 2 | Institutional access | 6 | 29 | 29 / 0 |
|
||||||
|
|
||||||
### 1. Own the stack
|
### 1. Own the stack
|
||||||
|
|
||||||
_7 of 12 people · 36 idea_
|
_7 of 12 people · 30 idea_
|
||||||
|
|
||||||
Self-hosting versus buying tokens.
|
Self-hosting versus buying tokens.
|
||||||
|
|
||||||
Points raised:
|
Points raised:
|
||||||
|
|
||||||
- point about Q6 from r06
|
- point about Q6 from r06
|
||||||
- point about Q1 from r07
|
|
||||||
- point about Q2 from r07
|
- point about Q2 from r07
|
||||||
- point about Q3 from r07
|
- point about Q3 from r07
|
||||||
- point about Q4 from r07
|
- point about Q4 from r07
|
||||||
- point about Q5 from r07
|
- point about Q5 from r07
|
||||||
- point about Q6 from r07
|
- point about Q6 from r07
|
||||||
- point about Q1 from r08
|
|
||||||
- point about Q2 from r08
|
- point about Q2 from r08
|
||||||
- point about Q3 from r08
|
- point about Q3 from r08
|
||||||
- point about Q4 from r08
|
- point about Q4 from r08
|
||||||
- point about Q5 from r08
|
- point about Q5 from r08
|
||||||
- point about Q6 from r08
|
- point about Q6 from r08
|
||||||
- point about Q7 from r08
|
- point about Q7 from r08
|
||||||
- point about Q1 from r09
|
- …and 18 more (full list in synthesis.json)
|
||||||
- point about Q2 from r09
|
|
||||||
- point about Q3 from r09
|
|
||||||
- point about Q4 from r09
|
|
||||||
- point about Q5 from r09
|
|
||||||
- point about Q1 from r10
|
|
||||||
- point about Q2 from r10
|
|
||||||
- point about Q3 from r10
|
|
||||||
- point about Q5 from r10
|
|
||||||
- point about Q6 from r10
|
|
||||||
- point about Q1 from r11
|
|
||||||
- point about Q2 from r11
|
|
||||||
- point about Q3 from r11
|
|
||||||
- point about Q4 from r11
|
|
||||||
- point about Q5 from r11
|
|
||||||
- point about Q6 from r11
|
|
||||||
- point about Q1 from r12
|
|
||||||
- point about Q2 from r12
|
|
||||||
- point about Q3 from r12
|
|
||||||
- point about Q4 from r12
|
|
||||||
- point about Q5 from r12
|
|
||||||
- point about Q7 from r12
|
|
||||||
|
|
||||||
> "I disagree with adding providers that" (r06, Q6)
|
> "I disagree with adding providers that" (r06, Q6)
|
||||||
> "I run a small nonprofit and" (r07, Q1)
|
> "Group accounts with a shared budget" (r07, Q2)
|
||||||
> "Governance nerd. I barely use the" (r08, Q1)
|
> "Publish a monthly financial and usage" (r08, Q2)
|
||||||
> "Needed an API for a side" (r09, Q1)
|
> "An Anthropic-compatible /v1/messages endpoint that is" (r09, Q2)
|
||||||
|
|
||||||
### 2. Institutional access
|
### 2. Institutional access
|
||||||
|
|
||||||
_6 of 12 people · 35 idea_
|
_6 of 12 people · 29 idea_
|
||||||
|
|
||||||
Group and org accounts.
|
Group and org accounts.
|
||||||
|
|
||||||
Points raised:
|
Points raised:
|
||||||
|
|
||||||
- point about Q1 from r01
|
|
||||||
- point about Q2 from r01
|
- point about Q2 from r01
|
||||||
- point about Q3 from r01
|
- point about Q3 from r01
|
||||||
- point about Q4 from r01
|
- point about Q4 from r01
|
||||||
- point about Q5 from r01
|
- point about Q5 from r01
|
||||||
- point about Q6 from r01
|
- point about Q6 from r01
|
||||||
- point about Q1 from r02
|
|
||||||
- point about Q2 from r02
|
- point about Q2 from r02
|
||||||
- point about Q3 from r02
|
- point about Q3 from r02
|
||||||
- point about Q4 from r02
|
- point about Q4 from r02
|
||||||
- point about Q5 from r02
|
- point about Q5 from r02
|
||||||
- point about Q6 from r02
|
- point about Q6 from r02
|
||||||
- point about Q7 from r02
|
- point about Q7 from r02
|
||||||
- point about Q1 from r03
|
|
||||||
- point about Q2 from r03
|
- point about Q2 from r03
|
||||||
- point about Q3 from r03
|
- …and 17 more (full list in synthesis.json)
|
||||||
- point about Q4 from r03
|
|
||||||
- point about Q5 from r03
|
|
||||||
- point about Q6 from r03
|
|
||||||
- point about Q1 from r04
|
|
||||||
- point about Q2 from r04
|
|
||||||
- point about Q3 from r04
|
|
||||||
- point about Q5 from r04
|
|
||||||
- point about Q1 from r05
|
|
||||||
- point about Q2 from r05
|
|
||||||
- point about Q3 from r05
|
|
||||||
- point about Q4 from r05
|
|
||||||
- point about Q5 from r05
|
|
||||||
- point about Q6 from r05
|
|
||||||
- point about Q7 from r05
|
|
||||||
- point about Q1 from r06
|
|
||||||
- point about Q2 from r06
|
|
||||||
- point about Q3 from r06
|
|
||||||
- point about Q4 from r06
|
|
||||||
- point about Q5 from r06
|
|
||||||
|
|
||||||
> "Privacy. I wanted an AI I" (r01, Q1)
|
> "A shared prompt library members can" (r01, Q2)
|
||||||
> "Green energy mostly. I teach and" (r02, Q1)
|
> "Classroom or group accounts: one payment," (r02, Q2)
|
||||||
> "Curiosity about co-op governance. I use" (r03, Q1)
|
> "An institutional or app-partner membership so" (r03, Q2)
|
||||||
> "A friend invited me. I mostly" (r04, Q1)
|
> "Voice mode on the phone app." (r04, Q2)
|
||||||
|
|
||||||
## Standout ideas
|
## Standout ideas
|
||||||
|
|
||||||
_Raised by one person, specific enough to be worth a look._
|
_Raised by one person, specific enough to be worth a look._
|
||||||
|
|
||||||
- **point about Q1 from r01** (idea)
|
- **point about Q2 from r01** (idea)
|
||||||
"Privacy. I wanted an AI I" (r01, Q1)
|
"A shared prompt library members can" (r01, Q2)
|
||||||
|
|
||||||
## Notable dissent
|
## Notable dissent
|
||||||
|
|
||||||
|
|||||||
Vendored
+15
-27
@@ -5,7 +5,7 @@
|
|||||||
"q": "Q1",
|
"q": "Q1",
|
||||||
"question": "What drew you to the co-op, and what do you use it for today?",
|
"question": "What drew you to the co-op, and what do you use it for today?",
|
||||||
"label": "point about Q1 from r01",
|
"label": "point about Q1 from r01",
|
||||||
"kind": "idea",
|
"kind": "context",
|
||||||
"stance": "for",
|
"stance": "for",
|
||||||
"quote": "Privacy. I wanted an AI I",
|
"quote": "Privacy. I wanted an AI I",
|
||||||
"iid": "i001"
|
"iid": "i001"
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
"q": "Q1",
|
"q": "Q1",
|
||||||
"question": "What drew you to the co-op, and what do you use it for today?",
|
"question": "What drew you to the co-op, and what do you use it for today?",
|
||||||
"label": "point about Q1 from r02",
|
"label": "point about Q1 from r02",
|
||||||
"kind": "idea",
|
"kind": "context",
|
||||||
"stance": "for",
|
"stance": "for",
|
||||||
"quote": "Green energy mostly. I teach and",
|
"quote": "Green energy mostly. I teach and",
|
||||||
"iid": "i007"
|
"iid": "i007"
|
||||||
@@ -135,7 +135,7 @@
|
|||||||
"q": "Q1",
|
"q": "Q1",
|
||||||
"question": "What drew you to the co-op, and what do you use it for today?",
|
"question": "What drew you to the co-op, and what do you use it for today?",
|
||||||
"label": "point about Q1 from r03",
|
"label": "point about Q1 from r03",
|
||||||
"kind": "idea",
|
"kind": "context",
|
||||||
"stance": "for",
|
"stance": "for",
|
||||||
"quote": "Curiosity about co-op governance. I use",
|
"quote": "Curiosity about co-op governance. I use",
|
||||||
"iid": "i014"
|
"iid": "i014"
|
||||||
@@ -195,7 +195,7 @@
|
|||||||
"q": "Q1",
|
"q": "Q1",
|
||||||
"question": "What drew you to the co-op, and what do you use it for today?",
|
"question": "What drew you to the co-op, and what do you use it for today?",
|
||||||
"label": "point about Q1 from r04",
|
"label": "point about Q1 from r04",
|
||||||
"kind": "idea",
|
"kind": "context",
|
||||||
"stance": "for",
|
"stance": "for",
|
||||||
"quote": "A friend invited me. I mostly",
|
"quote": "A friend invited me. I mostly",
|
||||||
"iid": "i020"
|
"iid": "i020"
|
||||||
@@ -235,7 +235,7 @@
|
|||||||
"q": "Q1",
|
"q": "Q1",
|
||||||
"question": "What drew you to the co-op, and what do you use it for today?",
|
"question": "What drew you to the co-op, and what do you use it for today?",
|
||||||
"label": "point about Q1 from r05",
|
"label": "point about Q1 from r05",
|
||||||
"kind": "idea",
|
"kind": "context",
|
||||||
"stance": "for",
|
"stance": "for",
|
||||||
"quote": "Wanted to support a cooperative alternative.",
|
"quote": "Wanted to support a cooperative alternative.",
|
||||||
"iid": "i024"
|
"iid": "i024"
|
||||||
@@ -305,7 +305,7 @@
|
|||||||
"q": "Q1",
|
"q": "Q1",
|
||||||
"question": "What drew you to the co-op, and what do you use it for today?",
|
"question": "What drew you to the co-op, and what do you use it for today?",
|
||||||
"label": "point about Q1 from r06",
|
"label": "point about Q1 from r06",
|
||||||
"kind": "idea",
|
"kind": "context",
|
||||||
"stance": "for",
|
"stance": "for",
|
||||||
"quote": "Privacy and the TEE story. Chat",
|
"quote": "Privacy and the TEE story. Chat",
|
||||||
"iid": "i031"
|
"iid": "i031"
|
||||||
@@ -365,7 +365,7 @@
|
|||||||
"q": "Q1",
|
"q": "Q1",
|
||||||
"question": "What drew you to the co-op, and what do you use it for today?",
|
"question": "What drew you to the co-op, and what do you use it for today?",
|
||||||
"label": "point about Q1 from r07",
|
"label": "point about Q1 from r07",
|
||||||
"kind": "idea",
|
"kind": "context",
|
||||||
"stance": "for",
|
"stance": "for",
|
||||||
"quote": "I run a small nonprofit and",
|
"quote": "I run a small nonprofit and",
|
||||||
"iid": "i037"
|
"iid": "i037"
|
||||||
@@ -425,7 +425,7 @@
|
|||||||
"q": "Q1",
|
"q": "Q1",
|
||||||
"question": "What drew you to the co-op, and what do you use it for today?",
|
"question": "What drew you to the co-op, and what do you use it for today?",
|
||||||
"label": "point about Q1 from r08",
|
"label": "point about Q1 from r08",
|
||||||
"kind": "idea",
|
"kind": "context",
|
||||||
"stance": "for",
|
"stance": "for",
|
||||||
"quote": "Governance nerd. I barely use the",
|
"quote": "Governance nerd. I barely use the",
|
||||||
"iid": "i043"
|
"iid": "i043"
|
||||||
@@ -495,7 +495,7 @@
|
|||||||
"q": "Q1",
|
"q": "Q1",
|
||||||
"question": "What drew you to the co-op, and what do you use it for today?",
|
"question": "What drew you to the co-op, and what do you use it for today?",
|
||||||
"label": "point about Q1 from r09",
|
"label": "point about Q1 from r09",
|
||||||
"kind": "idea",
|
"kind": "context",
|
||||||
"stance": "for",
|
"stance": "for",
|
||||||
"quote": "Needed an API for a side",
|
"quote": "Needed an API for a side",
|
||||||
"iid": "i050"
|
"iid": "i050"
|
||||||
@@ -545,7 +545,7 @@
|
|||||||
"q": "Q1",
|
"q": "Q1",
|
||||||
"question": "What drew you to the co-op, and what do you use it for today?",
|
"question": "What drew you to the co-op, and what do you use it for today?",
|
||||||
"label": "point about Q1 from r10",
|
"label": "point about Q1 from r10",
|
||||||
"kind": "idea",
|
"kind": "context",
|
||||||
"stance": "for",
|
"stance": "for",
|
||||||
"quote": "Climate reasons.",
|
"quote": "Climate reasons.",
|
||||||
"iid": "i055"
|
"iid": "i055"
|
||||||
@@ -595,7 +595,7 @@
|
|||||||
"q": "Q1",
|
"q": "Q1",
|
||||||
"question": "What drew you to the co-op, and what do you use it for today?",
|
"question": "What drew you to the co-op, and what do you use it for today?",
|
||||||
"label": "point about Q1 from r11",
|
"label": "point about Q1 from r11",
|
||||||
"kind": "idea",
|
"kind": "context",
|
||||||
"stance": "for",
|
"stance": "for",
|
||||||
"quote": "Wanted to try open-weight models without",
|
"quote": "Wanted to try open-weight models without",
|
||||||
"iid": "i060"
|
"iid": "i060"
|
||||||
@@ -655,7 +655,7 @@
|
|||||||
"q": "Q1",
|
"q": "Q1",
|
||||||
"question": "What drew you to the co-op, and what do you use it for today?",
|
"question": "What drew you to the co-op, and what do you use it for today?",
|
||||||
"label": "point about Q1 from r12",
|
"label": "point about Q1 from r12",
|
||||||
"kind": "idea",
|
"kind": "context",
|
||||||
"stance": "for",
|
"stance": "for",
|
||||||
"quote": "Someone mentioned it at a Metagov",
|
"quote": "Someone mentioned it at a Metagov",
|
||||||
"iid": "i066"
|
"iid": "i066"
|
||||||
@@ -717,37 +717,31 @@
|
|||||||
"name": "Institutional access",
|
"name": "Institutional access",
|
||||||
"summary": "Group and org accounts.",
|
"summary": "Group and org accounts.",
|
||||||
"item_ids": [
|
"item_ids": [
|
||||||
"i001",
|
|
||||||
"i002",
|
"i002",
|
||||||
"i003",
|
"i003",
|
||||||
"i004",
|
"i004",
|
||||||
"i005",
|
"i005",
|
||||||
"i006",
|
"i006",
|
||||||
"i007",
|
|
||||||
"i008",
|
"i008",
|
||||||
"i009",
|
"i009",
|
||||||
"i010",
|
"i010",
|
||||||
"i011",
|
"i011",
|
||||||
"i012",
|
"i012",
|
||||||
"i013",
|
"i013",
|
||||||
"i014",
|
|
||||||
"i015",
|
"i015",
|
||||||
"i016",
|
"i016",
|
||||||
"i017",
|
"i017",
|
||||||
"i018",
|
"i018",
|
||||||
"i019",
|
"i019",
|
||||||
"i020",
|
|
||||||
"i021",
|
"i021",
|
||||||
"i022",
|
"i022",
|
||||||
"i023",
|
"i023",
|
||||||
"i024",
|
|
||||||
"i025",
|
"i025",
|
||||||
"i026",
|
"i026",
|
||||||
"i027",
|
"i027",
|
||||||
"i028",
|
"i028",
|
||||||
"i029",
|
"i029",
|
||||||
"i030",
|
"i030",
|
||||||
"i031",
|
|
||||||
"i032",
|
"i032",
|
||||||
"i033",
|
"i033",
|
||||||
"i034",
|
"i034",
|
||||||
@@ -759,36 +753,30 @@
|
|||||||
"summary": "Self-hosting versus buying tokens.",
|
"summary": "Self-hosting versus buying tokens.",
|
||||||
"item_ids": [
|
"item_ids": [
|
||||||
"i036",
|
"i036",
|
||||||
"i037",
|
|
||||||
"i038",
|
"i038",
|
||||||
"i039",
|
"i039",
|
||||||
"i040",
|
"i040",
|
||||||
"i041",
|
"i041",
|
||||||
"i042",
|
"i042",
|
||||||
"i043",
|
|
||||||
"i044",
|
"i044",
|
||||||
"i045",
|
"i045",
|
||||||
"i046",
|
"i046",
|
||||||
"i047",
|
"i047",
|
||||||
"i048",
|
"i048",
|
||||||
"i049",
|
"i049",
|
||||||
"i050",
|
|
||||||
"i051",
|
"i051",
|
||||||
"i052",
|
"i052",
|
||||||
"i053",
|
"i053",
|
||||||
"i054",
|
"i054",
|
||||||
"i055",
|
|
||||||
"i056",
|
"i056",
|
||||||
"i057",
|
"i057",
|
||||||
"i058",
|
"i058",
|
||||||
"i059",
|
"i059",
|
||||||
"i060",
|
|
||||||
"i061",
|
"i061",
|
||||||
"i062",
|
"i062",
|
||||||
"i063",
|
"i063",
|
||||||
"i064",
|
"i064",
|
||||||
"i065",
|
"i065",
|
||||||
"i066",
|
|
||||||
"i067",
|
"i067",
|
||||||
"i068",
|
"i068",
|
||||||
"i069",
|
"i069",
|
||||||
@@ -799,7 +787,7 @@
|
|||||||
],
|
],
|
||||||
"unthemed": [],
|
"unthemed": [],
|
||||||
"novel": [
|
"novel": [
|
||||||
"i001"
|
"i002"
|
||||||
],
|
],
|
||||||
"dissent": [
|
"dissent": [
|
||||||
{
|
{
|
||||||
@@ -814,8 +802,8 @@
|
|||||||
{
|
{
|
||||||
"question": "Institutional tier?",
|
"question": "Institutional tier?",
|
||||||
"item_ids": [
|
"item_ids": [
|
||||||
"i001",
|
"i002",
|
||||||
"i002"
|
"i003"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ class FakeGateway(S.Gateway):
|
|||||||
if line.startswith("### "):
|
if line.startswith("### "):
|
||||||
head, _, _ = line[4:].partition(": ")
|
head, _, _ = line[4:].partition(": ")
|
||||||
rid, q = head.split(" / ")
|
rid, q = head.split(" / ")
|
||||||
items.append({"id": rid, "q": q, "label": f"point about {q} from {rid}", "kind": "idea", "stance": "for",
|
items.append({"id": rid, "q": q, "label": f"point about {q} from {rid}",
|
||||||
"quote": None})
|
"kind": "context" if q == "Q1" else "idea", "stance": "for", "quote": None})
|
||||||
elif items and items[-1]["quote"] is None and line.strip():
|
elif items and items[-1]["quote"] is None and line.strip():
|
||||||
items[-1]["quote"] = " ".join(line.split()[:6])
|
items[-1]["quote"] = " ".join(line.split()[:6])
|
||||||
items.append({"id": rid, "q": "Q1", "label": "fabricated", "kind": "concern", "stance": "against",
|
items.append({"id": rid, "q": "Q1", "label": "fabricated", "kind": "concern", "stance": "against",
|
||||||
@@ -155,15 +155,21 @@ class PipelineTests(unittest.TestCase):
|
|||||||
self.assertEqual(len(dropped), 3) # one fabricated quote per batch
|
self.assertEqual(len(dropped), 3) # one fabricated quote per batch
|
||||||
self.assertTrue(all(it["quote"] in " ".join(loaded["responses"][int(it["rid"][1:]) - 1]["answers"].values())
|
self.assertTrue(all(it["quote"] in " ".join(loaded["responses"][int(it["rid"][1:]) - 1]["answers"].values())
|
||||||
for it in items))
|
for it in items))
|
||||||
clusters = S.stage_cluster(gw, items, use_tools=False)
|
to_cluster, context, offers = S.split_items(items)
|
||||||
|
self.assertTrue(context and all(it["q"] == "Q1" for it in context))
|
||||||
|
self.assertFalse(any(it["kind"] in S.UNCLUSTERED_KINDS for it in to_cluster))
|
||||||
|
clusters = S.stage_cluster(gw, to_cluster, use_tools=False)
|
||||||
self.assertEqual(gw.calls, 4)
|
self.assertEqual(gw.calls, 4)
|
||||||
|
cluster_input = gw.posted[-1]["messages"][1]["content"]
|
||||||
|
self.assertNotIn(" context ", cluster_input)
|
||||||
|
self.assertFalse(set(it["iid"] for it in context) & set(clusters["unthemed"]))
|
||||||
self.assertEqual(len(clusters["themes"]), 2)
|
self.assertEqual(len(clusters["themes"]), 2)
|
||||||
self.assertEqual(clusters["open_questions"][1], {"question": "Bare string question", "item_ids": []})
|
self.assertEqual(clusters["open_questions"][1], {"question": "Bare string question", "item_ids": []})
|
||||||
|
|
||||||
# Same inputs again: everything served from cache, no network.
|
# Same inputs again: everything served from cache, no network.
|
||||||
gw2 = FakeGateway(cache_dir=Path(d) / "cache")
|
gw2 = FakeGateway(cache_dir=Path(d) / "cache")
|
||||||
S.stage_tag(gw2, loaded, batch_size=5, use_tools=False)
|
S.stage_tag(gw2, loaded, batch_size=5, use_tools=False)
|
||||||
S.stage_cluster(gw2, items, use_tools=False)
|
S.stage_cluster(gw2, to_cluster, use_tools=False)
|
||||||
self.assertEqual(gw2.calls, 0)
|
self.assertEqual(gw2.calls, 0)
|
||||||
self.assertEqual(gw2.cache_hits, 4)
|
self.assertEqual(gw2.cache_hits, 4)
|
||||||
|
|
||||||
@@ -172,6 +178,8 @@ class PipelineTests(unittest.TestCase):
|
|||||||
self.assertIn("# Coopertron 5000 report", md)
|
self.assertIn("# Coopertron 5000 report", md)
|
||||||
self.assertIn("## Priorities (pick up to 3)", md)
|
self.assertIn("## Priorities (pick up to 3)", md)
|
||||||
self.assertIn("**4** · privacy", md) # r01, r03, r06, r09 picked privacy
|
self.assertIn("**4** · privacy", md) # r01, r03, r06, r09 picked privacy
|
||||||
|
self.assertIn("## Why people joined", md)
|
||||||
|
self.assertNotIn("## Offers of help", md) # the fake never emits offers
|
||||||
self.assertIn("### 1. ", md)
|
self.assertIn("### 1. ", md)
|
||||||
self.assertIn("Institutional access", md)
|
self.assertIn("Institutional access", md)
|
||||||
self.assertIn("Own the stack", md)
|
self.assertIn("Own the stack", md)
|
||||||
@@ -209,6 +217,29 @@ class PipelineTests(unittest.TestCase):
|
|||||||
self.assertEqual(gw.calls, 2)
|
self.assertEqual(gw.calls, 2)
|
||||||
|
|
||||||
|
|
||||||
|
class RenderTests(unittest.TestCase):
|
||||||
|
def test_offers_section_and_points_cap(self):
|
||||||
|
loaded = S.load_responses(FIX / "sample.csv")
|
||||||
|
r01 = loaded["responses"][0]
|
||||||
|
q2 = loaded["questions"][1]
|
||||||
|
words = r01["answers"][q2].split()
|
||||||
|
items = [{"iid": f"i{n:03d}", "rid": "r01", "q": "Q2", "label": f"distinct point {n}", "kind": "idea",
|
||||||
|
"stance": "for", "quote": " ".join(words[:3])} for n in range(1, 16)]
|
||||||
|
items.append({"iid": "i999", "rid": "r01", "q": "Q2", "label": "volunteers to run the prompt library",
|
||||||
|
"kind": "offer", "stance": "for", "quote": " ".join(words[:4])})
|
||||||
|
to_cluster, context, offers = S.split_items(items)
|
||||||
|
self.assertEqual(len(offers), 1)
|
||||||
|
self.assertEqual(len(to_cluster), 15)
|
||||||
|
clusters = {"themes": [{"name": "Big theme", "summary": "", "item_ids": [it["iid"] for it in to_cluster]}],
|
||||||
|
"unthemed": [], "novel": [], "dissent": [], "open_questions": []}
|
||||||
|
md = S.render(loaded, items, clusters, {"date": "2026-10-27", "source": "x.csv", "model": "m", "dropped": []})
|
||||||
|
self.assertIn("## Offers of help", md)
|
||||||
|
self.assertIn("**volunteers to run the prompt library**", md)
|
||||||
|
self.assertIn(f"…and {15 - S.POINTS_PER_THEME} more", md)
|
||||||
|
self.assertEqual(md.count("- distinct point "), S.POINTS_PER_THEME)
|
||||||
|
self.assertNotIn("## Why people joined", md)
|
||||||
|
|
||||||
|
|
||||||
class ReasoningExhaustionTests(unittest.TestCase):
|
class ReasoningExhaustionTests(unittest.TestCase):
|
||||||
def test_fails_fast_without_retry(self):
|
def test_fails_fast_without_retry(self):
|
||||||
os.environ[S.KEY_ENV] = "sk-test-not-real"
|
os.environ[S.KEY_ENV] = "sk-test-not-real"
|
||||||
|
|||||||
Reference in new issue
Block a user