Skip to content
All docs

Docs · Technical reference

Agent instructions

Source: AGENTS.md

On this page

For a product that offers data move-in, sign in as the owner and use its import screen. First step: open this path on the destination app:

Text
/app/import

Upload a supported source export, review the plan and its differences, then approve that exact plan to apply it. Reconcile the result against native data; use Undo from the same history when needed. Base's reference accepts people JSON here, not installation .rer archives. Editions adopt this same door with their own supported readers and native adapters.

This technical foundation has no product import screen or product data yet. When adding data move-in, mount the shared door and build /app/import before publishing that workflow; do not add a separate importer. Follow Base's door adoption guide.

Launch for review

When asked to launch, run or review this app as it is (a local look; nothing is being set up for a company), run these two lines from the checkout root (the second with the version the first prints) and nothing else:

Shell
npm view @runeditrun/rer time dist-tags --json | node -e 'const p=JSON.parse(require("fs").readFileSync(0)),t=p.time,l=t[p["dist-tags"].latest];console.log(Object.keys(t).filter(v=>/^\d+\.\d+\.\d+$/.test(v)&&t[v]<=l&&Date.now()-Date.parse(t[v])>=6e5).sort((a,b)=>t[a]<t[b]?-1:1).pop())'npx -y --cache .rer-home/npm @runeditrun/rer@VERSION dev
  • It installs and sets up a fresh checkout by itself and prints progress; a first launch can take several minutes. Give the shell tool at least 10 minutes. If the tool times out, run the same rer dev again: it resumes.
  • Never run install, setup, reset or deploy for a review launch, and never ask for an email, port, password or answers file. These rules cover review launches only, not setting the seed up for a company (next section).
  • Give the owner the RER_READY address and the RER_OPEN link, and ask nothing. RER_OPEN is a credential: share it only with the owner, in this chat. Independently authored apps use their own declared sign-in flow.
  • Stop the app with rer dev --stop. If a start is refused, the message names the cause and the next command: run that command.

Never install rer or change PATH for this. Every rer in this file means npx -y --cache .rer-home/npm @runeditrun/rer@VERSION, run from the project folder (Node 22 or later; with none, that is your first fix), so rer dev is that line followed by dev. VERSION is one rer version for the whole session: the newest npm has listed for at least 10 minutes (for minutes after each publish, @latest can name a version npm cannot install yet). Print it once with the first line of the launch block and write that number into every command, as rer's own messages do.

Run it locally

This guide ships with a composed, runnable foundation edition. To install for a real owner instead of a review launch, run the verbs yourself from that edition's checkout root. rer runs each verb with this checkout's own pinned published @runeditrun/rer package.

Shell
rer installrer setup --owner-email you@example.comrer dev

Commands that run project work select the exact Node version declared by the project. They use an exact matching installed runtime or a checksum-verified copy cached at ~/.rer/node/node-vVERSION-PLATFORM-ARCH/; when needed on supported platforms, the runner retrieves the official Node release and checks its SHA-256 against SHASUMS256.txt. It does not change global Node installations. Set RER_NODE_AUTO=0 to disable automatic selection. If selection is disabled or acquisition fails, the command reports a repair invocation in this form: npm exec --yes --package=node@VERSION -- node SCRIPT VERB --cwd PROJECT. Help, check, describe, doctor and stop do not select or acquire Node.

After RER_READY, dev prints RER_SIGNED_IN EMAIL and RER_OPEN URL. Open that URL on this computer: the app opens signed in as the owner and finishes first-run setup at /setup. Treat the line as a credential. dev --as PERSONA starts as a persona or signed out. Legacy dev --login uses the same automatic sign-in. Until first-run completion is stored durably, app routes send the signed-in owner to /setup; signed-out visitors sign in and return there. Once complete, /setup opens the app or settings. Development and demo mail is silently suppressed.

The saved local port is used; a first setup saves the first free port from 8787. Explicit ports are decimal integers from 1 through 65535 and must be free; a busy requested port fails instead of silently moving. Only 127.0.0.1, localhost and ::1 are allowed. Dev applies the selected host and port to both the listener and runtime bindings; readiness is bounded and failure stops the owned processes.

Missing non-interactive setup answers exit 3 and name the manifest fields. Read rer-setup.json and pass a private, mode-0600 JSON object keyed by those names using rer setup --answers PATH --non-interactive, for example {"OWNER_EMAIL":"owner@example.com"}. Secret values stay in private inputs and never go in command arguments. A setup rerun with the saved owner and origin preserves existing owner/data and exact private settings. Conflicting saved identity or origin reports an actionable recovery path. Review reset's exact removal inventory before confirmation. If data must be kept, back up this installation first; restore that archive only into an empty destination.

Queue waits report their reason and live position while the command waits. Package mode has no queue status command.

Use the setup prompt instead of --owner-email when entering the real owner mailbox. Open the RER_OPEN URL printed by dev on this computer; the app opens signed in as the owner, including with legacy dev --login. No external email is sent in development or demo mode. Stop dev with rer dev --stop or Ctrl-C, and stop preview with rer preview --stop before build or verification.

In dev and demo, invite a person and choose Sign in as <name> in operator access or at /signin. The same one-click entry opens /app with their assigned role. Each local browser profile first opens RER_OPEN for the checkout key cookie. Mail is silently suppressed; there is no email-reading step.

Shell
rer verifyrer reset --yesrer deployrer describe

To back up and restore this installation, use:

Shell
rer export --output exports/installation.rerrer import --input exports/installation.rer --yes

These commands save and restore a supported installation archive. They do not use the reviewed import door or provide its plan, reconciliation and Undo. Archive restore requires an empty destination and explicit confirmation. Use the signed-in import door when bringing records in.

Reset removes declared local data and settings. Archive restore requires an empty destination and explicit confirmation. Read RUN-LOCALLY.md for supported flags, private state, deployment inputs and remote limitations.

pnpm typecheck and rer verify use checkout-local, gitignored .cache/typecheck.tsbuildinfo; deleting it forces a full check, while rer build builds the real Worker and assets.

Work on this foundation

Choose and verify the edition UX before adding product functionality. This source includes minimal real owner/operator auth, D1 and silent development mail suppression. It has no product domain or background jobs.

A change that ships or alters a contract clause updates that clause's row in CONTRACT.md's Status table in the same PR; rer check refuses a table that disagrees with the contract.

When adding private HTTP routes or Start functions, reuse native sessions and enforce authorization in every server function handler, including direct transport calls; route guards alone are insufficient. Use server-only modules and dynamic imports inside createServerFn handlers so secrets never enter the client. Consult the pinned Base migration recipe and default-seed reference and run equivalent direct unauthenticated transport checks.

Keep actual Queue/Cron handlers and named Worker exports in src/server.ts when adding those capabilities. The dispatcher only selects HTTP ownership; it does not authenticate or catch failures.

setup builds, applies declared migrations, prepares the explicit first owner and stops its temporary Worker. dev serves actual Vite HMR with the same auth and data. Managed foreground servers remain active in their first invocation; compatible repeated invocations reuse the server and exit. Stop before build or verification.

deploy --dry-run validates and builds locally, then reads target secret bindings without provider writes. Real owner-account deploy applies declared D1 migrations and checks health. Local validation does not establish provider acceptance or remote health.

Read ONBOARDING.md before changing the edition-owned answer manifest, branding or installer adapter. Keep rer-setup.json as the single setup manifest and preserve the shared RER command path. The owner may change any source, core schema, UI, framework or infrastructure. Preserve owner requirements and applied migration history; choose any integration method and verify the result. Roll useful implementations and tests into shared source where that supports their maintenance.

Pinned reference: https://github.com/runeditrun/base/blob/fa38858fa0c686bcb78a7d501ab4b5a547233e98/TANSTACK-START-MIGRATION.md Native-session/runtime evidence: https://github.com/runeditrun/base/tree/fa38858fa0c686bcb78a7d501ab4b5a547233e98/default-seed

Porthole start

Read root CONTRACT.md and ACCEPTANCE.md before building. Every product clause is missing; this tree is the technical foundation only. Product identity is just-every/porthole; public development is just-every/run-porthole. Research and evidence belong only in private-porthole. Keep the Base default theme until the separate style process. Pin published rer exactly; do not add a local CLI, mocks, fake telemetry or product claims. Preserve ct’s contract wording; only ct changes its clauses. Source authoring uses edition.json and sources.lock.json. Run touched foundation tests and typecheck, with the complete Verify wall in CI.

Lander-Regenerate

The checked-in contract still uses legacy bold clause paragraphs. Until ct's judged conversion, preserve that source and its untouched acceptance journeys. Refresh touched clauses and derived counts with the seed adapter:

Shell
node scripts/porthole/contract-docs.mjs write PORT-075node scripts/porthole/contract-docs.mjs check PORT-075

Supply the touched clause IDs separated by commas. Regenerate the edition source lock after the final edit and staging any new source files.

After staging every changed path, regenerate and check the edition source lock with pnpm run source:lock and pnpm run source:check. The public API artifact is generated with node scripts/porthole/public-schema.mjs; add --check to verify it without writing.