8
9
## Learnings
10
11
-### 2026-05-18T12:07:20.778+02:00 — Phase 2 PR Review
12
-
13
-- **PR #27:** Not mergeable yet. The crawl workflow restores the `crawl-cache` artifact into repo root (`path: .`) while `scripts/crawl.py` reads cache from `data/cache/`, so the warm-cache handoff does not actually work yet.
14
-- **PR #28:** Not mergeable yet. The spec/prompt require the stable H2 heading `## Trending This Week`, but the sample analyzed artifact still uses `## Trending This Week (Stars Gained)`, so the example does not satisfy its own contract.
15
-- **GitHub constraint:** `gh pr review --request-changes` is blocked on self-authored PRs, so the blocking findings were recorded as PR comments instead.
16
-
17
-### 2026-05-18 — PRD Authoring
18
-
19
-- **PRD location:** `docs/PRD.md` — comprehensive PRD covering all requirements from jmservera
20
-- **Architecture decisions made:**
21
- - Hugo recommended as static site generator (speed, simplicity, native RSS)
22
- - Pagefind for client-side search (static, no server dependency)
23
- - RSS + GitHub Releases for MVP notifications (zero external dependencies)
24
- - Plugin pattern for future data source extensibility
25
- - Reskill every 5 runs via simple counter in `.squad/run-counter.txt`
26
-- **Key open questions flagged:**
27
- - How to invoke Copilot in GitHub Actions (OQ1, OQ3) — blocks Phase 2
28
- - Hugo vs Astro preference (OQ2) — awaiting stakeholder input
29
- - Star threshold for significance filtering (OQ4) — proposed 50 stars/week
30
-- **User preferences noted:**
31
- - jmservera wants full automation with zero manual intervention
32
- - "Nap and reskill" metaphor is important — deliberate self-improvement built into the system
33
- - Free-only notification options
34
- - Ever-growing archive — nothing deleted
35
-- **Content structure:** weekly (immutable) → monthly (append-only) → yearly (append-only)
36
-- **Data paths:** `data/raw/` (JSON), `data/analyzed/` (Markdown), `content/` (Hugo pages)
37
-
38
-### 2026-05-18T10:06:38.734+02:00 — PRD Decomposition
39
-
40
-- **Decomposition approach:** Split the PRD into tightly scoped, single-session GitHub issues organized by delivery phase and explicit handoffs between crawl, analyze, generate, notify, and reskill stages.
41
-- **Issue count:** 18 delivery issues + 6 governance/validation issues = 24 total issues.
42
-- **Phase structure:** Added a new **Phase 0: Investigation** in front of Foundation so OQ1/OQ3 (Copilot CLI in Actions + auth path) are resolved before automation work proceeds.
43
-- **Assignment pattern:** Mapped issues to roster strengths — Bender for Actions/crawler/integrations, Farnsworth for analysis/reskill logic, Amy for site/search/UX, Fry for validation, and Leela for architecture/docs.
44
-
45
-### 2026-05-18T10:11:20Z — Decisions Merged
46
-
47
-- **Copilot CLI:** Standalone CLI with fine-grained PAT (Copilot Requests) approved for Phase 0. Fallback: GitHub Models API.
48
-- **MCP crawling:** Multi-site crawling authorized; remote calls require allowlist in GitHub Copilot agent settings.
49
-- **Phase 0 gating:** OQ1/OQ3 investigation issues must close before Phase 2 analyzer work begins.
50
-- **Next:** Issue creation from scripts/create-issues.sh is ready for execution.
51
-
52
-### 2026-05-18T10:25:12.565+02:00 — CI Analysis Interface & Fallback Architecture (Issue #2)
53
-
54
-- **Architecture decision published:** `.squad/decisions/inbox/leela-ci-architecture-decision.md`
55
-- **Primary path:** Standalone `copilot` CLI with fine-grained PAT (`COPILOT_GH_TOKEN` secret → `COPILOT_GITHUB_TOKEN` env var). Programmatic mode with `--no-ask-user`, explicit `--allow-tool` flags.
56
-- **Fallback path:** GitHub Models API (`models.github.ai`) with built-in `GITHUB_TOKEN` and `permissions: models: read`. Triggered on CLI auth failure, quota exhaustion, or repeated errors.
57
-- **Pipeline contracts formalized:**
58
- - Crawl → Analyze: `data/raw/YYYY-WNN.json` (repo objects array)
59
- - Analyze → Generate: `data/analyzed/YYYY-WNN-summary.md` (Markdown + YAML frontmatter with `quality_score`)
60
- - Generate → Deploy: `public/` (Hugo build output)
61
-- **Reviewer gate:** quality_score ≥ 60, three required sections (Signal/Noise/Gaps), word count ≥ 200. Blocks publish on failure.
62
-- **Token strategy:** Fine-grained PAT with Account → Copilot Requests permission. Classic PATs not supported. Future spike: `GITHUB_TOKEN` + `copilot-requests: write`.
63
-- **MCP strategy:** Allowlist-gated remote calls, tool definitions in `.github/copilot/mcp.json`, crawl-stage only for external HTTP.
64
-- **Nap & reskill interface:** Every 5th run, Copilot CLI reads squad state and writes improvement recommendations to `.squad/reskill/YYYY-WNN.md`.
65
-- **Resolves:** OQ1 and OQ3 from PRD. Unblocks Phase 2 analyzer work.
66
-
67
-### 2026-05-18T10:27:35Z — Phase 0 Completion (Scribe)
68
-
69
-- **Status:** Phase 0 is complete. Architecture decision merged into `.squad/decisions.md`.
70
-- **Secret configured:** `COPILOT_GH_TOKEN` repo secret established (coordinator action).
71
-- **Issues closed:** #1 (completed by Bender) and #2 (Leela architecture).
72
-- **Team notification:** All agents notified that Phase 0 is complete and architecture is published.
73
-- **Next phase:** Phase 1 (crawlers and generators) can proceed independently. Phase 2 (analyzer) is unblocked.
74
-
75
-### 2026-05-18T13:20:07.067+02:00 — Topic Channels PRD
76
-
77
-- **Deliverable:** `docs/PRD-topic-channels.md` — feature PRD for topic-specific news channels
78
-- **PR:** #39 (squad/topic-channels-prd → main)
79
-- **Key decisions:**
80
- - Feature first, not separate platform — extends existing pipeline with topic namespace
81
- - v1 = single configurable topic per instance (fork per topic); v2 = multi-topic deferred
82
- - Per-topic learning isolation (wisdom, skills, predictions, scorecards)
83
- - New scoring pipeline between crawl and analyze (relevance score 0-100)
84
- - Prediction ledger (`predictions.jsonl`) with hindsight validation at week N+4
85
- - `squadscope.topic.yml` as the single config file controlling all topic behavior
86
- - Two example configs shipped: ai-ml and rust
87
-- **Rubber-duck findings addressed:** All 7 findings incorporated (namespacing, multi-instance, learning isolation, scoring pipeline, prediction ledger, channel structure, quality criteria)
88
-- **Learning audit gaps addressed:** G7 (prompt feedback), G8 (hindsight validation), G9 (prediction registry), G13 (enrichment signals as OQ5)
89
-- **Implementation plan:** 15 issues with dependency graph, ~7-9 sessions estimated
90
-
91
-### 2026-05-18T10:59:10.800+02:00 — Phase 1 PR Review Gate
92
-
93
-- **PR #26 outcome:** Acceptable and merged after validation. The hardened crawler delivered the expected Phase 1 improvements: caching, star snapshots, stronger low-signal filtering, bounded retry/rate-limit behavior, partial-failure metadata, and regression tests for the new query and payload behavior.
94
-- **PR #25 outcome:** I flagged a blocker against the dry-run artifact: the checked-in file under `data/analyzed/` does not match the approved Analyze → Generate contract in `.squad/decisions.md` (`Signal` / `Noise` / `Gaps`). By the time I verified final PR state, GitHub already showed PR #25 as merged, so the blocker was recorded as review commentary and follow-up guidance rather than an enforceable lockout.
95
-- **Operational constraint:** Because the authenticated GitHub account is also the PR author, GitHub blocked formal approve/request-changes reviews. Outcome had to be recorded by comment, and only PR #26 could be actively merged during this pass.
96
-
97
-### 2026-05-19T05:17:53.102+02:00 — Cost Estimation PRD
98
-
99
-- **Deliverable:** `docs/PRD-cost-estimation.md` — comprehensive PRD for token-based Copilot billing cost estimation and optimization
100
-- **Key findings:**
101
- - Weekly analysis cost: ~$0.30/run (Claude Sonnet 4, ~90K input tokens dominated by 301KB raw JSON)
102
- - Reskill cost: ~$0.036/run (GPT-4.1, much smaller context, runs every 5th week)
103
- - Annual all-in cost: ~$16/year for 52 weekly pages — $0.31/page
104
- - Context growth is modest (2-5%/year on weekly runs) because raw JSON dominates and is stable
105
- - Reskill grows faster (24-49%/year) due to accumulating history, but runs infrequently
106
-- **Optimization levers identified (ordered by ROI):**
107
- 1. Pre-process raw JSON to reduce tokens (40-60% savings on input)
108
- 2. Model downgrade for routine analysis (GPT-4.1 or Haiku saves 33-67%)
109
- 3. Prompt caching if available (77% savings on JSON portion)
110
- 4. Token budget with tiered degradation
111
-- **Pricing model hypothesis (pending OQ6 validation):** GitHub Models API and Copilot CLI are assumed to use the same per-token rates, with the difference being auth mechanism and agentic capabilities rather than cost per token. This assumption needs empirical validation — see PRD OQ6.
112
-- **Open risk:** Whether Copilot CLI transcript exposes actual token usage (needed for monitoring)
113
-
114
-### 2026-05-19T11:48:44.543Z — PR #54 Merged (Cost Estimation)
115
-
116
-- **Status:** All 4 review comments resolved and PR squash-merged to main
117
-- **Outcome:** Cost estimation framework approved for Phase A implementation
118
-- **Integration:** Cost tracking issues will be added to Phase A backlog
119
-- **Team note:** Cost analysis findings established sustainability baseline; no immediate budget action required but monitoring framework is essential for future growth planning
120
-
121
-### 2026-05-19T11:55:46.116Z — PR #55 Review (TechCrunch RSS PRD)
122
-
123
-- **Verdict:** REJECTED (request-changes, recorded as comment due to self-author constraint)
124
-- **Reason:** PR title/description promises a TechCrunch RSS integration PRD but the branch contains zero TechCrunch-related content. Actual diff is stale cost-estimation work already merged via PR #54. Branch has merge conflicts against main.
125
-- **Architectural observation:** The PR description's editorial framing (cross-source correlation to distinguish press hype from organic momentum) is sound and aligned with Decision #7's plugin architecture. When the actual PRD arrives, key review criteria will be: plugin interface compliance, overlap with topic-channels PRD, and incremental cost impact.
126
-- **Recurring pattern:** This is another instance of a PR being opened before the deliverable is committed — need team discipline on "commit first, then open PR."
127
-
128
-### 2026-05-19T11:59:28Z — PR #55 Resolved by Bender (TechCrunch RSS PRD Revision)
129
-
130
-- **Handoff:** Rejected PR #55 passed to Bender for revision (Farnsworth locked out per protocol)
131
-- **Outcome:** Bender rewrote PRD, rebased branch, committed deliverable, updated PR description
132
-- **Key decision captured:** TechCrunch as enrichment signal (5–15% correlation hit rate), not primary source
133
-- **Status:** PR #55 ready for next review cycle
134
-- **Team learning:** Rollback/rejection-to-revision cycle worked as designed — rejector (Leela) transitioned ownership cleanly, locked reviewer enabled handoff without conflicts
135
-
136
-### 2026-05-19T14:51:48.593+02:00 — PR #55 Re-review (TechCrunch RSS PRD)
137
-
138
-- **Verdict:** APPROVED (recorded as comment due to GitHub self-author constraint)
139
-- **Revision quality:** Excellent. Bender delivered a complete 443-line PRD that addresses all original rejection reasons.
140
-- **Key strengths:** Honest 5–15% correlation rate, graceful zero-noise degradation, Decision #7 plugin compliance, explicit failure criteria with removal triggers, phased rollout with exit gates.
141
-- **Minor suggestions (non-blocking):** Spike OQ1 (RSS content depth) before Phase 1; consider `correlate.py` placement at `scripts/` root since it's a cross-source concern; add URL-based dedup for mid-week article republishes.
142
-- **Pattern confirmed:** The reject → reassign → revise cycle works. Bender's revision was materially better than a "fix the branch" patch — it was a ground-up rewrite with proper editorial framing.
143
-- **Operational note:** GitHub still blocks formal approve/request-changes on self-authored PRs. Approval recorded via PR comment.
144
-
145
-### 2026-05-19T14:59:57+02:00 — PRD Decomposition into Milestones
146
-
147
-- **Milestone structure adopted:** v0.5 (Cost Visibility, 3 issues), v0.6 (Topic Channels Foundation, 6 issues), v0.7 (Learning & Predictions, 9 issues), v0.8 (Cross-Source Intelligence, 7 issues), v0.9 (Cost Optimization & Polish, 9 issues)
148
-- **Total issues created:** 34 issues across 5 milestones (issues #56–#89)
149
-- **PRDs processed:** 3 PRDs moved to docs/processed/ (cost-estimation, topic-channels, techcrunch-integration)
150
-- **Workflow change:** Milestone-based versioning adopted per user directive. PRDs → issues → milestones → docs/processed/
151
-- **Dependencies respected:** TechCrunch (v0.8) follows topic-channels foundation (v0.6); cost optimization (v0.9) follows cost visibility (v0.5)
152
-- **Label convention:** All issues carry `squad` + `squad:{agent}` labels for routing
153
-
11
### 2026-05-19T18:05:10+02:00 — CI Workflow: PR-based commits, ruleset bypass reverted
12
13
- **Ruleset fix:** Removed RepositoryRole:5 bypass actor from the `main` ruleset (id 16532660). Branch protection must never be bypassed.
15
- **Steps renamed:** "Commit crawl data" → "Commit crawl data via PR", "Commit analysis" → "Commit analysis via PR", "Commit generated content" → "Commit generated content via PR", reskill step also converted.
16
- **No more `continue-on-error: true`** on commit steps — they succeed properly now via the PR path.
17
- **Tests updated:** Adjusted step name references in `tests/test_pipeline.py` to match new naming.
161
-- **Decision recorded:** `.squad/decisions/inbox/leela-no-ruleset-bypass.md`
18
+- **Decision recorded:** `.squad/decisions.md`
19
20
### 2026-05-19T22:57:55+02:00 — CI Self-Learning Pipeline Architecture
21
26
- Reskill promoted to Copilot CLI primary path (was GitHub Models only); agent can now update wisdom.md directly
27
- Default model switched from `openai/gpt-4.1` (403) to `openai/gpt-4o` across all fallback paths
28
- **Key insight:** The learning loop requires three properties: (1) identity loaded before work, (2) state persisted after work, (3) persisted state injected into next run. The agent file provides (1), the commit step provides (2), and the existing prompt templates with `{{WISDOM}}`/`{{SKILLS}}` provide (3).
172
-- **Decision recorded:** `.squad/decisions/inbox/leela-ci-self-learning.md`
29
+- **Decision recorded:** `.squad/decisions.md`
30
- **Files modified:** `crawl-and-publish.yml` (analysis + reskill steps), `scripts/reskill.py`, `scripts/analyze_fallback.py`
31
32
+### 2026-05-19T20:57:55Z — Scribe Archival & Team Sync
33
+
34
+- **Scribe executed full archival cycle:** decisions.md merged 4 inbox files (Farnsworth correlations narrative, divergence narrative, no-AI re-render; Leela CI self-learning), cleared inbox, created orchestration logs for both agents, recorded session log, updated both agent histories.
35
+- **Decisions now in permanent log:** All three Farnsworth polish decisions + Leela self-learning architecture decision moved to `.squad/decisions.md` main document.
36
+- **Orchestration recorded:** `.squad/orchestration-log/2026-05-19T20:57:55Z-{farnsworth,leela}.md` — outcomes linked to PR #139 and #140.
37
+- **Status:** Team sync complete. Ready for next cycle.