Skip to content

Commit 7cd2ee9

Browse files
committed
docs(agent-feedback): add agent-feedback setup and take over the streaming render gap
1 parent ce33921 commit 7cd2ee9

8 files changed

Lines changed: 68 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# @marko/testing-library
2+
3+
Simple and complete Marko testing utilities that encourage good testing practices.
4+
5+
## Agent feedback
6+
7+
Anything actionable but out of scope for the current task — a suspected bug, cleanup, a perf/size win, tooling friction, or code that was confusing — must be recorded in [`agent-feedback/`](agent-feedback/README.md) before finishing. Don't silently drop it, and don't fix it inside an unrelated diff.

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

agent-feedback/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Agent Feedback
2+
3+
Actionable observations that were **out of scope for the task that surfaced them**. If something is in scope, fix it instead. Do not expand a task's diff to fix issues recorded here.
4+
5+
## When to add an entry
6+
7+
While working on any task, record anything a future contributor should act on:
8+
9+
- a suspected bug you couldn't pursue → `bugs.md`
10+
- duplication, dead code, inconsistency, refactor opportunities → `cleanup.md`
11+
- runtime speed or bundle size opportunities → `perf.md`
12+
- friction in builds, tests, tooling, or repo workflows → `dx.md`
13+
- code or docs that were confusing, and what would have clarified them → `unclear.md`
14+
15+
## Rules
16+
17+
1. **Search the category file first.** If an entry already covers it, don't duplicate; append a corroborating sentence only if you have new information.
18+
2. **Be self-contained.** Include enough detail (paths, symbols, reasoning) that someone can act without re-discovering your analysis. Never reference "my earlier analysis" or conversation context.
19+
3. **Cite by stable symbol, not line number.** Line numbers rot with the next edit; anchor the primary citation to the nearest enclosing stable symbol (exported function, class, variable, or a heading for docs). A line number may appear in the body as a secondary hint.
20+
4. **Append to the end** of the category file.
21+
5. Entries are **removed when resolved** (delete, don't mark done; git history is the archive).
22+
6. **Verify before recording.** A guess is not feedback.
23+
24+
## Resolving a "won't fix" item
25+
26+
When a maintainer has explicitly deemed an item "won't fix" / "not worth it", resolve it by adding a brief inline comment at the code site that captures the decision (so it is not re-filed), then remove the entry. Only on such an explicit call — never on your own initiative.
27+
28+
## Entry format
29+
30+
```md
31+
## <one-line imperative summary>
32+
33+
`<primary/file/path.ts>``<nearestStableSymbol>` | 2026-07-02 | impact:<low|med|high> | effort:<low|med|high>
34+
35+
<2–6 sentences: the problem, why it matters, and a concrete suggested direction,
36+
ending with the check that re-verifies the claim (a command, input, or
37+
observation). Cut evidence beyond what a fixer needs to act; further detail is
38+
re-derived from the citation. Additional file paths inline as needed.>
39+
```

agent-feedback/bugs.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Suspected Bugs
2+
3+
Out-of-scope defects noticed while working on something else. Format and rules: [README.md](README.md).
4+
5+
## Consume the first render chunk in `render()` instead of awaiting the completed stream
6+
7+
`src/index.ts``render` | 2026-07-30 | impact:med | effort:med
8+
9+
The Marko 6 branch does `String(await (template as any).render(input))`, and that await settles only once marko's `ServerRendered` boundary reaches `FlushStatus.complete`, so `*.server.test.ts` can never observe an `<await>`/`<try>` placeholder or any intermediate streaming state — the HTML handed to `JSDOM.fragment` is always the fully drained output, and a fixture whose `load()` promise never settles hangs `render()` until vitest's timeout with no diagnostic. `toString()` is not an escape hatch: marko throws "Cannot consume asynchronous render with 'toString'" while the render is still pending. Nothing is needed from marko — the object returned by `template.render(input)` already exposes `[Symbol.asyncIterator]()`, `pipe()` and `toReadable()`, and a `for await` over a `<try><await>` fixture yields the `Loading…` placeholder in chunk one — so the fix is local: read the first chunk and stop, either as the default or behind a new flag on `RenderOptions` in `src/shared.ts`, leaving the Marko 3/4/5 callback branch untouched. Note CI does not cover this path today: `devDependencies` pins `marko@^5.39.13` while `peerDependencies` allows `3 - 6`, so reproducing needs a Marko 6 install. Re-verify by adding a `<try><await>` fixture under `src/__tests__/fixtures/` plus a case in `src/__tests__/render.server.test.ts` asserting the placeholder text, then running `pnpm test` — today that case sees only resolved content, or times out when the promise never settles.

agent-feedback/cleanup.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Cleanup
2+
3+
Duplication, dead code, inconsistencies, refactor opportunities. Format and rules: [README.md](README.md).

agent-feedback/dx.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Developer Experience
2+
3+
Friction in builds, tests, tooling, or repo workflows. Format and rules: [README.md](README.md).

agent-feedback/perf.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Performance
2+
3+
Runtime speed and bundle size opportunities. Format and rules: [README.md](README.md).

agent-feedback/unclear.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Unclear Code & Docs
2+
3+
Things that were hard to understand, and what would have clarified them. Format and rules: [README.md](README.md).

0 commit comments

Comments
 (0)