linersh 1.1.2 → 1.2.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/README.md +12 -58
- package/bin/liner.js +62 -14
- package/package.json +10 -17
- package/cli-update-docs/README.md +0 -129
- package/cli-update-docs/SKILL.md +0 -294
- package/cli-update-docs/curator-notes.md +0 -85
- package/cli-update-docs/quality-check-tests.md +0 -435
- package/cli-update-docs/source-finding-tactics.md +0 -224
- package/cli-update-docs/source-quality-hierarchy.md +0 -209
- package/cli-update-docs/synthesis-guidance.md +0 -151
- package/dist/agents/artifact-validation.js +0 -567
- package/dist/agents/artifact-validation.js.map +0 -1
- package/dist/agents/candidate-longlist.js +0 -116
- package/dist/agents/candidate-longlist.js.map +0 -1
- package/dist/agents/detect.js +0 -169
- package/dist/agents/detect.js.map +0 -1
- package/dist/agents/evaluation-assembly.js +0 -270
- package/dist/agents/evaluation-assembly.js.map +0 -1
- package/dist/agents/events.js +0 -8
- package/dist/agents/events.js.map +0 -1
- package/dist/agents/headless-runner.js +0 -432
- package/dist/agents/headless-runner.js.map +0 -1
- package/dist/agents/jtbd-clarify.js +0 -169
- package/dist/agents/jtbd-clarify.js.map +0 -1
- package/dist/agents/models.js +0 -98
- package/dist/agents/models.js.map +0 -1
- package/dist/agents/parsers.js +0 -316
- package/dist/agents/parsers.js.map +0 -1
- package/dist/agents/prompts.js +0 -522
- package/dist/agents/prompts.js.map +0 -1
- package/dist/agents/run-log.js +0 -71
- package/dist/agents/run-log.js.map +0 -1
- package/dist/agents/runner.js +0 -906
- package/dist/agents/runner.js.map +0 -1
- package/dist/agents/types.js +0 -2
- package/dist/agents/types.js.map +0 -1
- package/dist/bin-resolver.js +0 -92
- package/dist/bin-resolver.js.map +0 -1
- package/dist/config.js +0 -282
- package/dist/config.js.map +0 -1
- package/dist/editor.js +0 -40
- package/dist/editor.js.map +0 -1
- package/dist/gates.js +0 -121
- package/dist/gates.js.map +0 -1
- package/dist/ipc.js +0 -145
- package/dist/ipc.js.map +0 -1
- package/dist/open-folder.js +0 -28
- package/dist/open-folder.js.map +0 -1
- package/dist/phases.js +0 -346
- package/dist/phases.js.map +0 -1
- package/dist/progress.js +0 -184
- package/dist/progress.js.map +0 -1
- package/dist/source-inbox.js +0 -297
- package/dist/source-inbox.js.map +0 -1
- package/dist/types.js +0 -3
- package/dist/types.js.map +0 -1
- package/dist/version.js +0 -18
- package/dist/version.js.map +0 -1
- package/dist/yaml-io.js +0 -376
- package/dist/yaml-io.js.map +0 -1
- package/maintenance-skill/SKILL.md +0 -18
- package/maintenance-skill/agents/openai.yaml +0 -4
package/dist/agents/prompts.js
DELETED
|
@@ -1,522 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
/**
|
|
4
|
-
* Companion files referenced by each phase per SKILL.md. The agent is told
|
|
5
|
-
* which ones to read at the top of the relevant phase.
|
|
6
|
-
*/
|
|
7
|
-
const COMPANIONS = {
|
|
8
|
-
candidates: ["source-finding-tactics.md"],
|
|
9
|
-
evaluation: ["source-quality-hierarchy.md", "curator-notes.md"],
|
|
10
|
-
quality: ["quality-check-tests.md"],
|
|
11
|
-
synthesis: ["synthesis-guidance.md"],
|
|
12
|
-
};
|
|
13
|
-
export const WORKSPACE_DISCIPLINE = `# Workspace discipline
|
|
14
|
-
|
|
15
|
-
- Treat the project folder as a mixtape artifact folder, not a git worktree, unless a \`.git\` directory is actually present there or you are explicitly inspecting a source repository that belongs to the corpus.
|
|
16
|
-
- Do not run \`git diff\`, \`git status\`, or repository introspection in the mixtape project folder just to verify generated artifacts. Use file reads and parsers against the specific artifact paths you wrote.
|
|
17
|
-
- For validation snippets, prefer Node.js or Python. If you use Ruby, stay compatible with Ruby 2.6 and do not use newer helpers such as \`Array#tally\`.
|
|
18
|
-
- Keep shell checks narrow: read or parse the required artifacts, then stop.`;
|
|
19
|
-
const PHASE_INSTRUCTIONS = {
|
|
20
|
-
improvement: `## Improve Corpus — incremental Source delta
|
|
21
|
-
|
|
22
|
-
You are working in an isolated staging copy of the current accepted Project Snapshot. Read \`.liner-current-snapshot.json\` first; it is the fixed Core-owned baseline containing the Project ID, revision, accepted Source IDs, and active-instruction state. Then read \`tape.yaml\`, \`working/01-jtbd-and-knowledge-map.md\`, \`working/04-quality-checks.md\`, \`working/05-operating-fit-audit.md\` when present, and \`synthesis.md\`. This is a focused improvement pass, not initial Corpus Creation. Writes in this workspace cannot change canonical Project artifacts.
|
|
23
|
-
|
|
24
|
-
- Identify only the missing source roles and concrete search lanes named by the operating-fit audit.
|
|
25
|
-
- Search and evaluate enough focused evidence to close those gaps; preserve every accepted Source exactly as it is, including every immutable Source ID and active state.
|
|
26
|
-
- The default operation is add/dedupe. Do not infer removal or replacement from quality judgments, duplication, age, preference, or a stronger candidate.
|
|
27
|
-
- A removal or replacement requires separate explicit curator intent captured through guided Source maintenance. This phase has no such intent surface, so \`removals\` and \`replacements\` must stay empty.
|
|
28
|
-
- Do not modify \`tape.yaml\`. Do not modify \`synthesis.md\`. Do not modify anything under \`working/\`. The TUI will ask Liner Core to classify duplicates and stage one atomic Change Set after this run.
|
|
29
|
-
|
|
30
|
-
Write exactly one staging artifact to \`.liner-runs/improvement/delta.yaml\`:
|
|
31
|
-
|
|
32
|
-
\`\`\`yaml
|
|
33
|
-
contract: liner.improvement_delta
|
|
34
|
-
version: 1
|
|
35
|
-
summary: One sentence naming the focused gap this delta closes.
|
|
36
|
-
additions:
|
|
37
|
-
- type: web
|
|
38
|
-
url: https://example.com/substantive-source
|
|
39
|
-
note: |
|
|
40
|
-
Role: Name the missing evidence job this source fills.
|
|
41
|
-
Value: Name the useful content and where it is.
|
|
42
|
-
Limitation: Name a real boundary.
|
|
43
|
-
section: relevant-section
|
|
44
|
-
priority: required
|
|
45
|
-
kind: example
|
|
46
|
-
removals: []
|
|
47
|
-
replacements: []
|
|
48
|
-
\`\`\`
|
|
49
|
-
|
|
50
|
-
Every addition must be a complete valid Source with \`type\`, its typed locator (\`url\` or \`path\`), \`priority\`, and \`kind\`. Include a curator note and section when the source type supports them. It is safe to propose a locator already in the corpus: Core will classify it as an exact duplicate before review and retain the existing immutable Source ID. Stop after validating and writing the staging artifact.`,
|
|
51
|
-
framing: `## Phase 1 — Framing
|
|
52
|
-
|
|
53
|
-
Define the reusable AI capability, derive the internal job-to-be-done, and sketch the knowledge map.
|
|
54
|
-
|
|
55
|
-
- The user provided a plain-language capability goal in \`tape.yaml.jtbd\` and \`working/01-jtbd-and-knowledge-map.md\`: what this Liner should help a future AI agent do. Read both.
|
|
56
|
-
- Treat that field as user intent, not as a finished formal JTBD. The user should not have to know research lanes, source categories, or Job Story syntax.
|
|
57
|
-
- **Read \`tape.yaml.jtbd_clarifications\` if present.** Those are the user's answers to sharpening questions about capability boundaries, output behavior, quality anchors, constraints, and future-agent autonomy. Use them to derive the research plan.
|
|
58
|
-
- Write a Capability Brief before the knowledge map: what future AI sessions should be able to do, the exact runtime output contract, the internal JTBD, inferred research lanes, required source roles/exclusions, and runtime behavior for the future agent. The output contract is required for every capability pattern, not only reference-translation.
|
|
59
|
-
- Use these exact level-three headings inside the Capability Brief so the Operating Layer can promote the contract reliably: \`### Reusable AI capability\`, \`### Exact runtime output contract\`, \`### Internal job-to-be-done\`, \`### Inferred research lanes\`, \`### Required source roles\`, \`### Source exclusions\`, and \`### Runtime autonomy, abstention, and escalation\`.
|
|
60
|
-
- Runtime behavior must distinguish missing evidence that blocks a reliable conclusion from evidence that merely limits confidence. Ask targeted questions only for blocking gaps; otherwise proceed with a bounded result that labels observations, inferences, unknowns, and verification needs.
|
|
61
|
-
- For sensitive data, consent, security, privacy, irreversible actions, regulated contexts, or vulnerable users, specify when the future agent must abstain, request authoritative evidence, or escalate to human review. Never infer compliance, safety, accessibility, or release readiness from screenshots alone.
|
|
62
|
-
- The Capability Brief must include a **Required source roles** subsection. Source roles are capability-specific evidence jobs, not generic kinds. Derive them from what the future AI must do. Typical roles include: core-action methods, domain/primary authority, worked examples or case studies, implementation constraints, critique/validation evidence, dissenting practitioner voice, and domain-specific data. Delete roles that do not fit; add roles the capability clearly needs.
|
|
63
|
-
- For each required source role, name why it matters, what good evidence looks like, and the minimum kept/trim sources the corpus needs. Defaults: at least 2 strong sources for required roles; at least 3 substantive worked examples/case studies when the capability depends on taste, visual output, craft judgment, or recognizing quality; primary/official sources for legal, medical, financial, or safety-sensitive authority roles.
|
|
64
|
-
- Detect specialized **capability patterns** and write them into the Capability Brief. If the goal involves images, moodboards, visual references, inspiration, style, art direction, examples, or translating one medium/domain into another output, mark \`Capability pattern: reference-translation\`. For that pattern, source roles must separate: input/reference-domain interpretation, cross-domain translation method, target-output constraints, critique/clarification, and caller handoff language. Output-medium implementation sources are bridge evidence; they cannot satisfy the input/reference-domain or translation-method roles by themselves.
|
|
65
|
-
- For \`reference-translation\`, the brief must name the runtime output contract. It should say what the future agent returns to the caller, such as observations, interpretation, carry-forward principles, product/interface vocabulary, implementation constraints, avoid-list, validation checks, and clarification questions.
|
|
66
|
-
- The internal JTBD must be hyper-specific, not a broad topic. "SEO" is too broad; "SEO keyword research for a mental-health startup specialized in brain surgery" is specific enough to research.
|
|
67
|
-
- If the capability is still too broad after clarifications, push back in your output and ask the user to revise.
|
|
68
|
-
- The knowledge map is 4–8 sections, each with a few sub-areas. Treat it as a hypothesis to be revised during research. If multiple domains are needed for the capability, sections must visibly cover each one — uneven coverage is a framing failure.
|
|
69
|
-
|
|
70
|
-
**You MUST remove the placeholder line** \`TODO — Phase 1 replaces this with 4–8 sections…\` from working/01-jtbd-and-knowledge-map.md as part of writing the real knowledge map. That sentinel is how the TUI knows Phase 1 has been completed — leaving it in place will keep the hub's progress cursor stuck on Framing even after you write good content.
|
|
71
|
-
|
|
72
|
-
Write the result to working/01-jtbd-and-knowledge-map.md (overwriting placeholders including the sentinel above, keeping the user's original capability line visible and adding your derived Capability Brief). Stop after this file is written. Do not start Phase 2.`,
|
|
73
|
-
candidates: `## Phase 2 — Candidate discovery
|
|
74
|
-
|
|
75
|
-
Read working/01-jtbd-and-knowledge-map.md for the Capability Brief, internal JTBD, research lanes, and knowledge map. Then read the companion file \`source-finding-tactics.md\` in the skill bundle.
|
|
76
|
-
|
|
77
|
-
- Generate a long-list of candidate sources covering every section of the knowledge map. URLs and titles only — NO fetching yet.
|
|
78
|
-
- Cover the **Required source roles** from the Capability Brief, not only the knowledge-map sections. Each candidate reason should name the source role it may satisfy. If a role is required, aim for 3–6 plausible candidates before stopping; if no good candidates exist, write a "Role gaps" note in the long-list.
|
|
79
|
-
- Aim wide enough for the evidence contract: roughly 2–4× the eventual kept count, but derive the candidate count from the Required source roles, capability pattern, and source ecology rather than a fixed target.
|
|
80
|
-
- **Verify each URL exists** via WebFetch (or your fetch tool) — AI hallucinates URLs that sound plausible. A 404 candidate is worse than a missing one.
|
|
81
|
-
- For each candidate, capture: URL, title, one-line reason it's a candidate.
|
|
82
|
-
- If \`tape.yaml\` already has curator-provided web or YouTube sources, seed the long-list with those URLs before searching. Treat local files and skill sources as curator-provided context that should inform the reasons and sections, even when they are not URL candidates.
|
|
83
|
-
- **Find sources for the capability, not just the topic.** Extract the core future-agent action from the Capability Brief ("translate moodboards into UI direction", "debug failing CI", "write grant narratives", "generate medical SEO keyword clusters") and make sure the long-list includes sources that directly teach, demonstrate, or constrain that action. Implementation references, design-system docs, tooling docs, or process articles may be useful bridge sources, but they cannot satisfy the core action by themselves.
|
|
84
|
-
- **Deepen curator-named anchors.** When the curator names a person, studio, product, software, channel, or example they like, research why that anchor matters: their case studies, interviews, talks, docs, essays, YouTube appearances, or worked examples. Do not stop at a homepage/gallery/crawler result unless no deeper readable source exists, and say so in the reason.
|
|
85
|
-
- **For visual-output JTBDs, include visual and worked-example evidence.** If the job involves images, moodboards, art, posters, editorial design, interface concepts, or craft taste, search for image-heavy examples, case studies, design breakdowns, portfolios with rationale, talks, or videos. A corpus made mostly of UX primers, CSS references, and design-system docs is probably under-serving the job even if every knowledge-map section has a source.
|
|
86
|
-
- **For reference-translation capabilities, build a source ecology.** If Phase 1 marked \`Capability pattern: reference-translation\`, the candidate list must include candidates for at least two input/reference domains outside the target output medium, plus candidates that teach the translation move and candidates that demonstrate handoff language for the caller. For an art-direction-to-web project, web craft and accessibility sources are bridge/constraint candidates; they do not replace sources from visual culture, art direction, graphic design, architecture/interiors, photography/film, fashion, packaging, sports/media identity, or other source worlds named or implied by the goal.
|
|
87
|
-
- **If this is an improvement pass, use the audit.** If \`working/05-operating-fit-audit.md\` exists with \`status: improvement_recommended\`, treat this run as a focused second pass. Preserve the strongest existing source roles, search for the missing roles named in the audit, and rebuild the candidate list around the gap instead of restarting from the generic topic.
|
|
88
|
-
|
|
89
|
-
**Bounded search discipline:** Phase 2 should produce a useful long-list, not exhaust the internet. Count coverage by source roles and capability-pattern lanes, not by a universal source target. For ordinary narrow projects, stop when every required role and central knowledge-map section has enough candidates; that may be under 20. For broad, multi-domain, or \`reference-translation\` projects, continue past 30 when needed until each required role and each declared input/reference domain has 3–6 plausible verified candidates, usually topping out around 40–60 unless the Capability Brief explicitly needs more. If added candidates are redundant or low-signal, stop and write a Role gaps note instead of padding. If a URL cannot be verified after one direct attempt and one alternate search, skip it or include a nearby verified substitute instead of continuing to chase it.
|
|
90
|
-
|
|
91
|
-
**Search YouTube too, not just the web.** Liner fetches video transcripts and titles automatically (\`youtube.com/watch?v=…\` and \`youtu.be/…\` URLs are first-class sources). For most JTBDs there will be conference talks, lectures, or long-form interviews on YouTube that cover the topic from a different angle than written articles do. Look there explicitly. The quality hierarchy (in \`source-quality-hierarchy.md\`) treats conference talks from credible speakers as tier-3 sources — equal in standing to expert articles. Skip TED-style talks unless density is unusually high.
|
|
92
|
-
|
|
93
|
-
Write to working/02-candidate-longlist.md, grouped by knowledge-map section. Replace the placeholder entirely. Stop after this file is written; do not keep searching after you have enough candidates.
|
|
94
|
-
|
|
95
|
-
⚠ Bias correction: do NOT default to popular/recent sources. Search deliberately for primary sources (specs, canonical papers, official docs, foundational books). Mix media types — articles, YouTube talks/lectures, papers, primary docs.`,
|
|
96
|
-
evaluation: `## Phase 4 — Evaluation
|
|
97
|
-
|
|
98
|
-
Read working/02-candidate-longlist.md. Then read the companion files \`source-quality-hierarchy.md\` and \`curator-notes.md\` in the skill bundle. Then fetch each candidate's content (transcripts for YouTube; readable body for web articles).
|
|
99
|
-
|
|
100
|
-
**Bounded fetch discipline:** do not get stuck chasing unavailable content. Try one direct fetch/read per candidate. If that fails, make at most one recovery attempt (alternate transcript source, search result, mirror, or metadata page). After two failed retrieval attempts total, stop searching for that candidate and evaluate from verified metadata, the Phase 2 reason, and whatever partial content is available. Usually that means \`dropped\`. Do not mark a source \`kept\` or \`trim\` from title, URL, search snippet, crawler metadata, or model memory alone.
|
|
101
|
-
|
|
102
|
-
Every candidate still needs a decision in the YAML: keep / trim / drop against the JTBD. For kept and trimmed sources, write a rating (1–5), a \`jtbd_fit\` label, a primary \`source_role\` from the Capability Brief when available, fetch evidence, a content-quality judgment, and a curator note in the three-thing template (role / where the value is / limitations).
|
|
103
|
-
|
|
104
|
-
**Evidence contract for kept/trimmed sources:**
|
|
105
|
-
- \`fetch_status: readable | partial\`. Use \`readable\` when you retrieved the substantive article/transcript/PDF body. Use \`partial\` when you retrieved enough real source content to judge, such as an abstract plus substantial excerpt. If the page is \`metadata_only\` or \`unavailable\`, the decision must be \`dropped\`.
|
|
106
|
-
- \`content_quality: high | medium\`. If the readable content is shallow, generic, AI-slop, SEO filler, a homepage/gallery with no rationale, or otherwise low-value, mark it \`dropped\` instead of keeping it.
|
|
107
|
-
- \`evidence:\` at least two content-specific evidence bullets from the fetched/read source. These are not quotes; they are concrete claims, sections, examples, transcript moments, or methods you actually saw in the content. Search snippets, titles, and model memory do not count.
|
|
108
|
-
|
|
109
|
-
**JTBD-fit labels are required for kept and trimmed sources**:
|
|
110
|
-
- \`direct\` — teaches, demonstrates, or argues for the core action in the JTBD.
|
|
111
|
-
- \`bridge\` — helps execute the result after the core decision is made, such as implementation mechanics, tokens, layout, or process.
|
|
112
|
-
- \`background\` — broad context, vocabulary, or primer material. Background sources should rarely be \`required\`.
|
|
113
|
-
|
|
114
|
-
If a section contains only \`bridge\` or \`background\` sources, the evaluation must say it is weak coverage and either backfill a direct source or mark the section as a known gap. Do not let topic adjacency pass as JTBD fit.
|
|
115
|
-
|
|
116
|
-
**Source-role discipline**:
|
|
117
|
-
- Assign each kept/trim source to the strongest matching required source role. If it does not satisfy any required role, mark \`source_role: supporting/background\` and explain why it is still worth keeping.
|
|
118
|
-
- Do not count a homepage, gallery index, metadata page, or shallow listicle as satisfying a worked-example/case-study role unless the fetched content includes real rationale, process, analysis, or artifacts the future AI can learn from.
|
|
119
|
-
- For visual-output, taste, craft, or example-dependent capabilities, one or two examples is a warning sign, not a pass. Prefer several distinct worked examples with rationale over more primers.
|
|
120
|
-
- For \`reference-translation\` capabilities, direct fit means the source either teaches how to read/interpret the input reference domain or demonstrates a real translation from reference qualities into target-output decisions. Target-medium implementation mechanics, accessibility specs, token formats, and style-guide infrastructure are usually \`bridge\` fit unless they explicitly teach that translation move.
|
|
121
|
-
|
|
122
|
-
**Chunked decision discipline:** do not hold all decisions in conversation memory until the end. Create \`working/evaluation-decisions/\` and, after each knowledge-map section or every ~10 candidates, write/update a small YAML fragment there. Use filenames like \`01-foundations.yaml\`, \`02-patterns.yaml\`, etc. Each fragment uses the same \`candidates:\` list shape shown below and must include every candidate from that section/chunk. Liner can assemble \`working/03-evaluation.yaml\` from these fragments in the original longlist order.
|
|
123
|
-
|
|
124
|
-
**Artifact closure discipline:** write \`working/03-evaluation.yaml\` as soon as you have enough evidence to decide. Do not announce that you are "ready to write" before writing either the fragments or the final file. For dropped candidates, keep the entry compact: URL, title, decision, section if known, and one rationale sentence. Rating and note are required only for \`kept\` and \`trim\`. If the final YAML is long, prioritize complete fragments in \`working/evaluation-decisions/\`; Liner will assemble and validate the final YAML.
|
|
125
|
-
|
|
126
|
-
Write decisions to working/03-evaluation.yaml in the format:
|
|
127
|
-
|
|
128
|
-
\`\`\`yaml
|
|
129
|
-
candidates:
|
|
130
|
-
- url: https://...
|
|
131
|
-
title: ...
|
|
132
|
-
decision: kept # kept | trim | dropped
|
|
133
|
-
rating: 5
|
|
134
|
-
jtbd_fit: direct # direct | bridge | background
|
|
135
|
-
source_role: core-action method
|
|
136
|
-
fetch_status: readable # readable | partial; metadata_only/unavailable must be dropped
|
|
137
|
-
content_quality: high # high | medium; low must be dropped
|
|
138
|
-
evidence:
|
|
139
|
-
- The fetched source includes a specific method/example/argument, not just a title.
|
|
140
|
-
- Another source-specific detail that proves the content was read.
|
|
141
|
-
section: foundations
|
|
142
|
-
rationale: One specific sentence.
|
|
143
|
-
note: |
|
|
144
|
-
Multi-line curator note for kept/trim sources. Use the three-thing template.
|
|
145
|
-
\`\`\`
|
|
146
|
-
|
|
147
|
-
Stop after the fragments and/or final file are written. Do not draft synthesis yet.`,
|
|
148
|
-
quality: `## Phase 5 — Quality checks
|
|
149
|
-
|
|
150
|
-
Read working/03-evaluation.yaml. Then read \`quality-check-tests.md\` in the skill bundle — note especially the strengthened framing-gap rules below.
|
|
151
|
-
|
|
152
|
-
**Bounded quality discipline:** Phase 5 is an audit of the evaluated corpus, not a fresh research phase. Start from the existing \`kept\` and \`trim\` entries in \`working/03-evaluation.yaml\`. If those entries lack \`kind\`, assign \`reference / principle / prescription / example\` from the title, note, section, rating, and source type before you consider any search. Missing \`kind\` metadata is not itself a reason to backfill.
|
|
153
|
-
|
|
154
|
-
When enriching \`working/03-evaluation.yaml\`, update only fields that are missing or intentionally changing; never insert a second copy of an existing YAML key. After every edit, parse the file with a strict duplicate-key-rejecting YAML parser. Ruby \`YAML.load_file\` and permissive PyYAML loads are not sufficient validation because they silently accept duplicate mapping keys.
|
|
155
|
-
|
|
156
|
-
Run the core-action test, then the eight standard tests against the keep-list:
|
|
157
|
-
0. Core-action fit — what is the exact action in the JTBD, and which kept sources directly teach or demonstrate it?
|
|
158
|
-
1. Redundancy — any two kept sources making essentially the same point?
|
|
159
|
-
2. Coverage — any knowledge-map section with zero sources?
|
|
160
|
-
3. Disagreement — strongest claim with a credible counter included?
|
|
161
|
-
4. Framing-gap — is any whole way of thinking about the JTBD missing?
|
|
162
|
-
5. Source-kind balance — distribution across the four kinds. Any kind at zero must be defended or backfilled.
|
|
163
|
-
6. Note-quality — does each kept/trim curator note say how to use the source, what value/bar it provides, and one limitation or boundary?
|
|
164
|
-
7. Source-role fit — do the kept/trim sources satisfy the Required source roles named in the Capability Brief?
|
|
165
|
-
8. Capability-pattern fit — if Phase 1 named a specialized pattern such as \`reference-translation\`, does the corpus satisfy the pattern-specific evidence contract?
|
|
166
|
-
|
|
167
|
-
**Core-action fit rules (strict)**:
|
|
168
|
-
|
|
169
|
-
- Quote or paraphrase the JTBD's core action before judging the source list.
|
|
170
|
-
- Count kept sources by \`jtbd_fit\`: \`direct / bridge / background\`. If older entries lack \`jtbd_fit\`, infer it from the title, rationale, note, and section, then update \`working/03-evaluation.yaml\`.
|
|
171
|
-
- A healthy action-oriented mixtape needs at least two \`direct\` kept sources, and every central knowledge-map section needs either one \`direct\` source or an explicit reason why a \`bridge\` source is sufficient.
|
|
172
|
-
- Curator-named anchors do not count as direct fit if the fetched source is only a homepage, gallery index, metadata page, or unreadable pointer. They may be taste anchors, but the quality report must say whether their rationale/process was actually retrieved.
|
|
173
|
-
- If the direct count is weak, take exactly one action: backfill direct sources within the Phase 5 search budget, or document the gap and recommend re-running Candidate discovery with action-specific search terms.
|
|
174
|
-
|
|
175
|
-
**Framing-gap test rules (strict)**:
|
|
176
|
-
|
|
177
|
-
- Before looking at the keep-list, NAME 2–3 candidate perspectives that could exist outside the corpus (e.g. designer voice, accessibility-first viewpoint, security/abuse perspective, contrarian, adjacent discipline). Write them into working/04-quality-checks.md.
|
|
178
|
-
- For each named perspective, classify coverage in TWO dimensions:
|
|
179
|
-
- **Stance** — is there a verified source whose author *argues for* this perspective as a design center of gravity? \`stance-represented\` or \`stance-absent\`.
|
|
180
|
-
- **Concerns** — do any kept sources address the perspective's operational concerns, even from a different stance? \`concerns-addressed\` or \`concerns-absent\`.
|
|
181
|
-
A perspective is fully covered only when its stance is represented. \`concerns-addressed\` alone is a SOFT GAP — the corpus internalizes the concern without giving the consuming AI a worked rival argument to cite.
|
|
182
|
-
- **Unverified sources do NOT count.** A source whose Phase 4 note acknowledges unfetched content, broken URLs, or unobtainable transcripts cannot satisfy a perspective slot. Tokenism is the failure mode this rule prevents.
|
|
183
|
-
- For each perspective that is not \`stance-represented\`, take exactly one of three actions:
|
|
184
|
-
- **(a) Search for a stance source.** Vocabulary: who would *argue for* this position, what would they write, where would they publish? (e.g., "Brandur Leach on terminal density," not "CLI scriptability best practices.") One search pass; if a verified source fits, add it.
|
|
185
|
-
- **(b) Argue concerns are sufficient.** Write the argument explicitly: "Concerns covered by [Sources N, M] inside the [dominant] stance. The dissenting stance is real but its operational implications are absorbed; no separate source needed." Not a free pass — if you can't articulate the trade-off, fall back to (a) or (c).
|
|
186
|
-
- **(c) Flag the bias explicitly.** Document: "Perspective: [name] — stance unrepresented after one search pass. Corpus argues from [X] but no source argues for [Y]. Recommendation: ship + document, OR weaken the JTBD claim."
|
|
187
|
-
|
|
188
|
-
**Search budget for Phase 5**:
|
|
189
|
-
|
|
190
|
-
- Use at most one search pass for any single missing perspective.
|
|
191
|
-
- Use at most one source-kind backfill search total, and only after assigning kinds to every existing kept/trim source.
|
|
192
|
-
- Do not exceed four external search/fetch attempts for the whole Quality phase. If the budget is spent, stop searching, document the gap or defense, and write \`working/04-quality-checks.md\`.
|
|
193
|
-
- If you backfill a source during Quality, add its URL to \`working/02-candidate-longlist.md\` before adding or changing its entry in \`working/03-evaluation.yaml\`. Parse both artifacts and confirm their candidate counts still match before reporting the phase complete.
|
|
194
|
-
- On resume after a paused/cancelled Quality run, do not continue a search loop. Use the evidence already gathered, finish the kind assignments, and write the quality report.
|
|
195
|
-
|
|
196
|
-
**Source-kind balance rules**:
|
|
197
|
-
|
|
198
|
-
- The four kinds are \`reference / principle / prescription / example\`. They represent four argumentative roles in the corpus.
|
|
199
|
-
- If existing kept/trim entries are missing \`kind\`, classify them first. Use \`reference\` for specs/manuals/API docs, \`principle\` for essays/arguments, \`prescription\` for style guides/rules/how-to guidance, and \`example\` for case studies/demos/worked products. Update \`working/03-evaluation.yaml\` with those assignments.
|
|
200
|
-
- Count the distribution. A zero in any column is a decision, not an accident.
|
|
201
|
-
- 0 \`reference\` → no substrate authority. 0 \`principle\` → no philosophical anchor. 0 \`prescription\` → no concrete rules. 0 \`example\` → no taste calibration.
|
|
202
|
-
- For each zero, either backfill (one search pass for a source of that role) or write a defense: "Kinds audit: X/Y/Z/W. Accepted: [reason this JTBD legitimately doesn't need that kind]."
|
|
203
|
-
|
|
204
|
-
**Note-quality rules**:
|
|
205
|
-
|
|
206
|
-
- Review every kept/trim entry's \`note\`. A useful curator note must do three jobs: name how to use/read the source, name the concrete value or quality bar it contributes, and name one limitation, scope boundary, or reason not to over-weight it.
|
|
207
|
-
- If a note is filler, generic, or only says "useful background", repair it in \`working/03-evaluation.yaml\` before moving to synthesis. Do not fetch/search just to repair prose; use the already gathered rationale, title, source type, section, and partial content.
|
|
208
|
-
- In \`working/04-quality-checks.md\`, report how many notes were checked, how many were repaired, and cite the source titles or URLs for any repairs.
|
|
209
|
-
|
|
210
|
-
**Source-role fit rules (strict)**:
|
|
211
|
-
|
|
212
|
-
- Read the Required source roles from the Capability Brief in \`working/01-jtbd-and-knowledge-map.md\`. If the brief is older and lacks them, infer 4–7 required roles from the core action before judging the corpus, then write those inferred roles into \`working/04-quality-checks.md\`.
|
|
213
|
-
- For each required role, count kept/trim sources that actually satisfy that role. Count by content evidence, not by title, URL, kind, or topic adjacency.
|
|
214
|
-
- A source kind is not a source role. \`example: 2\` does not automatically satisfy "high-craft worked case studies" unless those examples contain enough fetched rationale/process/artifact evidence for the future AI to learn from.
|
|
215
|
-
- Required roles must meet the minimum named in the Capability Brief. If no minimum was named, use at least 2 strong sources; use at least 3 substantive worked examples/case studies when the capability depends on taste, visual output, craft judgment, or recognizing quality; require primary/official sources for legal, medical, financial, or safety-sensitive authority roles.
|
|
216
|
-
- Do not write "light but not absent" as a pass for a material role. Either improve the corpus inside the Phase 5 budget or write \`working/05-operating-fit-audit.md\` with \`status: improvement_recommended\`.
|
|
217
|
-
|
|
218
|
-
**Capability-pattern fit rules (strict)**:
|
|
219
|
-
|
|
220
|
-
- Read the Capability Brief for a \`Capability pattern:\` line. If none is present, write Test 8 as "No specialized capability pattern detected" and do not invent one.
|
|
221
|
-
- For \`reference-translation\`, audit four things:
|
|
222
|
-
1. **Input/reference-domain coverage:** at least two distinct source domains outside the target output medium have substantive kept/trim evidence. Count by content, not by a passing mention. For web/UI targets, web implementation, accessibility, token, or design-system sources do not count as input/reference-domain coverage.
|
|
223
|
-
2. **Translation-method coverage:** at least two direct kept/trim sources teach or demonstrate the move from source qualities to target decisions. Generic moodboard primers, galleries, and CSS mechanics are not enough.
|
|
224
|
-
3. **Caller-handoff coverage:** the corpus supports a concrete runtime output shape for the caller, such as observations, interpretation, carry-forward rules, implementation vocabulary, constraints, avoid-list, validation checks, and clarification questions.
|
|
225
|
-
4. **Constraint balance:** implementation/accessibility/system sources are present when needed, but they do not outnumber and replace the direct reference-reading and translation evidence in the core action.
|
|
226
|
-
- If any of those fail, update \`working/05-operating-fit-audit.md\` with \`status: improvement_recommended\`; do not call the corpus ready because it has enough general design/web sources.
|
|
227
|
-
|
|
228
|
-
**Operating-fit audit**:
|
|
229
|
-
|
|
230
|
-
- After Tests 0–7, ask whether the keep-list can actually help a future AI agent do the capability in the Capability Brief, not merely talk around the topic.
|
|
231
|
-
- Look for missing source roles, not just missing source kinds. Examples: high-craft case studies, worked image-to-interface translations, legal primary sources, medical authority, implementation constraints, dissenting practitioner voice, user-research evidence, or domain-specific keyword data.
|
|
232
|
-
- If a material role is weak and you cannot fix it inside the Phase 5 search budget, do not write "ready with limitation." Write \`working/05-operating-fit-audit.md\` with \`status: improvement_recommended\` so Liner can offer a focused improvement pass. Also summarize the recommendation in \`working/04-quality-checks.md\`.
|
|
233
|
-
- If the corpus is fit for the operating layer, do not write an improvement recommendation marker.
|
|
234
|
-
|
|
235
|
-
**Required output structure** in working/04-quality-checks.md:
|
|
236
|
-
|
|
237
|
-
\`\`\`
|
|
238
|
-
## Test 0 — Core-action fit
|
|
239
|
-
Core action: [verb phrase from JTBD]
|
|
240
|
-
Distribution: X direct / Y bridge / Z background
|
|
241
|
-
[finding + action]
|
|
242
|
-
|
|
243
|
-
## Test 1 — Redundancy
|
|
244
|
-
[finding + action]
|
|
245
|
-
|
|
246
|
-
## Test 2 — Coverage
|
|
247
|
-
[finding + action]
|
|
248
|
-
|
|
249
|
-
## Test 3 — Disagreement
|
|
250
|
-
[finding + action]
|
|
251
|
-
|
|
252
|
-
## Test 4 — Framing-gap
|
|
253
|
-
|
|
254
|
-
### Perspectives audit
|
|
255
|
-
- [Perspective name] — stance-represented (Source N, verified) ✓
|
|
256
|
-
- [Perspective name] — stance-absent, concerns-absent. Backfill: searched [vocabulary], found [source] → now stance-represented (Source M) ✓
|
|
257
|
-
- [Perspective name] — stance-absent, concerns-addressed by [Sources L, K]. Argued sufficient: [explicit trade-off paragraph].
|
|
258
|
-
OR
|
|
259
|
-
- [Perspective name] — stance-absent after one search pass. Corpus argues from [X], no source argues for [Y]. Recommendation: [...].
|
|
260
|
-
|
|
261
|
-
## Test 5 — Source-kind balance
|
|
262
|
-
|
|
263
|
-
Distribution: X reference / Y principle / Z prescription / W example
|
|
264
|
-
[If any zero: backfill action OR defense paragraph]
|
|
265
|
-
|
|
266
|
-
## Test 6 — Note-quality
|
|
267
|
-
|
|
268
|
-
Checked: N kept/trim notes
|
|
269
|
-
Repaired: M notes
|
|
270
|
-
[If repaired: list Source/title/URL and the note issue fixed. If none repaired: one sentence explaining why the notes already carry use cue, value/bar, and limitation.]
|
|
271
|
-
|
|
272
|
-
## Test 7 — Source-role fit
|
|
273
|
-
|
|
274
|
-
Required roles:
|
|
275
|
-
- [role] — minimum: N; current: M; status: pass|weak|gap; evidence: [source titles]
|
|
276
|
-
|
|
277
|
-
[If any required role is weak/gap: backfill action OR operating-fit audit path]
|
|
278
|
-
|
|
279
|
-
## Test 8 — Capability-pattern fit
|
|
280
|
-
|
|
281
|
-
Pattern: [reference-translation | none | other named pattern]
|
|
282
|
-
[For reference-translation: input/reference-domain coverage, translation-method coverage, caller-handoff coverage, constraint balance]
|
|
283
|
-
[finding + action]
|
|
284
|
-
\`\`\`
|
|
285
|
-
|
|
286
|
-
If an improvement pass is recommended, also write:
|
|
287
|
-
|
|
288
|
-
\`\`\`
|
|
289
|
-
# Operating-fit audit
|
|
290
|
-
|
|
291
|
-
status: improvement_recommended
|
|
292
|
-
gap: [the missing source role or weak evidence role]
|
|
293
|
-
missing_roles:
|
|
294
|
-
- role: [required source role]
|
|
295
|
-
current_coverage: [what the keep-list has now]
|
|
296
|
-
needed: [what is missing]
|
|
297
|
-
why_it_matters: [why this gap would hurt a future AI agent using the corpus]
|
|
298
|
-
recommended_pass:
|
|
299
|
-
- [search lane or source type Liner should look for]
|
|
300
|
-
- [search lane or source type Liner should look for]
|
|
301
|
-
user_can_add:
|
|
302
|
-
- [concrete custom source the user could add if web research stays thin]
|
|
303
|
-
skip_note: [what remains weaker if the user skips for now]
|
|
304
|
-
\`\`\`
|
|
305
|
-
|
|
306
|
-
Every named perspective must appear in the audit with explicit coverage status. A missing "Perspectives audit" section, a Test 5 section without the distribution, a missing Test 6 note-quality section, a missing Test 7 source-role section, or a missing Test 8 capability-pattern section means the test wasn't run honestly.
|
|
307
|
-
|
|
308
|
-
If a test fails, fix the keep-list (update working/03-evaluation.yaml) before reporting done when the fix fits inside the Phase 5 budget. If it requires a wider second pass, write the operating-fit audit instead of presenting the corpus as fully ready. Even tests that pass without changes should be noted — silent passes train the model to treat the tests as ceremonial.
|
|
309
|
-
|
|
310
|
-
Stop after working/04-quality-checks.md is written and any necessary changes are reflected in 03-evaluation.yaml.`,
|
|
311
|
-
synthesis: `## Phase 6 — Synthesis
|
|
312
|
-
|
|
313
|
-
Read synthesis.md (replacing the placeholder), working/03-evaluation.yaml (the keep-list), and \`synthesis-guidance.md\` in the skill bundle.
|
|
314
|
-
|
|
315
|
-
Draft synthesis.md as continuous prose, 800–2000 words. The synthesis is the curator's *distilled understanding of the domain* — principles, contested questions, framework distinctions. NOT a recap of source content.
|
|
316
|
-
|
|
317
|
-
⚠ Bias correction: do NOT write "Source 1 says X; Source 2 says Y." Push toward the curator's framing. Synthesis is the first thing the consuming AI reads — it sets the lens.
|
|
318
|
-
|
|
319
|
-
**Required operating sections**:
|
|
320
|
-
- Include a \`## Generative rules\` section with about five imperative rules the consuming AI can apply directly. These are the "if you remember nothing else" rules, phrased as actions or constraints, not summaries. Example shape: "Channel discipline: stdout is for data, stderr is for humans, and exit codes mean what they say."
|
|
321
|
-
- Include a \`## Stances this corpus takes\` section naming the corpus's opinionated positions and trade-offs. This section should say what the mixtape leans toward, what it resists, and where a dissenting source should still temper the rule.
|
|
322
|
-
|
|
323
|
-
**Weight sources by their \`kind\`** (set during Phase 7, but visible in 03-evaluation.yaml too):
|
|
324
|
-
- \`reference\` sources (specs, RFCs) — substrate. Cite once for authority; don't lean on them for framing.
|
|
325
|
-
- \`principle\` sources (essays, manifestos) — load-bearing for the synthesis's stance section. These earn the most quoting.
|
|
326
|
-
- \`prescription\` sources (style guides, rules) — useful for concrete distinctions but rarely for the synthesis's voice.
|
|
327
|
-
- \`example\` sources (case studies, surveys) — taste calibration. Cite when arguing what "good" looks like.
|
|
328
|
-
|
|
329
|
-
If a source's \`kind\` field is absent, treat it as principle-equivalent (the synthesis-writing default).
|
|
330
|
-
|
|
331
|
-
For methodology mode, mark spots where the curator should personalize ("[curator's view: …]") so they have explicit handoff points. For quick mode, write a coherent draft they can lightly edit.
|
|
332
|
-
|
|
333
|
-
Stop after synthesis.md is written.`,
|
|
334
|
-
assembly: `## Phase 7 — Assembly (draft)
|
|
335
|
-
|
|
336
|
-
You are preparing a *draft* of the sources list for the curator to review. **DO NOT touch tape.yaml directly.** Write your proposal to \`working/07-tape-draft.yaml\` and stop.
|
|
337
|
-
|
|
338
|
-
Read these inputs:
|
|
339
|
-
- \`working/03-evaluation.yaml\` — the keep-list with curator notes and ratings.
|
|
340
|
-
- \`synthesis.md\` — the curator's framing, to inform section ordering.
|
|
341
|
-
- \`tape.yaml\` — preserve any existing source order the curator already chose; you're proposing additions/changes, not erasing.
|
|
342
|
-
- \`local-sources/sources-manifest.yaml\`, when present — active custom sources the curator added. These are curator-selected sources, not optional research candidates.
|
|
343
|
-
|
|
344
|
-
Build the draft as YAML with a top-level \`sources:\` list. Each entry needs:
|
|
345
|
-
|
|
346
|
-
\`\`\`yaml
|
|
347
|
-
sources:
|
|
348
|
-
- type: web # web | youtube | local_file | skill
|
|
349
|
-
url: https://...
|
|
350
|
-
section: foundations
|
|
351
|
-
priority: required # required | optional
|
|
352
|
-
kind: prescription # reference | principle | prescription | example
|
|
353
|
-
note: |
|
|
354
|
-
One-paragraph curator note: role of this source, where the value lives,
|
|
355
|
-
and any limitations. Use the three-thing template.
|
|
356
|
-
\`\`\`
|
|
357
|
-
|
|
358
|
-
Rules:
|
|
359
|
-
- Include every candidate marked \`kept\` or \`trim\` in 03-evaluation.yaml only when it has \`fetch_status: readable|partial\`, \`content_quality: high|medium\`, and at least two \`evidence\` bullets. If an older evaluation marks a source kept/trim without this evidence, stop and repair \`working/03-evaluation.yaml\` instead of drafting.
|
|
360
|
-
- Drop evaluated URL candidates marked \`dropped\`, \`metadata_only\`, \`unavailable\`, or \`content_quality: low\`.
|
|
361
|
-
- Preserve every existing \`local_file\` and \`skill\` source from tape.yaml even though those entries do not appear in the URL-only evaluation file. Carry forward \`path\`, \`url\`, \`citation\`, \`note\`, \`priority\`, \`section\`, and \`kind\` where present. If any required review metadata is missing, add it without changing the source identity.
|
|
362
|
-
- Preserve every \`active: true\` source from \`local-sources/sources-manifest.yaml\`, even if it is not present in \`tape.yaml\` yet. Custom sources are curator-selected. Include active recovered \`local_file\` entries from \`local-sources/recovered/\`; do not include inactive original URL entries when a recovered local copy replaced them.
|
|
363
|
-
- Do not silently convert \`local_file\` or \`skill\` sources into \`web\` sources. Skill sources are reference material, not active instructions.
|
|
364
|
-
- Preserve current tape order first, then append newly kept/trimmed URL candidates that were not already on the tape. Dedupe by URL for web/youtube, by \`path\`+\`citation\` for local_file, and by \`path\` or \`url\` for skill.
|
|
365
|
-
- Within a section, order new evaluated URL candidates by rating (highest first).
|
|
366
|
-
- Order sections in reading order: foundations / patterns / applications / craft (or whatever the synthesis suggests).
|
|
367
|
-
- Notes come straight from 03-evaluation.yaml's \`note\` field. Do not paraphrase.
|
|
368
|
-
- Mark a source \`priority: optional\` only when the methodology genuinely treats it as skippable (rare).
|
|
369
|
-
- \`local_file\` and \`skill\` entries: never invent paths or skill identifiers. Include them only when they already exist in tape.yaml or as active entries in \`local-sources/sources-manifest.yaml\`.
|
|
370
|
-
|
|
371
|
-
**Source \`kind\` is required on every entry.** It tells the synthesis prompt and the consuming AI which sources to weight how. Pick the best fit:
|
|
372
|
-
|
|
373
|
-
- \`reference\` — specs / standards cited but not deep-read (POSIX, RFCs, official manual pages). The consuming AI cites these for authority but doesn't quote them at length.
|
|
374
|
-
- \`principle\` — read for stance / framing (essays, manifestos, philosophical pieces). Shapes how the AI thinks about the domain.
|
|
375
|
-
- \`prescription\` — read for concrete rules (style guides, conventions, explicit do/don't lists). The AI quotes these directly when applying rules.
|
|
376
|
-
- \`example\` — read for taste / illustration (case studies, tool surveys, worked examples). Shows what good looks like.
|
|
377
|
-
|
|
378
|
-
A source can plausibly fit two categories; pick the one closest to *how the consuming AI should USE this source*. When in doubt: rules → \`prescription\`; arguments → \`principle\`; examples → \`example\`; authority without narrative → \`reference\`.
|
|
379
|
-
|
|
380
|
-
When done, write \`working/07-tape-draft.yaml\` and stop. The TUI will show the curator a review screen to accept, edit, or discard. DO NOT modify tape.yaml.`,
|
|
381
|
-
};
|
|
382
|
-
/** Construct the system+user prompt blob passed to the agent. */
|
|
383
|
-
export function buildPhasePrompt(args) {
|
|
384
|
-
const { phaseId, project, skillPath, tape } = args;
|
|
385
|
-
const skillContents = safeRead(join(skillPath, "SKILL.md")) ??
|
|
386
|
-
"(SKILL.md not found at " + skillPath + ")";
|
|
387
|
-
const phaseInstruction = PHASE_INSTRUCTIONS[phaseId] ??
|
|
388
|
-
`## Phase ${phaseId}\n\nNo dedicated instruction. Use SKILL.md to figure out what to do for the ${phaseId} phase, then stop.`;
|
|
389
|
-
const companionNote = (COMPANIONS[phaseId] ?? [])
|
|
390
|
-
.map((f) => ` - ${join(skillPath, f)}`)
|
|
391
|
-
.join("\n");
|
|
392
|
-
return `You are running the curating-mixtapes methodology on behalf of a curator.
|
|
393
|
-
|
|
394
|
-
# Mixtape context
|
|
395
|
-
|
|
396
|
-
- Project folder: ${project}
|
|
397
|
-
- Title: ${tape.title || "(not set)"}
|
|
398
|
-
- Description: ${tape.description || "(not set)"}
|
|
399
|
-
- Mode: ${tape.mode ?? "quick"}
|
|
400
|
-
- AI-agent goal: ${tape.jtbd || "(not set)"}
|
|
401
|
-
- Curator: ${tape.curator || "(not set)"}
|
|
402
|
-
- Sources currently on tape: ${tape.sources.length}
|
|
403
|
-
|
|
404
|
-
# Skill bundle
|
|
405
|
-
|
|
406
|
-
The methodology is documented in:
|
|
407
|
-
- ${join(skillPath, "SKILL.md")}
|
|
408
|
-
|
|
409
|
-
Companion files (read the ones listed in the phase instructions below):
|
|
410
|
-
${companionNote || " (none for this phase)"}
|
|
411
|
-
|
|
412
|
-
# What to do
|
|
413
|
-
|
|
414
|
-
${phaseInstruction}
|
|
415
|
-
|
|
416
|
-
# Output discipline
|
|
417
|
-
|
|
418
|
-
- Work on the filesystem. Do not paste large file contents back in your response — write them to disk.
|
|
419
|
-
- Be concise in your spoken output. The user is watching a TUI; long monologues clutter the screen.
|
|
420
|
-
- If you cannot proceed (missing AI-agent goal, missing prior-phase artifact), say so clearly and stop. Do NOT make up content.
|
|
421
|
-
|
|
422
|
-
${WORKSPACE_DISCIPLINE}
|
|
423
|
-
|
|
424
|
-
# Final message format (required)
|
|
425
|
-
|
|
426
|
-
When the phase finishes, end with a markdown message in **this exact shape**.
|
|
427
|
-
The TUI renders this — section headings (**Bold:**) become colored chips, bullets render with • glyphs, and bracketed paths render dim. Following the format gives the curator a scannable summary; freeform prose does not.
|
|
428
|
-
|
|
429
|
-
\`\`\`
|
|
430
|
-
Done with Phase N.
|
|
431
|
-
|
|
432
|
-
**What I did:**
|
|
433
|
-
- Verb-first sentence describing one concrete output [path/to/file]
|
|
434
|
-
- Another verb-first sentence [path/to/another-file]
|
|
435
|
-
|
|
436
|
-
**Mix:** (only if you discovered or surveyed sources — skip otherwise)
|
|
437
|
-
- Category one: short list of representative items
|
|
438
|
-
- Category two: short list
|
|
439
|
-
|
|
440
|
-
**Review checklist:** (only if there's something the curator should verify in *this TUI screen* before moving on — skip if not)
|
|
441
|
-
- A specific judgment call to make from what's visible here
|
|
442
|
-
- Another specific judgment call
|
|
443
|
-
\`\`\`
|
|
444
|
-
|
|
445
|
-
Rules:
|
|
446
|
-
- **Lead every bullet with a verb-phrase**, not a file path or URL. Put paths in \`[brackets]\` at the very end of the bullet.
|
|
447
|
-
- Don't introduce extra sections. The TUI styles only these three headings; anything else renders as plain text.
|
|
448
|
-
- Skip sections that don't apply. Better to omit "Mix:" than to fill it with filler.
|
|
449
|
-
- 2–4 bullets per section. Be specific, not exhaustive.
|
|
450
|
-
- For the opening line ("Done with Phase N.") use the actual phase number — not "this phase" or "the current phase".
|
|
451
|
-
|
|
452
|
-
**Review checklist — scope rules** (important):
|
|
453
|
-
|
|
454
|
-
The "Review checklist" is what the curator should do on the **current TUI done screen**, before pressing Enter to advance. The TUI's only affordances at that moment are: read your message, open the artifact file in \`$EDITOR\`, re-run the phase, or continue. So bullets must be answerable by ONE of:
|
|
455
|
-
|
|
456
|
-
- A yes/no judgment the curator can make by skimming what you wrote ("Does the knowledge map cover X?")
|
|
457
|
-
- A specific edit they can make to the artifact you just wrote ("Drop the InfoQ Q&A in the long-list — weakest entry")
|
|
458
|
-
- A specific source/section worth a closer look ("The Pinsker entry skews designer-voice — confirm or swap")
|
|
459
|
-
|
|
460
|
-
Do NOT include bullets that ask the curator to:
|
|
461
|
-
- Go find more sources (the next phase handles selection — flag it for *yourself* in a later phase note, not for them)
|
|
462
|
-
- Add categories or sections you didn't include (you should have included them)
|
|
463
|
-
- "Flag if you want a dedicated source for X" — that's outside the loop the TUI gives them
|
|
464
|
-
- Do open-ended research, validation, or thinking that requires leaving this screen
|
|
465
|
-
- Anything that doesn't fit "read → edit artifact in \$EDITOR → advance"
|
|
466
|
-
|
|
467
|
-
If you don't have a concrete TUI-scoped checklist item, **omit the section**. An empty Review checklist is better than one full of asks the curator can't act on from where they are.
|
|
468
|
-
|
|
469
|
-
# Full SKILL.md follows
|
|
470
|
-
|
|
471
|
-
${skillContents}
|
|
472
|
-
`;
|
|
473
|
-
}
|
|
474
|
-
export function buildEvaluationSectionPrompt(args) {
|
|
475
|
-
const base = buildPhasePrompt({
|
|
476
|
-
phaseId: "evaluation",
|
|
477
|
-
project: args.project,
|
|
478
|
-
skillPath: args.skillPath,
|
|
479
|
-
tape: args.tape,
|
|
480
|
-
});
|
|
481
|
-
const candidates = args.group.candidates
|
|
482
|
-
.map((candidate, i) => {
|
|
483
|
-
const lines = [
|
|
484
|
-
`${i + 1}. ${candidate.title || "(untitled)"}`,
|
|
485
|
-
` URL: ${candidate.url}`,
|
|
486
|
-
` Section: ${candidate.section || args.group.section}`,
|
|
487
|
-
];
|
|
488
|
-
if (candidate.reason)
|
|
489
|
-
lines.push(` Phase 2 reason: ${candidate.reason}`);
|
|
490
|
-
return lines.join("\n");
|
|
491
|
-
})
|
|
492
|
-
.join("\n\n");
|
|
493
|
-
return `${base}
|
|
494
|
-
|
|
495
|
-
# Section-scoped Evaluation run
|
|
496
|
-
|
|
497
|
-
This is Evaluation chunk ${args.group.index} of ${args.group.total}. Keep the context short and finish only this chunk.
|
|
498
|
-
|
|
499
|
-
Evaluate only these ${args.group.candidates.length} candidates from the "${args.group.section}" section:
|
|
500
|
-
|
|
501
|
-
${candidates}
|
|
502
|
-
|
|
503
|
-
# Required chunk output
|
|
504
|
-
|
|
505
|
-
- Create \`working/evaluation-decisions/\` if needed.
|
|
506
|
-
- Write exactly one YAML fragment at \`${args.group.fragmentPath}\`.
|
|
507
|
-
- The fragment must have a top-level \`candidates:\` list.
|
|
508
|
-
- Include every URL listed above exactly once.
|
|
509
|
-
- Do not write or edit \`working/03-evaluation.yaml\`; Liner assembles it after all chunks finish.
|
|
510
|
-
- Do not evaluate candidates from any other section.
|
|
511
|
-
- Stop after the fragment is written and parsed.
|
|
512
|
-
`;
|
|
513
|
-
}
|
|
514
|
-
function safeRead(path) {
|
|
515
|
-
try {
|
|
516
|
-
return readFileSync(path, "utf8");
|
|
517
|
-
}
|
|
518
|
-
catch {
|
|
519
|
-
return null;
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
//# sourceMappingURL=prompts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/agents/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC;;;GAGG;AACH,MAAM,UAAU,GAAuC;IACrD,UAAU,EAAE,CAAC,2BAA2B,CAAC;IACzC,UAAU,EAAE,CAAC,6BAA6B,EAAE,kBAAkB,CAAC;IAC/D,OAAO,EAAE,CAAC,wBAAwB,CAAC;IACnC,SAAS,EAAE,CAAC,uBAAuB,CAAC;CACrC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;6EAKyC,CAAC;AAE9E,MAAM,kBAAkB,GAAqC;IAC3D,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gaA8BiZ;I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KAAK,CAAC,KAAK;;sBAE5C,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,yBAAyB,IAAI,CAAC,KAAK,CAAC,OAAO;;EAE3F,UAAU;;;;;yCAK6B,IAAI,CAAC,KAAK,CAAC,YAAY;;;;;;CAM/D,CAAC;AACF,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/dist/agents/run-log.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// Tee-style audit log of every agent run.
|
|
2
|
-
//
|
|
3
|
-
// We already get resume-on-failure for free via Claude's session.json (and
|
|
4
|
-
// Codex's equivalent), so this log isn't load-bearing for recovery. What it
|
|
5
|
-
// *does* give us:
|
|
6
|
-
//
|
|
7
|
-
// - A user-readable transcript of past runs they can scroll back through.
|
|
8
|
-
// - Forensic data when something behaves weirdly (rate-limit retry order,
|
|
9
|
-
// unexpected tool calls, parse failures in the JSON stream).
|
|
10
|
-
// - Raw material for a future "replay a run in the UI" feature.
|
|
11
|
-
//
|
|
12
|
-
// One file per run, namespaced by phaseId, timestamped. The first line is a
|
|
13
|
-
// `_liner_meta` envelope describing the run; the body is the agent's raw
|
|
14
|
-
// JSONL exactly as we received it; the last line is a `_liner_close` marker
|
|
15
|
-
// with the exit code and end time. Everything else (parsed events, derived
|
|
16
|
-
// UI state) is reconstructable from those primitives.
|
|
17
|
-
import { createWriteStream, mkdirSync } from "node:fs";
|
|
18
|
-
import { join } from "node:path";
|
|
19
|
-
const RUN_DIR = ".liner-runs";
|
|
20
|
-
/**
|
|
21
|
-
* Open a new log file for an agent run. The directory is created lazily;
|
|
22
|
-
* no IO until the first write. Caller owns close() in both happy and
|
|
23
|
-
* cancellation paths.
|
|
24
|
-
*/
|
|
25
|
-
export function openRunLog(folder, taskLabel, meta) {
|
|
26
|
-
// Defense-in-depth: sanitize taskLabel so a malformed caller can't escape
|
|
27
|
-
// the .liner-runs/ directory with `..` or absolute paths.
|
|
28
|
-
const safeLabel = taskLabel.replace(/[^a-zA-Z0-9_-]/g, "-") || "task";
|
|
29
|
-
const dir = join(folder, RUN_DIR, safeLabel);
|
|
30
|
-
mkdirSync(dir, { recursive: true });
|
|
31
|
-
const startedAt = new Date().toISOString();
|
|
32
|
-
// Filenames need to be filesystem-safe on Windows too — strip colons.
|
|
33
|
-
const stamp = startedAt.replace(/:/g, "-").replace(/\..+/, "");
|
|
34
|
-
const path = join(dir, `${stamp}.jsonl`);
|
|
35
|
-
const stream = createWriteStream(path, { flags: "a" });
|
|
36
|
-
let closed = false;
|
|
37
|
-
const fullMeta = { ...meta, taskLabel: safeLabel, startedAt };
|
|
38
|
-
stream.write(JSON.stringify({ type: "_liner_meta", ...fullMeta }) + "\n", "utf8");
|
|
39
|
-
return {
|
|
40
|
-
path,
|
|
41
|
-
write(line) {
|
|
42
|
-
if (closed)
|
|
43
|
-
return;
|
|
44
|
-
if (!line)
|
|
45
|
-
return;
|
|
46
|
-
stream.write(line, "utf8");
|
|
47
|
-
if (!line.endsWith("\n"))
|
|
48
|
-
stream.write("\n", "utf8");
|
|
49
|
-
},
|
|
50
|
-
close() {
|
|
51
|
-
if (closed)
|
|
52
|
-
return;
|
|
53
|
-
closed = true;
|
|
54
|
-
stream.end();
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Convenience: append a final `_liner_close` marker with exit metadata before
|
|
60
|
-
* the stream is shut. Callers call this from the agent's `close` handler.
|
|
61
|
-
*/
|
|
62
|
-
export function closeRunLog(log, code, stderrLen) {
|
|
63
|
-
log.write(JSON.stringify({
|
|
64
|
-
type: "_liner_close",
|
|
65
|
-
exitCode: code,
|
|
66
|
-
stderrBytes: stderrLen,
|
|
67
|
-
endedAt: new Date().toISOString(),
|
|
68
|
-
}));
|
|
69
|
-
log.close();
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=run-log.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-log.js","sourceRoot":"","sources":["../../src/agents/run-log.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,4EAA4E;AAC5E,kBAAkB;AAClB,EAAE;AACF,4EAA4E;AAC5E,4EAA4E;AAC5E,iEAAiE;AACjE,kEAAkE;AAClE,EAAE;AACF,4EAA4E;AAC5E,yEAAyE;AACzE,4EAA4E;AAC5E,2EAA2E;AAC3E,sDAAsD;AAEtD,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,MAAM,OAAO,GAAG,aAAa,CAAC;AAwB9B;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACxB,MAAc,EACd,SAAiB,EACjB,IAAiD;IAEjD,0EAA0E;IAC1E,0DAA0D;IAC1D,MAAM,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC;IACtE,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IAC7C,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACpC,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC3C,sEAAsE;IACtE,MAAM,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,QAAQ,CAAC,CAAC;IACzC,MAAM,MAAM,GAAgB,iBAAiB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