10 Commits
Author SHA1 Message Date
GandClaude Opus 5 c1948d1274 chore: add a formatter (#34)
* chore: add a formatter, matching the style this repo already writes

singleQuote=false was chosen by counting this repo's own
imports, not by fleet decree. The fleet is genuinely split and the two repos
that already had a .prettierrc disagreed with each other, so there was no
standard to restore. Quote style does not cross repo boundaries; having a
gate does.

Markdown is ignored for now — prettier rewraps prose, which would bury the
real diff.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* style: format with prettier (13 files)

Mechanical. No behaviour change. This SHA is listed in
.git-blame-ignore-revs so `git blame` skips it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: teach git blame to skip the reformat

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-31 08:14:25 +00:00
GandClaude Opus 5 d8e80554aa fix(cli): ask the chain which vendors count, not one key by name (#18)
#16 replaced a pinned model with a walked chain and gave this app a second
vendor: `usableChain` drops any provider whose key is absent, so an environment
holding only OPENROUTER_API_KEY is a complete, working configuration — five
usable links — and the HTTP route serves it happily.

`scripts/analyze-cli.ts` never got the message. Its preflight still read

    if (!process.env.GROQ_API_KEY) exit(1)

so that same environment was turned away at the door, by an error naming a key
it does not need. This is the only way to use truthseeker today — there is no
deployment — so the migration's one unmigrated call site was also its most
load-bearing one.

The defect is not the missing key name; it is that the CLI answered a question
lib/llm already answers. `configuredLinks(env)` and `noProviderMessage()` are
now exported and the script asks them. Both derive from the chain: the message
lists `keyEnv` for every provider in it rather than a sentence someone typed, so
a hand-written key list cannot go stale the way a hand-written model id did.

The preflight itself stays — an article fetch is ~20s that cannot produce
anything without a vendor behind it — it just no longer has its own opinion
about what counts.

Three more places carried the same untruth and now don't:

  README      "GROQ_API_KEY … required", and a Stack line still advertising
              `llama-3.3-70b-versatile` — the exact id Groq retired, which is
              what #16 was written to survive.
  .env.example  "Single env var; if/when we swap … change src/lib/llm.ts".
  .gitignore  and that file reached nobody anyway: Next.js's default `.env*`
              swallowed it, so the template explaining which keys this app
              needs has never been in a clone. Now negated and tracked.

Tests: 5 added. Four drive the preflight; the fifth gates the seam the way
claim-types.test.ts gates its own SSOT — it reads analyze-cli.ts and fails if
that file names any *_API_KEY itself. Both of its assertions fail against the
pre-fix script, verified by running them against `git show HEAD:` output.

Verified: npm run verify (lint, tsc, 42 tests) and next build clean; the CLI run
end to end with no keys (exits 1 naming both) and with OPENROUTER_API_KEY alone
(passes the preflight and proceeds — the case that used to exit 1).

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-27 06:12:39 +02:00
GandClaude Opus 5 0c07adf8be ci: call the central auto-merge sweep instead of carrying a copy (#10)
auto-merge-sweep.sh was copied into 22 repos and drifted into EIGHT distinct
versions, 245 to 404 lines. Three of them independently grew different fixes for
real outages, and each fix reached only the repo that wrote it:

  evig, revampit   infra-failure detection + re-run. An Actions incident left
                   main "failure" with no failed job at all; 11 PRs stranded
                   for roughly 14 hours.
  fleetcrown       DEADLOCK naming — a red base with the repairing PR sitting in
                   the queue was indistinguishable from "nothing to merge".
  the other 19     neither.

Nothing could carry a fix across, so every repo waited to hit each outage
itself. This repo now calls the canonical sweep in maonakamoto/dotfiles, and the
local copy is deleted.

The canonical is the union of the three, built on the variant ten repos were
already running rather than on the longest one — the 404-line variant is missing
the step-summary reporting the 296-line one has, so "take the biggest file"
would have silently deleted working behaviour. The merge was 106 insertions and
zero deletions: nothing can be lost by adopting it.

The triggers stay in this file because they genuinely are per-repo: workflow_run
must name the CI workflow exactly, and that name differs across the fleet.

Two details that are silent when wrong, both found by piloting rather than
reasoning:

  rearm_workflows is SPACE-separated. The sweep word-splits it; a comma makes
  one bogus token, every dispatch fails, and the only symptom is that nothing
  deploys — while the sweep still exits 0 and reports a successful merge.

  permissions are declared on the CALLER as well. A called workflow's token is
  capped by what the caller grants, so relying on the callee's block alone can
  hand it a read-only token; the sweep would then merge nothing while exiting 0,
  which is indistinguishable from having nothing to merge.

Verified before this rollout: the canonical ran end to end in dotfiles' own CI,
and the reusable-workflow path ran end to end in the pilot repo (s-ink).

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-16 14:54:19 +00:00
G 243879110f fix(ci): declare the failing-job list before the branch that can skip it (#8) 2026-08-07 09:59:06 +00:00
G 5a34847faf fix(ci): a red base must not trap the PR that repairs it (#7) 2026-08-07 09:38:10 +00:00
G b65154da2d fix(ci): stop skipping conflicts, and keep branches current (#6) 2026-08-07 07:14:47 +00:00
GandClaude Opus 5 727c9d6b0e fix(ci): drain the merge queue oldest-first, not newest-first (#5)
`gh pr list` returns newest-first, and the sweep merges the first eligible PR
then stops. So the newest green PR wins every sweep, and an older one can wait
indefinitely.

Observed in maonakamoto/fleetcrown on 2026-08-06: two consecutive sweeps merged
the two newest PRs while three older green ones sat untouched and were never
even evaluated. With several agent sessions opening PRs continuously that is
starvation — and it starves the worst candidate, since the longest-waiting PR
is the one whose checks were proven against the most now-stale base.

PR numbers increase monotonically with creation, so sorting ascending is FIFO.
The ordering was never a decision, just whatever gh happened to return.

Fixed upstream first (fleetcrown #182) and verified in production there: the
sweep immediately after it landed correctly took the oldest open PR rather than
the newest. This is that one-line change, applied to the fleet.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 13:42:38 +00:00
G b2fa534e6f ci: green PRs merge and deploy themselves (#4)
* ci: add the auto-merge sweep policy

* ci: green PRs merge and deploy themselves

* ci: allow CI to be dispatched so auto-merge can re-arm it
2026-08-05 19:18:17 +02:00
Mao NakamotoandClaude Sonnet 5 69461ed753 fix: report truncated, not raw, char count after analysis
fetched.textLength reported the full pasted/fetched length even when
the 20k-char cap (21d025e) cut the text before it reached the model —
so the UI and CLI silently claimed to have "examined" more than was
actually analyzed. Now textLength reflects what was sent to the LLM,
and a truncated flag surfaces a visible note in both the web UI and
CLI output.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-04 04:07:00 +00:00
Mao Nakamoto e2f584440d feat: initial truthseeker scaffold + first-principles analyzer
First-principles rebuttal generator. Given a URL (or pre-fetched
article text via --text), produces a structured JSON analysis:

- title, author, publication, publication_date, language
- 2-3 sentence neutral summary
- 3-5 core claims with type (factual/normative/causal) and
  evidence_quality flag
- 250-500 word first-principles critique (engages with the strongest
  version of the article's argument, separates claim types, refuses
  the tribal frame)
- named sources with role + attributed claim
- biases to consider (specific, not generic political-axis labels)
- what would change the assessment

## Stack
- Next.js 16 + React 19 + Tailwind v4
- Groq llama-3.3-70b-versatile via src/lib/llm.ts (single swap point
  for the LLM provider)
- No third-party deps for the article fetch — vanilla regex + entity
  decode in src/lib/article-fetch.ts, no jsdom/Readability overhead
- tsx-powered CLI at scripts/analyze-cli.ts: writes
  analyses/<slug>.md so output is reviewable + committable

## Modes
1. URL mode: `npm run analyze -- "https://..."`. Direct fetch with
   real browser-shaped headers. Works for most public sites.
2. Pre-fetched text mode: `npm run analyze -- "https://..." --text
   path/to/body.txt`. Escape hatch for bot-gated sources (Republik,
   most major paywalled outlets) — fetch in a logged-in browser, save
   to a file, pass the path in. URL still rides along for attribution.

## Why this project exists
Articles in the wild bundle factual, normative, and causal claims
under one rhetorical posture. The job of a careful reader is to
separate them, then engage with the load-bearing parts. truthseeker
does that mechanically so the reader's attention stays on the
substance.

## Architecture (SoC)
- src/lib/article-fetch.ts — HTTP + HTML → plain text (pure function)
- src/lib/llm.ts — Groq client (the only paid edge)
- src/lib/prompts.ts — system prompt + user-prompt builder (the
  load-bearing piece; iterate independently of plumbing)
- src/lib/analysis.ts — orchestrator: analyzeUrl + analyzeText
- src/app/api/analyze/route.ts — thin POST wrapper around analysis.ts
- src/app/page.tsx — URL input + result render (client-side)
- scripts/analyze-cli.ts — no-server CLI that calls the same analysis lib

Built as the first dogfood project on top of FleetCrown's bootstrap
loop. See https://fleetcrown.vercel.app/thoughts/from-idea-to-first-commit-the-fleetcrown-bootstrap-loop
for the loop's design context.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
2026-06-05 15:48:43 +02:00