fix(dashboard-testing): preserve PostgreSQL identity representation
This commit is contained in:
@@ -155,6 +155,32 @@ def test_database_identity_has_independent_literal_encoding():
|
||||
# #endregion Test.LabReset.Contract.DbIdentity
|
||||
|
||||
|
||||
# #region Test.LabReset.Contract.DbIdentityCarrier [C:2] [TYPE Function]
|
||||
# @TEST_INVARIANT Native producer identity passes; changed address/database refuses without normalization or another query.
|
||||
@pytest.mark.parametrize("changed", [None, {"address": "192.0.2.7/32"}, {"database": "foreign_fixture"}])
|
||||
def test_database_identity_preserves_native_producer_carrier(changed):
|
||||
body = {"database": "owned_fixture", "address": "192.0.2.7", "port": 5432, "oid": 17}
|
||||
literal = b'{"address":"192.0.2.7","database":"owned_fixture","oid":17,"port":5432}'
|
||||
expected = sha256(literal).hexdigest()
|
||||
observed = {**body, **(changed or {})}
|
||||
statements = []
|
||||
|
||||
class Connection:
|
||||
def execute(self, statement):
|
||||
statements.append(str(statement))
|
||||
return SimpleNamespace(mappings=lambda: SimpleNamespace(one=lambda: observed))
|
||||
|
||||
if changed is None:
|
||||
database.identity(Connection(), expected)
|
||||
else:
|
||||
with pytest.raises(archive.Stop, match="^LAB_RESET_DATABASE_IDENTITY_CONFLICT$"):
|
||||
database.identity(Connection(), expected)
|
||||
assert statements == ["SELECT current_database() AS database, inet_server_addr() AS address, "
|
||||
"inet_server_port() AS port, (SELECT oid FROM pg_database WHERE datname=current_database()) AS oid"]
|
||||
assert body == {"database": "owned_fixture", "address": "192.0.2.7", "port": 5432, "oid": 17}
|
||||
# #endregion Test.LabReset.Contract.DbIdentityCarrier
|
||||
|
||||
|
||||
# #region Test.LabReset.Contract.DbSessionRefusal [C:2] [TYPE Function]
|
||||
def test_foreign_session_refuses_without_termination():
|
||||
statements = []
|
||||
|
||||
@@ -84,9 +84,10 @@ def no_foreign_sessions(connection):
|
||||
|
||||
|
||||
# #region Tooling.LabReset.Database.Identity [C:2] [TYPE Function]
|
||||
# @INVARIANT Use the producer's native inet address carrier; text casts change the reviewed digest representation.
|
||||
def identity(connection, expected):
|
||||
row = connection.execute(text("SELECT current_database() AS database, "
|
||||
"inet_server_addr()::text AS address, inet_server_port() AS port, "
|
||||
"inet_server_addr() AS address, inet_server_port() AS port, "
|
||||
"(SELECT oid FROM pg_database WHERE datname=current_database()) AS oid")).mappings().one()
|
||||
require(digest(dict(row)) == expected, "LAB_RESET_DATABASE_IDENTITY_CONFLICT")
|
||||
# #endregion Tooling.LabReset.Database.Identity
|
||||
|
||||
@@ -810,4 +810,12 @@ The first four-script/two-test release passed63 offline checks but was held befo
|
||||
|
||||
Curator's revised frozen release passed79 offline guards: the historical63 plus16 hardcoded owner/intent/standalone-verification, duplicate-PK, SSOT-path and journal-failure checks. Default Ruff/C901, AST compilation and balanced anchors passed. Main verified its six exact released hashes before restaging. Independent review packet `artifacts/stage0/reseed-20261010/independent-reset-review.jsonl` SHA256 `15727d3e98df2e19b47c966bb52e57c7ea38d2756a2d3ffc7ca7ce53b9384eac` records the corrected offline owner/path/failure and single-commit transaction checks; root approved the bounded commit. Those checks do not execute operational Docker/DB phases or establish stopped-container quiescence. The tool commit and subsequent clean-source manifest binding remain preparation, with runtime authorization separate. N120/ONE354 and USER approval NONE are unchanged.
|
||||
|
||||
### 2026-10-11 — Actual phase0 stopped; native PostgreSQL identity carrier restored
|
||||
|
||||
Root authorized one exact phase0 driver attempt on clean `b555a15b7ec6264643c4f80cfe950d782b83838b`. Both reviewed backend IDs stopped gracefully with no forced kill/retry and remained preserved, exited/running=False/pid=0. Fresh host receipt SHA256 `d93e2334a3a76d5f87a6d031941aa38394ab422f5e663c42e523996996930eb1` was transported byte-for-byte to both inventory paths as exclusive0600 host-UID1000 inputs. First stage1 inventory worker returned LAB_RESET_DATABASE_IDENTITY_CONFLICT at identity before foreign-session checks, table locks or snapshot; own inventory was not created/run. Driver stopped with PHASE0_COMMAND_FAILED. Root-owned worker original cause was read back privately, SHA256 `d4289e38815620e5f781144fd46ad4a31cc1d60bbf798b074e10c6995b1402c0`, correlated worker trace `2da0d882f27642de9cd197590459884b` and driver trace `a229748f2b4d459a86f0e14d1c24ac49`. No inventory completion, archive, reset, upgrade, restart, login or capture is claimed.
|
||||
|
||||
The separately authorized single READ ONLY diagnostic used the same reviewed stage1 resource/config bindings and selected database/address/port/OID only, with five-second statement limit and rollback. Actual native address tuple matched all four previously reviewed identity fields and digest `b75febb2c7d3c2645d82a6ae03d9362a129e8b8cee1477340a42984c45961700`; the text cast changed only address representation by adding `/32`. Thus this observed refusal was a carrier mismatch, not evidence of a different database. Both tuples remain private0600; safe summary `artifacts/stage0/reseed-20261010/identity-carrier-20261011T010824Z/summary.json` SHA256 `0b6f858b2ae06f2aa408de66a9c648ad91936e6166d5fcfed49ef4c54f07dcd6`, actual trace `39624ec6aa93450ab41bc8eac547e771`. Independent Verify confirmed the retained comparison. Expected identities were not replaced or normalized and inventory was not retried.
|
||||
|
||||
The bounded correction removes only `::text` from the identity SQL, restoring the producer's `inet_server_addr()` carrier. Three independent literal component cases require native identity acceptance, typed refusal of masked-address or different-database identity, and the closed SQL carrier contract with one query. The complete two-file offline tool guards passed82; targeted Ruff/compile/diff checks passed. First harness invocation lacked backend PYTHONPATH and had six import failures; the corrected import-only invocation passed, without DB/Docker/test-suite execution. This fixes tooling representation only; new clean-source manifests and fresh hostcheck/inventory-only dispatch still require root review. Do not rerun the stop driver: both application containers are already stopped. N120/ONE354 and USER approval NONE remain unchanged.
|
||||
|
||||
## @} Stage2.ChartTypeStabilizationJournal20261010
|
||||
|
||||
@@ -35,7 +35,7 @@ Original275: а=0, б=120, source-restored=155. [Сверка803](2026-10-10-del
|
||||
- Official filter_state observer установил: Clear без Apply сохраняет committed context, Apply меняет его. Chart8 closed context/4×2 и source hashes измерялись; Force refresh прошёл через четыре native owners. Новая политика должна наблюдаться из actual page URL key и official state: иной opaque key допустим при том же effective context. Будущая capture независимо проверяет actual request SHA/context. Standalone DATE normalizer сохраняет авторские endpoints/inclusive; D11 native `[from,to)` discoveryFalse/typedTrue refusal реализован компонентами:180 SQL-free guards PASS/connect0, DATE column и TIME global разделены; browser/custom DATE plugin ещё не измерены, финансовые SELECT dates неизменны.
|
||||
- Последний полный suite24f53f97 завершился exit1:4211collected,3907callPASS,199callFAIL,103setupFAIL,2skipped; все4211teardowns PASS, collection/internal errors отсутствуют.302 private causes сохранены. Их нельзя объявлять целиком прежними или fixture-only. Проверенные bounded восстановления storage/DTO/import/quota/approval/recipe/DATE/logging достигают конкретных assertions; они не заменяют новый полный suite. Подробные результаты и безопасные causal traces находятся в журнале.
|
||||
- Текущие live gaps вне исторической source803 области: зарегистрированные superset_api/sql_evidence приходят в всегда отказывающий QueryExecutor; receipt open/finalize fail-open и repr logs открыты. bounded_transform безусловно unsupported. Publish gate после exact selector требует actual evidence, deployment caller не передаёт selector, scheduled verifier visibly unavailable.037FR012/017 и044FR014 активны; эти свойства не retired wholesale, их source/runtime причины требуют реализации и проверки.
|
||||
- D17 P0: stable scope, actor, durable review projection и независимый completed actual locator реализованы и проверены компонентами. Fixture PNG и synthetic DB publication receipts не доказывают browser capture, genuine Git publication или human review. D17 P0 следует после committed native/log cuts, до unrelated SDK/transform/gate repairs. Phase1 private config/manifests и READ ONLY startup preflight готовы; runtime maintenance ещё не разрешён. После root-review точных resources/manifest и явного разрешения maintenance: allowlisted module archive/reset→current stand restart/0039→fresh chart8 expected capture/PNG. Старое self-authored ожидание green suite до любой stand action superseded; новый полный green suite остаётся обязательным MERGE gate. Перед visual-review/confirm пользователь должен увидеть именно этот PNG; общее разрешение продолжать не заменяет human disposition. Пока review pending, genuine numeric chart8 chain может идти независимо: PASS→разрешённая +1→named-cell FAIL→finally restore→PASS с тем же pin, затем API multi-metric/query/series/pivot/raw acceptance. Superset/finance metadata и чужое состояние защищены.
|
||||
- D17 P0: stable scope, actor, durable review projection и независимый completed actual locator реализованы и проверены компонентами. Fixture PNG и synthetic DB publication receipts не доказывают browser capture, genuine Git publication или human review. D17 P0 следует после committed native/log cuts, до unrelated SDK/transform/gate repairs. Phase0 остановил оба owned backend; первый inventory отказал до locks/snapshot из-за address carrier. READ ONLY diagnostic подтвердил исходную DB identity; исправлен SQL carrier, повтор inventory ждёт root-review. После root-review точных resources/manifest и явного разрешения maintenance: allowlisted module archive/reset→current stand restart/0039→fresh chart8 expected capture/PNG. Старое self-authored ожидание green suite до любой stand action superseded; новый полный green suite остаётся обязательным MERGE gate. Перед visual-review/confirm пользователь должен увидеть именно этот PNG; общее разрешение продолжать не заменяет human disposition. Пока review pending, genuine numeric chart8 chain может идти независимо: PASS→разрешённая +1→named-cell FAIL→finally restore→PASS с тем же pin, затем API multi-metric/query/series/pivot/raw acceptance. Superset/finance metadata и чужое состояние защищены.
|
||||
|
||||
Подробная прежняя хроника — [журнал](2026-10-10-chart-type-stabilization-journal.md).
|
||||
Измерения native controls/силы cache refresh — `artifacts/stage0/reseed-20261010/`; промежуточная
|
||||
|
||||
Reference in New Issue
Block a user