Commit Graph

15 Commits

Author SHA1 Message Date
Yunfei He 929f3952bb docs(divergences): reorganize Ink divergence notes 2026-06-04 16:29:49 +08:00
Yunfei He 87254dd561 docs: add convention for reading Ink source from a fixed local clone (#78)
When parity/divergence work needs Ink's source, clone it once to a fixed path
(/tmp/ink) and read locally instead of relying on node_modules (Ink isn't a
dependency). Always check out and confirm the pinned baseline first — the exact
version/commit lives in .agents/docs/ink-divergences.md — since a claim read
against the wrong Ink version is worse than none.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 00:41:29 +08:00
Yunfei He a9cfc8994e docs: record the concise-records convention in AGENTS.md (#74)
Recorded notes / design docs should be concise and direct — the essential
what + why, led by the principle or intuition — without losing information
or sliding into essays / exhaustive mechanism dumps. Also: when a behavior
is the correct default, state the principle rather than framing it as a
framework limitation.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 23:42:10 +08:00
Yunfei He 936f2ee1ee docs: replace sprawling Ink-parity docs with one focused intentional-divergences doc (#67)
* chore: remove Ink-parity design docs (.agents/docs), keep the code

Removes the Ink-parity loop documentation — ink-parity-loop.md, ink-parity.md,
and the parity-ledger.md — and drops the now-dangling 'Current docs:' list from
AGENTS.md's Context Engineering section (the convention itself is kept). All the
merged parity CODE fixes remain on main; only the documentation/ledger artifacts
are cleared, to re-orchestrate the documentation with a different approach.

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

* docs: add focused Ink intentional-divergences design doc

Replaces the removed sprawling parity docs with one focused doc that records
ONLY where vue-tui deliberately differs from Ink (API surface, additive
features, unavoidable Vue-vs-React semantics, N/A React concepts, framework
idioms) — leaving placeholders for the maintainer to supplement.

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

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 18:11:46 +08:00
Yunfei He 7af3ff3e00 docs(agents): add .agents/docs context-engineering home + Ink-parity loop (#28)
Establishes the committed .agents/docs/ convention (distinct from the
uncommitted docs/ working-notes folder) and seeds the Ink-parity
verification loop:

- ink-parity-loop.md: design spec + reusable /loop prompt (audit →
  test-first fix → codex review → PR → CI → auto-merge, hard codex gate).
- ink-parity.md: pinned Ink reference (v7.0.4, commit 40b3a75) + the
  intentional-divergence allowlist the audit skips.
- parity-ledger.md: working ledger of audit sweeps and confirmed gaps.
- AGENTS.md: "Context Engineering" section documenting the convention.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-29 22:35:14 +08:00
Yunfei He 06ede6fded docs(agents): correct the testing guidance to match the shipped CI
The concurrency notes described `sequence.concurrent: true`, but that was
rolled back — it starved timing-sensitive render tests on the 4-core CI runner.
Rewrite to reflect what actually ships:

- File-level parallelism (fileParallelism: true), tests within a file serial;
  explain WHY in-file concurrency is deliberately avoided (the local-vs-CI
  core-count trap) and that PTY needs pool: forks.
- *.sequential.test.* files group process-global-state tests (fake timers,
  listener/yoga-node counts).
- New rule: tests must not implicitly depend on host env. CI=true flips
  interactive mode off, so both vitest configs force CI:false; inject env
  behavior explicitly and reproduce CI with `CI=true vp run ci` on a fresh
  checkout.
- FORCE_COLOR must also be set in spawned child envs, not just vitest config.
2026-05-29 16:54:13 +08:00
Yunfei He a0ec8d1d33 docs(agents): require a comment when code must deviate from normal style
Record the rule: when code has to be written in a surprising or non-idiomatic
way because the situation requires it (control-char regexes, deliberate
code-point spread, justified lint suppressions), add a comment explaining why,
so the next reader doesn't have to guess whether it's intentional.
2026-05-29 16:54:13 +08:00
Yunfei He 5289062414 docs(agents): update for concurrent-by-default main suite
The main suite is now concurrent too, so correct the earlier "not concurrent"
note. Record the convention: snapshot tests stay concurrent via context-local
expect; process-global-state tests (fake timers, listener/node counts) move to
*.sequential.test.* files marked it.sequential / describe.sequential.
2026-05-29 16:54:13 +08:00
Yunfei He fa626dc90f docs(agents): record PTY-concurrent testing and concurrency constraints
Document that the PTY suite runs concurrently (and the wall-clock-assertion
pitfall there), plus the two patterns that force the main suite to stay
sequential, with the root cause and fix for each:

- Inline snapshots lose test context under concurrency — fixable via the
  context-local `expect` (test.concurrent("...", ({ expect }) => ...)).
- Fake timers mutate process-global timer functions, so concurrent tests
  clobber each other's mocked timer state — not fixable with context; must
  stay sequential.

Investigated empirically: enabling sequence.concurrent on the main suite fails
deterministically (not flaky) in exactly the snapshot files (background-color,
borders) and fake-timer files (throttle, animation-scheduler).
2026-05-29 16:54:13 +08:00
Yunfei He 4ca3c70a70 chore: remove docs/ from git and add no-commit rule to AGENTS.md
docs/ is for local working notes and specs — should not be tracked.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 16:08:48 +08:00
Yunfei He 0bf3bf32ef chore: set FORCE_COLOR=1 in test env for realistic ANSI output
Tests must exercise the same ANSI code paths users see. Without
FORCE_COLOR, chalk disables all color in non-TTY test environments,
making style bugs invisible to the test suite.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 17:47:26 +08:00
Yunfei He ca25ccd96e fix(paint): continuous backgroundColor across wrapped text lines
- Wrap each text line with applyChalk(bgProps) after wrapText so
  background color is reapplied on every wrapped line (wrap-ansi
  doesn't carry ANSI state across line breaks)
- Add wrapped-text backgroundColor regression test
- Fix typo: color=" cyan" → color="cyan" in example
- Add FORCE_COLOR=3 debugging tip to AGENTS.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 11:31:00 +08:00
Yunfei He ecad937af9 docs: add test-first bug fix rule to AGENTS.md
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 11:16:06 +08:00
Yunfei He 20b412ace1 refactor: convert all SFCs to script setup
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 22:39:11 +08:00
Yunfei He def33588e3 chore: monorepo scaffold and shared config
Workspace setup with pnpm, Vite+, and shared TypeScript config.
Includes @vue-tui/utils and AGENTS.md project conventions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 18:13:22 +08:00