Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@ export async function startBridgeSchemas(): Promise<void> {
const members = schema.instance().table("members");
if ((await members.count()) > 0) return;
const row: MemberRow = { _id: "member_1", ["constructor"]: "ctor value", note: "plain column" };
await members.insert([row]).run();
await members.insert([row], { conflict: "update" }).run();
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ export async function seedBrowseFixtures(): Promise<void> {
.insert([
{ _id: "acc_ada", handle: "ada", password: ACCOUNT_PASSWORD, card_number: ACCOUNT_CARD, display_name: ACCOUNT_NAME_LONG },
{ _id: "acc_bob", handle: "bob", password: "$argon2id$v=19$stored-hash-of-bob", card_number: "enc:v1:stored-cipher-of-bob", display_name: "Bob" },
])
], { conflict: "update" })
.run();
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ export async function seedMetrics(): Promise<void> {
band: `band-${(index % 5) + 1}`,
value: (index * 7) % 101,
}));
await readings.insert(rows).run();
await readings.insert(rows, { conflict: "update" }).run();
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ async function seedTable<Name extends keyof ShopTables>(
) {
const target = schema.instance(region).table(table);
if ((await target.count()) > 0) return;
await target.insert(rows).run();
await target.insert(rows, { conflict: "update" }).run();
}

/** Fills each region of the shop once, on a database that has none of it. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ export async function seedVault(): Promise<void> {
if (!schema) return;
const notes = schema.instance().table("plain_notes");
if ((await notes.count()) > 0) return;
await notes.insert([{ _id: "note_1", body: "first note" }]).run();
await schema.instance().table("parents_registry").insert([{ _id: "reg_1", label: "registry one" }]).run();
await schema.instance().table("parents_links").insert([{ _id: "lnk_1", registry_id: "reg_1" }]).run();
await schema.instance().table("wide_records").insert([{ _id: "wide_1", registry_id: "reg_1", c01: "a", tail_marker: "tail" }]).run();
await notes.insert([{ _id: "note_1", body: "first note" }], { conflict: "update" }).run();
await schema.instance().table("parents_registry").insert([{ _id: "reg_1", label: "registry one" }], { conflict: "update" }).run();
await schema.instance().table("parents_links").insert([{ _id: "lnk_1", registry_id: "reg_1" }], { conflict: "update" }).run();
await schema.instance().table("wide_records").insert([{ _id: "wide_1", registry_id: "reg_1", c01: "a", tail_marker: "tail" }], { conflict: "update" }).run();
}
7 changes: 4 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ Verify a boundary against the imports a developer or agent would plausibly write
| String-keyed object tables are read through own keys only | `antelopejs/no-inherited-key-lookup` |
| A type guard checks each member it narrows to; keys with `Object.hasOwn` | `antelopejs/no-presence-only-type-guard` |
| A type guard checks the nested elements and values it claims | review; no tool |
| A startup read does not decide an insert another replica can race | `antelopejs/no-read-then-insert` |
| `Object.assign` writes no `unknown`, `any` or mistyped value over a field | `antelopejs/no-unsafe-object-assign` |
| Every file type-aware lint reads is listed by a tsconfig | `antelopejs/require-tsconfig-include` |
| Params ≤ 5, function ≤ 120 lines, file ≤ 500 lines, depth ≤ 4, complexity ≤ 20 | `eslint/max-*`, `eslint/complexity` |
Expand Down Expand Up @@ -129,9 +130,9 @@ Verify a boundary against the imports a developer or agent would plausibly write
| A CI gate reads `needs.<id>` only of jobs in its `needs` | `antelopejs-sync --check` |
| Entry-only rules exempt no tracked outsider | `antelopejs-sync --check` |
| A DMS layer's `build/backend-boundary.ts` is the pack's plugin | `antelopejs-sync --check` |
| No `skipLibCheck` in the root tsconfig or one `typecheck` or `build` uses | Reported by `antelopejs-sync` (note only) |
| `build` skips the lib check only over what `typecheck` checks | Reported by `antelopejs-sync` (note only) |
| `release` runs `typecheck` | Reported by `antelopejs-sync` (note only) |
| No `skipLibCheck` in the root tsconfig or one `typecheck` or `build` uses | `antelopejs-sync --check` |
| `build` skips the lib check only over what `typecheck` checks | `antelopejs-sync --check` |
| `release` runs `typecheck` | `antelopejs-sync --check` |
| A test names the wrong implementation it catches | review; no tool |

<!-- antelopejs-guardrails:end -->
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"@antelopejs/dms-frontend": ">=0.10.0 <0.11.0",
"@antelopejs/interface-data-api": ">=0.6.1 <1.0.0",
"@antelopejs/mongodb": "^1.6.2",
"@antelopejs/tooling-configs": "^0.5.0",
"@antelopejs/tooling-configs": "^0.5.1",
"@types/chai": "^5.2.3",
"@types/mocha": "^10.0.10",
"@types/node": "^24.0.0",
Expand Down
2 changes: 1 addition & 1 deletion playground/src/shop-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ async function seedTable<Name extends keyof ShopTables>(
) {
const target = schema.instance(region).table(table);
if ((await target.count()) > 0) return;
await target.insert(rows).run();
await target.insert(rows, { conflict: "update" }).run();
}

/** Fills each region of the shop once, on a database that has none of it. */
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading