628b5f2 accepted a cursor only if re-encoding the parsed key gave the
same string. That closed the format both ways: any encoding change, even
a compatible one (an optional field, key order, to_rfc3339 shared with
API responses), would turn cursors issued by a replica of the other
version into 400 during make rolling_update, which the tests cannot see.
decode_cursor now checks the fields one by one: v must be exactly the
integer 1, t and i must be strings, i must be in the server's notation
(lowercase 8-4-4-4-12). Unknown fields are ignored, so a tampered cursor
is still a 400 while the format stays open for compatible changes. The
rule records how to change the format: a new CURSOR_VERSION, with both
versions accepted while replicas are replaced.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add black-box tests for the strict-id-validation change: a server-issued
cursor with one field changed (non-string or non-canonical item id,
v=true, extra field) on both lists, member_ids with values of other JSON
types, a non-array member_ids and other UUID notations, and chat_id in
the path of the three chat endpoints. Sync the change's delta specs into
api-conventions, chats and pagination so the coverage check knows the
new scenarios.
The cursor and UUID-notation tests fail on the current code by design;
the fix follows in the next commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The change moves to openspec/changes/archive/2026-10-13-fix-known-issues.
Its delta requirements join the main specs: graceful-shutdown "Остановка
во время старта", load-benchmark "События Docker профилей отказа и
замены", student-tests "Доказательства исключений сверки в репозитории"
and "PostgreSQL стенда отказов без аварийных перезапусков". AGENTS and
REPORT now say all eight lab 3 changes are archived and none is active.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sync load-benchmark (series comparison table, track 1 before/after
rules, db4 series) and service-configuration (default pool 10 + 0)
into the main specs, move the change to the archive and drop it from
the transitional state in AGENTS.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SQLSTATE 53300 (too_many_connections) joins UNAVAILABLE_SQLSTATES, so a
refused pool connection gives 503 unavailable instead of 500. New fault
check fills max_connections through the failure stand hook and expects
503 in the contract format.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sync the rolling-update delta specs into db-migrations,
graceful-shutdown, load-balancing and load-benchmark, move the change to
the archive, mark it in PLAN.md and update the transitional state and
code map in AGENTS.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Delta specs synced into graceful-shutdown, load-balancing, load-benchmark
and service-configuration; the change moves to
openspec/changes/archive/2026-10-11-graceful-failover/. PLAN.md marks the
change archived and AGENTS.md notes what was handed to rolling-update.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- stop-one.sh: an empty TARGET_INSTANCE_ID now exits 2 in any shell,
as the design states (${VAR:?} gave 1 under bash).
- driver.py kill-inflight: reproducible "aborted response is not
retried" scenario (logins in flight, replica killed via stop-one.sh).
- Detection time of a hung replica is fall x (inter + timeout check) =
8 s, not inter x fall + timeout check = 5 s (docker pause: 7.3 s);
fixed in haproxy.cfg, balancer.md and the design.
- The 1 CPU replica limit is kept on purpose; the compose comment and
the design now say that Argon2id uses more and logins are slower.
- load-balancing spec: API_REPLICAS is read by compose and Makefile.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HAProxy 3.4 is the only published entry point; api runs as
API_REPLICAS replicas without ports, found through Docker DNS and
checked on /health/ready. Retries only on connection failure, LB errors
in the contract error format, resource limits and per-service secrets.
Adds scripts/stop-one.sh, LB-aware restart.sh, make replicas /
instances / lb_stats and replica tests driven by EXPECT_REPLICAS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- carry the lab 2 solution over and plan lab 3 (PLAN.md, OpenSpec
change instance-id-idempotency)
- rename the compose project to mtusi-lab3 and the image to :lab3
- add X-Instance-Id to every response and instance_id to every log
record ([app] instance_id, hostname by default)
- require Idempotency-Key on POST messages: keys table in Postgres,
key and message in one transaction, replay returns the same 201,
another body gets 409, TTL from [idempotency] ttl_seconds
- send the key from student-tests, k6 scenarios and the skill driver;
add idempotency, X-Instance-Id, key race and fault tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>