You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Restructure agent docs: principles in AGENTS.md, mechanics in RUNNING.md
Root AGENTS.md becomes the stable contract layer and gains the missing
piece both recent agent sessions fumbled: a definition of done for
user-visible work. Done is something the user can open — (1) an e2e
scenario with direct links to the runs that prove the change, (2) the
session's dev server left up and reachable over the tailnet so the user
can take over, (3) an honest list of what to try by hand. The same
machinery runs in reverse: seed an environment into a state (live bug
repro, staged data) and hand across the link.
Mechanics move to a new RUNNING.md that opens by declaring itself
possibly stale — trust it as a starting point, verify against the code,
update on drift. It carries setup, the boot recipes (pointing at the
e2e globalsetup files as source of truth), run/viewer/sharing
operations, the leave-an-instance-up recipe with the Secure-cookie/
HTTPS constraint, and the hard-won environment gotchas.
e2e/AGENTS.md points at both. Docs deliberately avoid pinning URL
formats and flags that churn — agents discover those.
|`GET /_emulate/openapi`| A real OpenAPI document for the service — feed it straight to Executor's addSpec to register the emulator as an integration |
53
-
|`POST /_emulate/credentials`| Mint a credential in the service's real shape: `{"type":"api-key"}`, bearer tokens, OAuth/OIDC clients, client-credentials apps |
|`POST /_emulate/seed`| Add state via the service's seed schema (e.g. WorkOS `{"oauth":{"default_access_token_ttl_seconds":60}}` to compress token expiry) |
56
-
|`POST /_emulate/reset`| Reset state + logs, replay seed |
57
-
|`GET /_emulate/state`| Current store snapshot |
58
-
|`GET /_emulate/coverage`| Which operations are implemented vs partial |
59
-
|`GET /_emulate/connections`| Copyable SDK/env/curl snippets resolved against this instance |
|`GET /_emulate/openapi`| A real OpenAPI document for the service — feed it straight to Executor's addSpec to register the emulator as an integration|
53
+
|`POST /_emulate/credentials`| Mint a credential in the service's real shape: `{"type":"api-key"}`, bearer tokens, OAuth/OIDC clients, client-credentials apps |
|`POST /_emulate/seed`| Add state via the service's seed schema (e.g. WorkOS `{"oauth":{"default_access_token_ttl_seconds":60}}` to compress token expiry)|
56
+
|`POST /_emulate/reset`| Reset state + logs, replay seed|
57
+
|`GET /_emulate/state`| Current store snapshot|
58
+
|`GET /_emulate/coverage`| Which operations are implemented vs partial|
59
+
|`GET /_emulate/connections`| Copyable SDK/env/curl snippets resolved against this instance|
Run `bun run bootstrap` first in any fresh checkout or worktree. It is
6
-
idempotent: runs `bun install` (whose prepare hook builds the internal
7
-
packages dev servers fail without) and installs Playwright chromium.
8
-
Skipping it is why fresh worktrees die with "Failed to resolve entry for
9
-
package '@executor-js/vite-plugin'". The `vendor/` submodules are NOT
10
-
needed — nothing imports from `vendor/` at runtime; those forks are consumed
11
-
from npm (see `vendor/README.md`). `bun run bootstrap --forks` inits them
12
-
only when you're deliberately developing a fork.
13
-
14
-
## Environment Gotchas (learned the hard way)
15
-
16
-
- The shell is fish, and the working directory resets between Bash calls. Use
17
-
absolute paths rooted at THIS worktree (check `pwd`), never
18
-
`/Users/rhys/src/executor` from memory, and don't rely on a prior `cd`.
19
-
- Don't write probe scripts to `/tmp` — they can't resolve workspace packages
20
-
(`effect`, `playwright`, ...). Put scratch scripts under the repo root
21
-
(`scratch/` is gitignored) so bun resolves the workspace.
22
-
-`bun.lock` conflicts on rebase/merge: take either side, then re-run
23
-
`bun install` to regenerate it — never hand-merge the lockfile.
24
-
- e2e dev-server ports are derived per checkout (`cd e2e && bun run ports`).
25
-
If a boot reports a squatted port, an old dev server leaked — kill it by
26
-
PID from the error message; don't move your own ports to dodge it.
3
+
This file is principles — the contracts that stay true while implementations
4
+
churn. For how to actually run, boot, share, or navigate things today
5
+
(fresh-worktree setup, dev servers, ports, environment gotchas), see
6
+
[RUNNING.md](RUNNING.md) (which may lag reality; it says so itself). For
7
+
writing e2e scenarios, see [e2e/AGENTS.md](e2e/AGENTS.md). Run
8
+
`bun run bootstrap` first in any fresh checkout or worktree.
27
9
28
10
## Task Completion Requirements
29
11
@@ -36,43 +18,57 @@ only when you're deliberately developing a fork.
36
18
- For broad or merge-ready changes, the full gates are `bun run format:check`,
37
19
`bun run lint`, `bun run typecheck`, and `bun run test`.
38
20
39
-
## Attribution
21
+
## Handing Back Work: Evidence, Not Assertions
40
22
41
-
Do not add any AI assistant, Claude, Anthropic, or Co-Authored-By
42
-
attribution/trailers to commits, commit messages, PRs, or generated files.
23
+
"Done" is something the user can open, not a claim. When work changes what a
24
+
user sees or touches, the handoff has three parts, delivered unprompted:
43
25
44
-
Pull request titles and descriptions are going to a public GitHub repo, so
45
-
avoid using specific names or internal info unless explicitly stated to.
46
-
47
-
## Show Changes in PR Descriptions
26
+
1.**Watch it** — an e2e scenario covers the change, and the handoff links
27
+
directly to the specific run(s) that prove it, with one line each on what
28
+
to look at. Never hand back a bare wall of green results: the user's
29
+
question is "show me the new thing working," not "is everything healthy?"
30
+
2.**Touch it** — leave the session's dev server running and reachable over
31
+
the user's tailnet, with credentials, so they can take over and poke at
32
+
it. The instance you already booted for e2e IS this — leave it up rather
33
+
than standing up something separate.
34
+
3.**What to try** — name the paths worth exercising by hand, especially
35
+
ones no scenario pins yet. Honesty about coverage gaps is part of the
36
+
handoff. A human driving a real browser from another device reaches
37
+
states the test harness structurally cannot; invite that.
48
38
49
-
When a change is user-visible and an e2e scenario covers it, embed the run's
50
-
recording in the PR description — reviewers should see the change, not just
51
-
read about it.
39
+
The same machinery runs in reverse: you can seed an environment INTO a
40
+
state — reproduce a bug live, stage data for the user to take over, set up
41
+
a walkthrough — and hand across the link. "Here's the broken state, live"
42
+
beats a paragraph describing it.
52
43
53
-
```
54
-
bun e2e/scripts/pr-media.ts e2e/runs/<target>/<scenario-slug>
55
-
```
44
+
If no scenario covers the change yet, that is the cue to write one. When a
45
+
change is user-visible, embed the run's recording in the PR description —
46
+
reviewers should see the change, not just read about it.
56
47
57
-
converts the run's recording (browser `session.mp4` or `terminal.cast`) to a
58
-
gif, uploads it to the `e2e-media` branch, and prints PR-ready markdown to
59
-
paste into the body. Run screenshots (`*.png`) can be passed directly too. If
60
-
no scenario covers the change yet, that is usually the cue to write one.
48
+
Don't memorize the mechanics (ports, viewer, sharing commands) — discover
49
+
them from RUNNING.md and the code; they change.
61
50
62
51
## Service Emulators
63
52
64
53
When a test or demo needs an upstream API, OAuth/OIDC provider, or webhook
65
54
source, use the `@executor-js/emulate` emulators (GitHub, Google, Stripe,
66
55
Resend, WorkOS, and a dozen more) instead of writing a stub. They are
67
56
wire-level and stateful — real SDKs run against them unmodified — and each
68
-
one serves a full OpenAPI spec (`/_emulate/openapi`, ready for addSpec),
69
-
mints real-shaped credentials (`POST /_emulate/credentials`), runs working
70
-
OAuth flows, and records every call in a request ledger
71
-
(`/_emulate/ledger`) you can assert against. Hosted instances exist at
72
-
`https://<service>.emulators.dev` with zero setup. See the `emulate` skill
57
+
serves a full OpenAPI spec ready for addSpec, mints real-shaped credentials,
58
+
runs working OAuth flows, and records every call in a request ledger you can
59
+
assert against. Hosted instances exist at `https://<service>.emulators.dev`
60
+
with zero setup. See the `emulate` skill
73
61
(`.claude/skills/emulate/SKILL.md`) for the control-plane reference and
74
62
recipes.
75
63
64
+
## Attribution
65
+
66
+
Do not add any AI assistant, Claude, Anthropic, or Co-Authored-By
67
+
attribution/trailers to commits, commit messages, PRs, or generated files.
68
+
69
+
Pull request titles and descriptions are going to a public GitHub repo, so
70
+
avoid using specific names or internal info unless explicitly stated to.
71
+
76
72
## Collaboration Notes
77
73
78
74
The user uses speech to text occasionally, so if sentences are weird or words
@@ -116,4 +112,6 @@ before using it.
116
112
117
113
## Other
118
114
119
-
Please make note of mistakes you make in MISTAKES.md. If you find you wish you had more context or tools, write that down in DESIRES.md. If you learn anything about your env write that down in LEARNINGS.md.
115
+
Please make note of mistakes you make in MISTAKES.md. If you find you wish you
116
+
had more context or tools, write that down in DESIRES.md. If you learn anything
0 commit comments