Skip to content

chore(apps): check the docs site and viewer in CI, and bind the viewer to the engine's types - #40

Merged
zz-plant merged 1 commit into
mainfrom
chore/finish-monorepo
Oct 13, 2026
Merged

zz-plant merged 1 commit into
mainfrom
chore/finish-monorepo

Conversation

@zz-plant

Copy link
Copy Markdown
Collaborator

First of the follow-ups to #37, which imported refract-docs and refract-ui into apps/docs and apps/ui. This covers step 2 of docs/repositories.md ("move the viewer") and the CI half of step 1. The docs deploy, the Python adapter and retiring the old repos come in separate PRs.

Nothing was checking the apps

Since #37, nothing has run the apps' lint, tests or builds:

  • their workflows sat under apps/*/.github, which GitHub doesn't read
  • the root vitest config excludes apps/

This PR adds two path-filtered workflows, kept separate from the engine gate:

  • docs-site.yml runs the docs site's checks
  • viewer.yml runs the viewer's checks, and also runs when packages/evidence-graph or docs/examples change, since those are what the viewer's contract checks against

The viewer's event types had drifted

apps/ui/src/types.ts kept its own copy of the engine's types. That copy:

  • still listed claim_first_seen, claim_softened and the other claim_* names, which the engine renamed sentence_*
  • lacked edit_cluster_detected and talk_activity_spike

As a result, the timeline colours keyed to the old names never applied.

The viewer now:

  • imports EventType and EvidenceEvent from @refract-org/evidence-graph as types only (workspace:*). The bundle carries nothing from the engine and is about the same size: 30.8 kB, was 30.6 kB.
  • keeps its event list as a Record<EventType, true>. Adding a fake type to the engine's EventType fails the viewer's build with "Property 'drift_probe' is missing" (tested, then reverted).
  • colours weakening and strengthening wording from the event's directionSignal, since the engine no longer has claim_softened or claim_strengthened
  • has tests/engine-contract.test.ts, which imports, lists and re-exports the engine output in docs/examples/ and an event of every type. It checks that each event comes out deep-equal to what went in.

Removed per-app scaffolding

  • Removed: both apps' bun.lock, the docs site's package-lock.json, the .husky folders, the mise.toml files (identical to the root's), the prepare: husky scripts, and the dead .github folders. The docs site's CODEOWNERS named the same team as the root's.
  • Kept: each app's .lintstagedrc.json (the root hook applies it, as this commit's own hook run shows), plus biome.json, .opencode, LICENSE and AGENTS.md.

Docs

The package links, both apps' AGENTS.md files, the root README, AGENTS.md, COMPATIBILITY.md and docs/repositories.md now say where each app lives and which workflow checks it. So do the site pages that told readers to clone refract-ui.

The public site URL is unchanged, and the site still deploys from refract-docs; the next PR moves that.

Verification

  • Root gate: frozen install, build, biome ci packages/, typecheck, check:boundaries, test (408 passed, 9 live-API tests skipped), check:examples and check:release --pack all pass.
  • apps/docs: lint, tests (103) and build pass.
  • apps/ui: lint, tests (31) and build pass.

For a decision

apps/ui/LICENSE is an MIT licence ("Copyright (c) 2024 NextConsensus"), but its package.json declares AGPL-3.0, and docs/repositories.md planned AGPL-3.0. This PR changes neither.

🤖 Generated with Claude Code

…r to the engine's types

#37 imported refract-docs and refract-ui into apps/docs and apps/ui, but
nothing ran their checks: their workflows sat under apps/*/.github, which
GitHub does not read, and the root vitest config excludes apps/.
docs-site.yml and viewer.yml run each app's lint, tests and build,
path-filtered and separate from the engine gate. viewer.yml also runs when
packages/evidence-graph or docs/examples change.

The viewer's hand-kept event types had drifted: they still listed the
claim_* names the engine renamed sentence_*, and lacked
edit_cluster_detected and talk_activity_spike, so timeline colours keyed to
the old names never applied. It now imports EventType and EvidenceEvent from
@refract-org/evidence-graph as types only (the bundle is unchanged in
content), and its event list is a Record<EventType, true>: adding a fake
type to the engine's EventType fails the viewer's build. Weakening and
strengthening are coloured from directionSignal. engine-contract.test.ts
imports, lists and re-exports the engine output in docs/examples and an
event of every type.

Per-app lockfiles, .husky, mise.toml and prepare scripts are removed in
favour of the root's; each app's .lintstagedrc.json, biome.json, .opencode
and LICENSE stay. Package links, AGENTS.md, README, COMPATIBILITY.md,
docs/repositories.md and the site pages that said to clone refract-ui now
point at this repository. The public site URL is unchanged; deployment
still runs from refract-docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zz-plant
zz-plant merged commit cfe472e into main Oct 13, 2026
5 of 6 checks passed
@zz-plant
zz-plant deleted the chore/finish-monorepo branch October 13, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant