test: stop requiring retired archive entrypoints in Python contracts
Flip archive tokens to must-not-appear on the session row and session hook only. Keep writeChatSession POST/PATCH and assert delete still uses DELETE. Grep tests/ before deleting frontend symbols.
This commit is contained in:
@@ -3,3 +3,14 @@
|
||||
|
||||
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices.
|
||||
<!-- END:nextjs-agent-rules -->
|
||||
|
||||
# Frontend change radius
|
||||
|
||||
Before deleting or renaming a frontend symbol, class name, or visible copy, run
|
||||
`git grep -n "<symbol>" -- tests/ frontend/` — not `frontend/` alone.
|
||||
|
||||
`tests/` holds Python source-contract tests that assert on frontend text
|
||||
(`test_session_management_entrypoints.py`,
|
||||
`test_daily_and_rectification_entrypoints.py`,
|
||||
`test_birth_time_journey_contract.py`). Grepping only `frontend/` missed them
|
||||
four times (BUG-933, BUG-934, BUG-939, BUG-992).
|
||||
|
||||
@@ -115,17 +115,15 @@ test("retire archive migration clears archived_at without bumping updated_at", {
|
||||
);
|
||||
assert.match(retireSql, /set archived_at = null/);
|
||||
assert.doesNotMatch(retireSql, /updated_at\s*=/);
|
||||
fixture.psqlAs("schema_owner", "schema-owner-test-password", `
|
||||
update public.chat_sessions set archived_at = null where archived_at is not null;
|
||||
`);
|
||||
const apply = retireSql.match(/update public\.chat_sessions\s+set archived_at = null\s+where archived_at is not null;/);
|
||||
assert.ok(apply?.[0], "retire migration must contain the unarchive update");
|
||||
fixture.psqlAs("schema_owner", "schema-owner-test-password", apply[0]);
|
||||
assert.equal(fixture.psql("select count(*) from public.chat_sessions where archived_at is not null"), "0");
|
||||
const after = fixture.psql(
|
||||
`select pinned::text || '|' || jsonb_array_length(messages)::text || '|' || updated_at::text from public.chat_sessions where id = '${archivedRectification}'`,
|
||||
);
|
||||
assert.equal(after, before);
|
||||
fixture.psqlAs("schema_owner", "schema-owner-test-password", `
|
||||
update public.chat_sessions set archived_at = null where archived_at is not null;
|
||||
`);
|
||||
fixture.psqlAs("schema_owner", "schema-owner-test-password", apply[0]);
|
||||
assert.equal(fixture.psql("select count(*) from public.chat_sessions where archived_at is not null"), "0");
|
||||
} finally {
|
||||
fixture.stop();
|
||||
|
||||
Reference in New Issue
Block a user