Skip to content

feat(smartqa): add DLP-1 lease API extensions CHE-4515 [squash] - #270

Merged
congvc-dev merged 2 commits into
mainfrom
agent/x99-codex-sol/che-4515-fd39c3eef170
Nov 10, 2026
Merged

congvc-dev merged 2 commits into
mainfrom
agent/x99-codex-sol/che-4515-fd39c3eef170

Conversation

@congvc-bot-x99

@congvc-bot-x99 congvc-bot-x99 Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Status

Add the DLP-1 lease API contract beside CHE-2099. Existing lease clients keep their request and response shapes.
Candidate: e34ea1ada339fd270f21fb192b21f9dd632f3959.
Base: main, 6f2179fb98f0e0011c615fd45bfd6283579c46fe. PRs #266 and #268 have merged.
Keep this PR draft for independent review through agent_review.

Conditions

SmartQA never allocates in phase 1. No production backend is installed by this change.
The extension returns 503 when the authority connection is absent. It never falls back to the legacy allocator.
Queue scheduling and live-run verification remain broker duties. Queue tests use a fake backend; live integration is NOT-RUN.
Shadow and cutover remain separate slices. G4 approval, G5 restricted-device rules and leader-verified release stay required.

Change

  • Add /api/leases/dlp-1 routes for groups, status, renew, release, ticket, park and claim.
  • Explicitly classify all seven DLP-1 routes as qa_or_service and disable them in preview. Unknown routes still fail closed.
  • Document devices[], per-device endpoints, started_at, idempotency keys, run bindings, offers and recovery states.
  • Derive principal from service authentication. Reject extra input fields and invalid backend timestamps. Hide rival lease handles and endpoints.
sequenceDiagram
    participant C as Service client
    participant A as Existing auth middleware
    participant H as DLP-1 HTTP adapter
    participant B as Approved broker connection
    C->>A: Explicit extension route grant
    A->>H: Verified service identity
    alt Phase 1: connection absent
        H-->>C: 503 dlp1_unavailable
    else Trusted connection installed after approval
        H->>B: Operation, identity and validated arguments
        B-->>H: Group, ticket or refusal
        H-->>C: Filtered API response
    end
Loading

Evidence: original implementation (historical)

Test-first receipt, observed on X99 before implementation:

Parent: dd0c34df5b2ca37e2fa1caf55f10a6429d2372f0
Command: /home/congvc/services/artemis-qa/.venv/bin/python tests/unit/runtime/test_lease_extensions.py -v
Test: ExtensionTests.test_group_is_all_or_none_and_busy_holder_hides_handles
AssertionError: 404 != 201 : {"detail":"Not Found"}
Test: ExtensionTests.test_acquire_and_renew_retries_do_not_extend_twice
AssertionError: 404 != 201 : {"detail":"Not Found"}
Test: ExtensionTests.test_fencing_and_quarantine_remain_unavailable
AssertionError: 404 != 201 : {"detail":"Not Found"}
Test: ExtensionTests.test_queue_offer_park_and_successor_claim_contract
AssertionError: 404 != 409 : {"detail":"Not Found"}
Ran 7 tests in 0.112s
FAILED (failures=6)

The legacy-wire characterization was already green on the parent. It is compatibility evidence, not behavioral red.
The same command on the candidate passes the expanded suite:

Ran 9 tests in 8.271s
OK

An additional test-first error-path check observed 201 != 503 for a backend NaN expiry before the finite-timestamp guard. That check now passes.

Command: /home/congvc/services/artemis-qa/.venv/bin/python -m pytest tests/unit/runtime/test_lease_extensions.py -q --tb=short
9 passed, 8 warnings, 9 subtests passed in 1.48s
Command: /home/congvc/services/artemis-qa/.venv/bin/python -m pytest tests/unit/admin_console/test_device_leases.py tests/unit/admin_console/test_device_leases_api.py tests/unit/admin_console/test_device_leases_service.py tests/unit/runtime/test_device_registry.py tests/unit/runtime/test_device_lease_broker.py -q --tb=short
63 passed, 8 warnings, 45 subtests passed in 46.30s

Ruff formatting/lint, git diff --check, the quality ratchet and the 7-path OpenAPI schema check pass.
Self-review covered scope, test assertions, error paths and secrets. No live device command or Multica call occurs in the tests.
Full CI is not a local result. The environment uses Python 3.13; CI runs Python 3.12.

Impact lookup: graphify affected create_lease --graph /mnt/ssd2/graphify/out/artemis/graphify-out/graph.json.
INDEXED_HEAD: 41374d3d17888f968b4cefa095ac8e36f627e4ec.
Output: No affected nodes found. The index predates the base, so current callers were also searched with rg.
The server includes the existing lease router; only its additive route composition changes.

Evidence: review correction at 60e02ec (historical)

The route inventory failures on fa0415180ca61a23a23b00f5842a2a0f634b41ae were caused by this PR. The correction declares exact method/path entries beside the legacy lease routes.

Observed before the classification fix:

Parent: fa0415180ca61a23a23b00f5842a2a0f634b41ae
Command: /home/congvc/services/artemis-qa/.venv/bin/python -m pytest tests/unit/admin_console/test_route_tiers.py::test_every_registered_route_has_a_declared_tier_and_guard tests/unit/admin_console/test_preview_routes.py::test_every_registered_route_is_classified -q --tb=short
AssertionError: Missing route tier: ['POST'] /api/leases/dlp-1
Left contains 7 more items, first extra item: 'GET /api/leases/dlp-1/tickets/{ticket_id}'
2 failed, 8 warnings in 0.39s
Command: /home/congvc/services/artemis-qa/.venv/bin/python -m pytest tests/unit/admin_console/test_route_tiers.py -k dlp1 -q --tb=short
AssertionError: assert None == 'qa_or_service'
7 failed, 24 deselected, 8 warnings in 0.46s

Observed after the same seven-case regression test and registry fix:

Command: /home/congvc/services/artemis-qa/.venv/bin/python -m pytest tests/unit/admin_console/test_route_tiers.py tests/unit/admin_console/test_preview_routes.py tests/unit/admin_console/test_preview_demo.py tests/unit/admin_console/test_preview_fixtures.py tests/unit/admin_console/test_preview_profile.py -q --tb=short
174 passed, 1 deselected, 8 warnings in 79.25s (0:01:19)

The preview boot failures disappear. The preview dispatch checks cover every disabled route before handlers run.

Command: /home/congvc/services/artemis-qa/.venv/bin/python -m pytest tests/unit/runtime/test_lease_extensions.py tests/unit/admin_console/test_device_leases.py tests/unit/admin_console/test_device_leases_api.py tests/unit/admin_console/test_device_leases_service.py tests/unit/runtime/test_device_registry.py tests/unit/runtime/test_device_lease_broker.py -q --tb=short
72 passed, 8 warnings, 54 subtests passed in 25.57s

The full requested admin-console suite was run before pushing, together with the extension and broker tests:

Command: /home/congvc/services/artemis-qa/.venv/bin/python -m pytest tests/unit/admin_console tests/unit/runtime/test_lease_extensions.py tests/unit/runtime/test_device_registry.py tests/unit/runtime/test_device_lease_broker.py -q --tb=short
FAILED tests/unit/admin_console/test_device_bridge_session.py::test_repeated_unreported_drops_resume_bidirectional_relay[1005]
FAILED tests/unit/admin_console/test_device_bridge_session.py::test_repeated_unreported_drops_resume_bidirectional_relay[1006]
2 failed, 2097 passed, 4 skipped, 1 deselected, 77 warnings, 54 subtests passed in 555.71s (0:09:15)

Both failures are in unchanged bridge reconnection tests. Attribution run on the exact base:

Base: dd0c34df5b2ca37e2fa1caf55f10a6429d2372f0
Command: /home/congvc/services/artemis-qa/.venv/bin/python -m pytest tests/unit/admin_console/test_device_bridge_session.py -k repeated_unreported -q --tb=short
FAILED tests/unit/admin_console/test_device_bridge_session.py::test_repeated_unreported_drops_resume_bidirectional_relay[1005]
1 failed, 1 passed, 78 deselected, 8 warnings in 2.11s

The base reproduction proves the bridge test can fail without the extension or classification fix. The 1006 case passed in the base reproduction. Earlier CHE-2101 history also records this parameterized test as intermittent. The full local suite is not claimed green.

Historical frontend attribution at 60e02ec43237b062b3450d34bd14400bc6d6608a: node --test scripts/bridge-recovery.test.mjs fails on both this candidate and the exact base dd0c34df5b2ca37e2fa1caf55f10a6429d2372f0:

not ok 1 - a recovered 1005/1006 relay survives the previous attachment timeout
error: 'this.document.addEventListener is not a function'
# pass 0
# fail 1

Both runs use Node v22.23.1 and dependencies from the same lockfile SHA256 2e4aebe81458df7615678be7353b625bfffb96a0876f11c4db16f03164569874. CI uses Node v22.22.3. That head had no frontend delta. Existing fix: CHE-3577, #262, still open at attribution time. No second fix PR was created.

The review correction passes Ruff lint and format checks, git diff --check and the quality ratchet. Self-review covered exact-path scope, guard alignment, preview rejection, tests, error paths and secrets.

Impact lookup: graphify affected route_tier --graph /mnt/ssd2/graphify/out/artemis/graphify-out/graph.json, indexed at 41374d3d17888f968b4cefa095ac8e36f627e4ec, reports callers in route-tier, run-discovery, run-annotation, ownership, version and spaces tests. Those current callers were inspected. graphify affected DISABLED returns No affected nodes found; current constant uses were checked with rg in preview inventory and dispatch tests.

Evidence: baseline refresh at 38fa0b9 (historical)

Merge commit 38fa0b9990e6caad270516b3cd00706917c267e0 combines the reviewed 60e02ec43237b062b3450d34bd14400bc6d6608a with main fa7b4ad3fab5a5a13fa7c440a79530b9295d4098. The merge used Git's automatic ort result with no conflict resolution. The base branch remains agent/x99-codex-sol/che-4508-badca51e944d.

PR #262 merged as 7769d5ce89902cef4298578ec28c8739c76c2cda. The merge imports its bridge test listener stubs, the equivalent follow-up #280, and existing main CI updates #250/#255. No lease implementation changed. Neighboring layers have their own active recovery runs; this run changes only #270.

Observed on X99, 8 Nov 2026 ICT:

Before refresh, head 60e02ec43237b062b3450d34bd14400bc6d6608a:
node --test scripts/bridge-recovery.test.mjs
not ok 1 - a recovered 1005/1006 relay survives the previous attachment timeout
error: 'this.document.addEventListener is not a function'
# pass 0
# fail 1

After refresh, head 38fa0b9990e6caad270516b3cd00706917c267e0:
node --test scripts/bridge-recovery.test.mjs
ok 1 - a recovered 1005/1006 relay survives the previous attachment timeout
# pass 1
# fail 0

/home/congvc/services/artemis-qa/.venv/bin/python -m pytest tests/unit/runtime/test_lease_extensions.py tests/unit/admin_console/test_device_leases_api.py tests/unit/admin_console/test_device_leases_service.py tests/unit/admin_console/test_route_tiers.py tests/unit/admin_console/test_preview_routes.py -q
100 passed, 8 warnings, 9 subtests passed in 108.93s (0:01:48)

python3 .github/tests/test_runner_routing.py
Ran 6 tests
OK

Scoped Ruff and git diff --check pass. Self-check covered the imported five-file delta, scope, error paths and secrets. This refresh imports an existing repair; it adds no new authored implementation or test. Original test-first evidence remains above.

CI on the new head is queued: https://github.com/cheese-work/artemis/actions/runs/42442668654. Full CI success and fresh independent review are pending; earlier-head verdicts are historical. The PR stays draft. Multica refused this run's in_progress transition with its concurrent-state guard and explicitly prohibited another status write in this run. Check-result wakeup 01a1b930-bc0a-7951-b495-43c06d16e230 requests the workflow review on the current exact head after state reconciliation.

Evidence: stack refresh at b15d3e8 (historical)

Current head b15d3e8e206b3a0e16f3f8907b5762f2c4dbc112 merges first parent 38fa0b9990e6caad270516b3cd00706917c267e0 with refreshed predecessor fb0b60c255bd1e67a1c9f888a8efa469ce3096f9. The base branch is unchanged.

Both heads have tree 68272b9f04c92b0fe9b767d548f246651a96749b; git diff 38fa0b9990e6caad270516b3cd00706917c267e0 b15d3e8e206b3a0e16f3f8907b5762f2c4dbc112 is empty. The local results recorded above remain evidence for the identical files at the prior head. No additional local test run or independent PASS is claimed on the current SHA.

