Seed Exact was built by several agents working in parallel, one per package, with a lead owning the shared files. Because Exact requires all data declarations in one root file, the code uses marked ownership blocks and naming prefixes so that edits do not collide. The conventions still apply to anyone changing the app.
Packages
A package is a name shared by a contract file, a source directory and a prefix:
Package | Contract | Source directory | Identifier prefix | Contract tests |
|---|---|---|---|---|
read |
|
|
|
|
discuss |
|
|
|
|
activity |
|
|
|
|
agents |
|
|
|
|
me |
|
|
|
|
profile |
|
|
|
|
vault |
|
|
|
|
crypto | none |
|
|
|
identity | none |
| none: a library | none |
See Feature modules for what each does.
Ownership blocks
app.contract opens with the rule: "the lead owns this file. Each package edits ONLY inside its own // >>> pkg:<name> ... // <<< pkg:<name> blocks". The block kinds are:
Block | Where | Example |
|---|---|---|
| top of file | |
| inside a | |
| before the component | |
| component declarations | |
| component actions | |
| the | |
| the route switch |
app.ts has three unnamed blocks, // >>> imports, // >>> grants and // >>> parts, with a // pkg:<name> comment on a line where the owner matters.
Lead-owned files
app.contract outside the blocks (shared state, pick, follow, back, the root node and tab bar), app.ts outside its blocks, ui.contract, DESIGN.md, and tools/test-server/index.ts are marked lead-owned in their headers. app.json, app.tamber and app.test.contract carry no marker and are treated the same way (inferred). exact.mjs and the marked block of AGENTS.md are generated by Exact and must not be edited. DESIGN.md says workers "propose changes in RESULT.md, don't diverge silently"; that file was part of the build process and is not in the repository.
File naming inside a package
File | Role |
|---|---|
| Exports |
| Network code |
| Pure functions that turn wire data into the shapes the contract declares |
| Bun unit tests, with JSON fixtures beside them |
| Shapes, pure |
| |
| A mock mounted by the local test server |
Naming rules
Root state, derives, resources, mutations, tasks and actions start with the package prefix: discussDraft, agentsSend, vaultPoll. Source names do too, because all sources share one namespace in app.ts (Object.assign lets a later package overwrite an earlier one silently).
Components and shapes are prefixed in PascalCase: AgentRunCard, MeIdentity, DiscussThread.
TestIds start with the package or the thing: agents-send, me-server-input, activity-mark-all, tab-read. Rows append their id: agent-<id>, session-<id>, run-<id>. Read and discuss wrap ids in tid(active, name); see Shared UI.
Every screen takes eid and sets navigationKey=eid on its root.
How to add a route
Add the route line inside your pkg:<name> routes block under the right tab in routes nav. Put literal paths before parameter paths that could match them.
Write the screen component in <pkg>.contract with an eid prop. Add navigationPresentation="modal" to its root for a sheet.
Import it in the use line or your imports block.
Add if e.name == "<route>" with the screen call inside your pkg:<name> view block.
Navigate to it with nav = push(nav, path("<route>", param)). See Navigation.
How to add a resource or mutation
Declare the reply shape in <pkg>.contract and import it.
In your decl block add resource x = pkgSource(args) as shape S else empty() or mutation m as shape S refreshes x then pkgAfter.
Include an owner or visit field in the shape and a Ready derive that checks it. Pass time as an argument. See refresh patterns.
Add actions in your actions block and pass data and actions to the screen as props.
How to add a source
Implement pkgSource: ([a, b], store) => ... in src/<pkg>/sources.ts. Exact regenerates app.contract.d.ts from the contract when it builds, which types the argument tuple (see Commands and verbs).
A new package also adds its import and entry to the imports and parts blocks of app.ts.
If it reaches a new origin, secret or file, add a literal grant in the grants block. See Grants.
Keep each synchronous step short for the turn budget, and add a Bun test.
User stories
The code described here exists to deliver these stories. Each story lists this page in its Trace (traceability).
US-APP-07 Read clear, consistent wording: Naming rules shared by the packages
US-TEAM-04 Understand how the app is built: Ownership blocks, naming and how to add a route, resource or source
US-TEAM-05 Add a story and see it shipped: How a change is made inside a package's blocks
US-TEAM-08 Ask for a design change: Lead-owned files and who may change shared UI
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime