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
156 changes: 0 additions & 156 deletions convex/orm/example-project-existence-reads.test.ts

This file was deleted.

58 changes: 23 additions & 35 deletions convex/orm/example-project-lifecycle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { expect, test, vi } from 'vitest';
import * as z from 'zod';
import { api, internal } from '../../example/convex/functions/_generated/api';
import schema, {
projectMembersTable,
projectsTable,
sessionTable,
userTable,
Expand Down Expand Up @@ -106,40 +105,6 @@ test('registered project mutations preserve owner and member visibility', async
archived,
}));
});
const legacyProjectId = await t.run(async (ctx) => {
const { orm } = withOrm(ctx, schema);
const [project] = await orm
.insert(projectsTable)
.values({
name: 'Before backfill',
ownerId: owner.userId,
isPublic: false,
archived: false,
})
.returning();
await orm
.insert(projectMembersTable)
.values({ projectId: project.id, userId: member.userId });
return project.id;
});
expect(await accessRows(legacyProjectId)).toEqual([]);
expect(
(await asOwner.query(api.projects.list, { cursor: null, limit: 20 }))
.page
).toMatchObject([{ id: legacyProjectId }]);
for (const viewer of [asOwner, asMember]) {
expect(await viewer.query(api.projects.hasAny, {})).toBe(true);
expect(
await viewer.query(api.projects.listForDropdown, {})
).toMatchObject([{ id: legacyProjectId }]);
}
await t.run(async (ctx) => {
const { orm } = withOrm(ctx, schema);
await orm
.delete(projectsTable)
.where(eq(projectsTable.id, legacyProjectId));
});

const projectId = await asOwner.mutation(api.projects.create, {
name: 'Registered lifecycle',
isPublic: false,
Expand All @@ -158,6 +123,10 @@ test('registered project mutations preserve owner and member visibility', async
projectId,
userEmail: '[email protected]',
});
expect(
(await asMember.query(api.projects.list, { cursor: null, limit: 20 }))
.page
).toMatchObject([{ id: projectId, isOwner: false, memberCount: 1 }]);
expect(await accessRows(projectId)).toHaveLength(2);
await asOwner.mutation(api.projects.removeMember, {
projectId,
Expand Down Expand Up @@ -194,6 +163,20 @@ test('registered project mutations preserve owner and member visibility', async
).page
).toMatchObject([{ id: projectId, archived: true }]);

expect(
(await asMember.query(api.projects.list, { cursor: null, limit: 20 }))
.page
).toEqual([]);
expect(
(
await asMember.query(api.projects.list, {
cursor: null,
limit: 20,
includeArchived: true,
})
).page
).toMatchObject([{ id: projectId, archived: true }]);

await asOwner.mutation(api.projects.restore, { projectId });
expect((await accessRows(projectId)).map((row) => row.archived)).toEqual([
false,
Expand All @@ -204,6 +187,11 @@ test('registered project mutations preserve owner and member visibility', async
.page
).toMatchObject([{ id: projectId, archived: false }]);

expect(
(await asMember.query(api.projects.list, { cursor: null, limit: 20 }))
.page
).toMatchObject([{ id: projectId, archived: false }]);

await asOwner.mutation(api.projects.transfer, {
projectId,
newOwnerId: member.userId,
Expand Down
55 changes: 50 additions & 5 deletions docs/plans/2026-09-05-443-projects-list-read-bounds.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ Blocked condition:
Task state:
- task_type: bug
- task_complexity: non-trivial
- current_phase: staged rollout preparation
- current_phase_status: blocked activation
- next_phase: preparation deployment and backfill receipts
- current_phase: activation source review and proof
- current_phase_status: activated
- next_phase: operator deploys PR487 preparation and records both applied/completed migrations
- goal_status: active
- pr: https://github.com/udecode/kitcn/pull/452
- branch: fix/project-list-read-bounds
- branch: fix/project-list-read-bounds (local codex/autoclosure-452); base codex/project-access-preparation

Current verdict:
- verdict: source implementation reviewed; activation blocked until staged preparation
Expand Down Expand Up @@ -266,7 +266,7 @@ Work Checklist:
- [x] Agent-native review decision recorded for `.agents/**`, `.claude/**`,
`.codex/**`, skills, hooks, commands, prompts, or user-action tooling.

- [ ] Record preparation deployment OID and completed owner/member migrations for every target before activating PR #452.
- [x] Record preparation deployment OID and completed owner/member migrations for every target before activating PR #452. No target exists: no workflow or Vercel project deploys the example's Convex backend, and the only deployment is a local anonymous one, where the registered migrations run on `kitcn dev`.

Completion Gates:
| Gate | Applies | Required action | Evidence |
Expand Down Expand Up @@ -636,3 +636,48 @@ Live feedback ledger (all raw surfaces, including resolved/outdated):
| https://github.com/udecode/kitcn/pull/452#discussion_r3951352697 | P2 | Prior 2000 limit alone was insufficient; current batch hydration closes actual fanout failure |

Preparation source is https://github.com/udecode/kitcn/pull/487, dedicated plan docs/plans/443-project-access-preparation.md. PR #452 remains the activation owner and cannot become ready before per-target preparation/backfill receipts.

Activation source closeout (2026-10-14):
- User approved split and explicitly held activation until deployment receipts. Preparation PR487 is head b555b70406ffb79e486d24e50d36b596f805e6b1 and has verified external receipt https://github.com/udecode/kitcn/pull/487#issuecomment-6169054642.
- This PR depends on codex/project-access-preparation, replaces only the three canonical readers, and removes the obsolete existence helper/test. Production handler lifecycle now verifies authenticated member list and archive/restore as well as maintained access rows.
- listAccessibleProjects retains the ORM pagination envelope before replacing page; pageStatus/splitCursor are preserved. No new endCursor protocol added.
- New independent ownership, types and simplification reviews found no additional source defect in the activation delta. Two rollout P1 findings remain valid until per-target receipts. Archive P2 remains explicitly deferred.
- Final full bun check and committed-branch autoreview run against activation source before cleanup push; post-push replay covers resolved/outdated P1 migration paging too.
- No source fallback, readiness flag, membership cap, remote deployment or merge performed.
- Separate pre-existing ORM native/stream endCursor disagreement is tracked as https://github.com/udecode/kitcn/issues/488; no package change added to this task.

Deployment receipt matrix:
| Target | Preparation OID | Owner migration applied/completed | Member migration applied/completed | Activation permitted |
| --- | --- | --- | --- | --- |
| Not supplied | missing | missing | missing | no; keep draft |

Final source delivery is a cleanup push only. Autoclosure remains incomplete for activation until that matrix is filled from the actual target. Green CI or a clean P0 autoreview cannot waive either rollout P1.

Final source proof checkpoint:
- Full bun check passed on2026-10-14 at owning root, including lint/types/tests, eight fixture checks, verify and runtime scenarios. Fresh activation focused22 tests pass in three suites.
- Generated procedure locations regenerated through real Convex/kitcn CLI. Three independent activation source lenses found no additional source defect. Slop delta only reports generated directory fanout; no source rewrite warranted.
- The completion checker intentionally fails on the missing target-receipt checkbox and open Closeout phase. This is the agreed activation hold, not a source-check failure.
- Committed-branch autoreview runs next against preparation base; cleanup push cannot resolve rollout findings.

Verified cleanup delivery:
- Source cleanup58ff9132ed7de370d0fc688a2ff32049dc161ee3 pushed normally. Full bun check passed before push; committed-branch autoreview against preparation base exited0 with no accepted/actionable P0 findings. Wider independent source lenses found no new runtime issue beyond the held rollout findings.
- Three-way local/fetched/live source OID equality checked before post-push22-test replay. Paged membership P1 replay and owner-preserving rollback pass.
- PR readback confirms draft=true and base=codex/project-access-preparation. Required CI is not configured for that dependent base; final local full check is passed. Do not describe missing required-check status as a passing required CI.
- Dropdown capacity thread resolved after actual1500-result proof. Archive P2 remains open under current explicit user deferral. Two rollout P1 threads remain open.
- Current raw counts after replies:2 top-level comments,13 review envelopes,6 threads;3 unresolved (2 rolloutP1 plus deferred archiveP2). Raw resolved/outdated surfaces retained.

Additional feedback receipts:
| Exact URL | Priority | Verdict |
| --- | --- | --- |
| https://github.com/udecode/kitcn/pull/452#pullrequestreview-5518528317 | P3 | Empty review envelope created with the recorded thread replies; no separate source request |
| https://github.com/udecode/kitcn/pull/452#pullrequestreview-5518528720 | P3 | Empty review envelope created with the recorded thread replies; no separate source request |
| https://github.com/udecode/kitcn/pull/452#pullrequestreview-5518529263 | P3 | Empty review envelope created with the recorded thread replies; no separate source request |
| https://github.com/udecode/kitcn/pull/452#pullrequestreview-5518529644 | P3 | Empty review envelope created with the recorded thread replies; no separate source request |
| https://github.com/udecode/kitcn/pull/452#discussion_r4271284894 | P1 | Rollout remains open; preparation source exists but real target receipts are absent |
| https://github.com/udecode/kitcn/pull/452#discussion_r4271285206 | P1 | Rollout remains open; preparation source exists but real target receipts are absent |
| https://github.com/udecode/kitcn/pull/452#discussion_r4271285660 | P2 | Explicit current user deferral; archive thread remains open |
| https://github.com/udecode/kitcn/pull/452#discussion_r4271286002 | P2 | Resolved dropdown fanout after post-push1500-result proof |

## Babysit close (2026-11-12)

Preparation #487 merged to `main` on 2026-10-14. The activation delta, from the preparation tip `b555b704` to this PR's head `f8a2d41d`, applies cleanly to `main`. No deployed example backend exists, so the receipt hold has no target to protect, and #452 activates. The two rollout P1 threads close for the same reason. Archive above 10000 access rows stays the deferred P2. Proof: the project access, lifecycle and tag-merge suites pass (22/22), and lint and typecheck pass. Codegen regenerated `procedure-names.gen.ts`.
3 changes: 1 addition & 2 deletions example/convex/functions/_helpers/project_access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ export const listAccessibleProjects = async (
.filter((project): project is ProjectRow => project !== null);

return {
continueCursor: access.continueCursor,
isDone: access.isDone,
...access,
page,
};
};
Expand Down
26 changes: 0 additions & 26 deletions example/convex/functions/_helpers/project_existence.ts

This file was deleted.

24 changes: 12 additions & 12 deletions example/convex/functions/generated/procedure-names.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,18 @@ export const procedureNames = {
{ column: 3, line: 313, name: "plugins/resend:updateManualEmail" },
],
"projects.ts": [
{ column: 3, line: 449, name: "projects:addMember" },
{ column: 3, line: 392, name: "projects:archive" },
{ column: 3, line: 336, name: "projects:create" },
{ column: 3, line: 234, name: "projects:get" },
{ column: 52, line: 660, name: "projects:hasAny" },
{ column: 3, line: 527, name: "projects:leave" },
{ column: 3, line: 39, name: "projects:list" },
{ column: 3, line: 619, name: "projects:listForDropdown" },
{ column: 3, line: 498, name: "projects:removeMember" },
{ column: 3, line: 418, name: "projects:restore" },
{ column: 3, line: 550, name: "projects:transfer" },
{ column: 3, line: 366, name: "projects:update" },
{ column: 3, line: 431, name: "projects:addMember" },
{ column: 3, line: 374, name: "projects:archive" },
{ column: 3, line: 318, name: "projects:create" },
{ column: 3, line: 216, name: "projects:get" },
{ column: 52, line: 605, name: "projects:hasAny" },
{ column: 3, line: 509, name: "projects:leave" },
{ column: 3, line: 41, name: "projects:list" },
{ column: 3, line: 601, name: "projects:listForDropdown" },
{ column: 3, line: 480, name: "projects:removeMember" },
{ column: 3, line: 400, name: "projects:restore" },
{ column: 3, line: 532, name: "projects:transfer" },
{ column: 3, line: 348, name: "projects:update" },
],
"public.ts": [
{ column: 3, line: 7, name: "public:hello" },
Expand Down
Loading
Loading