CI on this exact head is pending: https://github.com/cheese-work/artemis/actions/runs/42442939508. What's New is queued. Earlier-head CI or review verdicts do not establish success on this head. Enabled check-result wakeup 01a1b930-bc0a-7951-b495-43c06d16e230 handles current-head checks and the next workflow review. The PR stays draft. Workflow status remains with its current owner.

Evidence: current candidate after predecessor landing

GitHub rebased PR #270 onto main after PRs #266 and #268 merged.
Current head: e34ea1ada339fd270f21fb192b21f9dd632f3959.
Current base: 6f2179fb98f0e0011c615fd45bfd6283579c46fe.
The current tree is e43c1855a691c53e6dd35d493bce233413073f84, identical to prior head 2c6d896caa69c92bbf6794b54cc717e5cdba85cc.
The current PR diff has 8 files, 769 additions and 0 deletions. No code changed in this reconciliation run.
Historical red/green receipts remain above; no new behavioral red or local test result is claimed.

Current-head CI: https://github.com/cheese-work/artemis/actions/runs/42568626760.
At 9 Nov 2026 12:50 ICT, frontend, package smoke tests and What's New pass. Python deterministic is running; Python reverse is queued.
Full CI success is pending. Prior-head green checks and functional/security PASS do not establish success on this head.
The PR stays draft for a fresh workflow agent_review on this exact head/base pair. No merge is authorized.

Cost delta

C1: no production cost or dependency change. One existing PR CI cycle runs on self-hosted X99. No additional model API spend was initiated.
C2: reuse the merged repair and existing PR; no separate repair implementation or second PR.
C3: watch exact-head CI via the recorded wakeup. On failure, fix this PR or record the concrete blocker. The refresh is a merge commit; no production deployment or merge is authorized.

Part of CHE-4285
The parent retains the remaining queue, recovery, remote-access, shadow and cutover work. CHE-4285 owns final protocol acceptance.

Closes CHE-4515

@congvc-bot-x99

congvc-bot-x99 Bot commented Nov 7, 2026

Copy link
Copy Markdown
Author

Security-Gate-Verdict: PASS
Reviewer: x99-claude-sonnet-200k (claude-sonnet-5-5)
Signed: x99-claude-sonnet-200k, 08 Nov 2026 06:51 ICT
Repo: cheese-work/artemis
PR: 270
Base: agent/x99-codex-sol/che-4508-badca51e944d
SHA: 60e02ec
Findings: none

@congvc-bot-x99

congvc-bot-x99 Bot commented Nov 8, 2026

Copy link
Copy Markdown
Author

Security-Gate-Verdict: PASS
Reviewer: x99-claude-sonnet-200k (claude-sonnet-5-5)
Signed: x99-claude-sonnet-200k, 08 Nov 2026 15:40 ICT
Repo: cheese-work/artemis
PR: 270
Base: agent/x99-codex-sol/che-4508-badca51e944d
SHA: b15d3e8
Findings: none

@congvc-bot-x99
congvc-bot-x99 Bot marked this pull request as ready for review November 8, 2026 08:41
@congvc-dev
congvc-dev force-pushed the agent/x99-codex-sol/che-4515-fd39c3eef170 branch from b15d3e8 to 2c6d896 Compare November 9, 2026 01:56
@congvc-bot-x99
congvc-bot-x99 Bot marked this pull request as draft November 9, 2026 02:49
Base automatically changed from agent/x99-codex-sol/che-4508-badca51e944d to main November 9, 2026 05:40
@congvc-dev
congvc-dev force-pushed the agent/x99-codex-sol/che-4515-fd39c3eef170 branch from 2c6d896 to e34ea1a Compare November 9, 2026 05:40
@congvc-bot-x99

congvc-bot-x99 Bot commented Nov 9, 2026

Copy link
Copy Markdown
Author

Security-Gate-Verdict: PASS
Reviewer: x99-claude-sonnet-200k (claude-sonnet-5-5)
Signed: x99-claude-sonnet-200k, 09 Nov 2026 12:54 ICT
Repo: cheese-work/artemis
PR: 270
Base: main
SHA: e34ea1a
Findings: none

@congvc-bot-x99
congvc-bot-x99 Bot marked this pull request as ready for review November 9, 2026 06:55
@congvc-dev
congvc-dev merged commit 8cb56b0 into main Nov 10, 2026
6 checks passed
@congvc-dev
congvc-dev deleted the agent/x99-codex-sol/che-4515-fd39c3eef170 branch November 10, 2026 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant