Skip to content

feat(access): complete visitor lifecycle and unify blueprint status - #196

Merged
JnyRoad merged 9 commits into
mainfrom
feat/visitor-access-lifecycle
Sep 9, 2026
Merged

feat(access): complete visitor lifecycle and unify blueprint status#196
JnyRoad merged 9 commits into
mainfrom
feat/visitor-access-lifecycle

Conversation

@JnyRoad

@JnyRoad JnyRoad commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Changes

Admission revocation and deletion entrypoints could remove local authorization relationships before devices confirmed revocation, while visitor checks and manual authorization did not consistently cover current eligibility and direct-connected devices. This change completes the requested lifecycle scope and preserves unresolved device outcomes for follow-up.

  • Make admission revocation and reliable operation acceptance transactional; fence older ADD work, compensate late success, and prevent stale events from restoring terminal applications.
  • Harden supplier soft deletion, certificate matching and concurrent eligibility checks. Visitor verification and entry/exit registration use real fellow/application identity and recheck validity at registration.
  • Support public-person manual authorization across ISC, DIRECT and mixed targets, with frozen credentials, validity windows, route locking and operation-key progress.
  • Persist ISC events before acknowledgment; add idempotent platform receipts, independent retries, instance-scoped reconciliation cursors and consecutive-page backfill.
  • Retain employee, departure-card and supported vehicle relationships until trusted receipts permit precise cleanup; track reliable operations in automatic-deletion reports.
  • Add incremental schema scripts and configuration examples. Normalize all 47 blueprint entries around one status ledger, collapsible historical plans and 16 deployment upgrade groups.

Validation

Previously executed against this implementation: 664 selected backend tests (zero failures/errors/skips), plus 4 actual SQLite 3.25.2 tests, 47 Web tests and 14 App tests. Evidence and suite details are in specs/012-reliable-auth-batch/continuation-validation.md and continuation-test-results.json.

The final documentation update passed unique-ID/link checks, 47-entry status/history consistency, inline JavaScript syntax, deterministic generation and git diff --check. Business tests were not rerun for the documentation-only follow-up.

Deployment prerequisites and remaining scope

  • Do not enable by upgrading Java alone: the full production AUTH engine schema must first be prepared and validated against the target Oracle metadata. Test-resource schemas are not approved production migrations. Apply the relevant incremental scripts and validate park/instance/device routes before enabling feature and scheduler switches.
  • Historical ISC reconciliation remains disabled by default. Real Oracle migration, ISC protocol/device receipts, PDA/NFC hardware, load and production deployment are not verified by this PR.
  • Secret-exam integration, vehicle manual authorization and the complete 5.8 reconciliation/capacity scope remain incomplete. Unsupported ISC vehicle outcomes retain evidence and relationships. Empty ISC download details remain VERIFYING; central authorization listings are not proof of device-side absence.
  • Application rollback must preserve operations, inbox events, receipts and audit records. See the blueprint upgrade index and continuation report for per-feature configuration and migration ordering.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 9a7a5497-73d0-4c6c-9421-4a985d0e1088


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JnyRoad

JnyRoad commented Sep 8, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review skipped: 259 files exceed the limit of 100.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

JnyRoad and others added 8 commits September 8, 2026 06:14
- ISC late-ADD revoke compensation validated against DOING callback state,
  aligned with the DIRECT path; add real-wiring ordering test
- Admittance delTask routes only whitelisted parks to the reliable engine and
  keeps the legacy device-delete path for other parks so overtime/arrival
  scheduled jobs no longer fail park-wide
- bridge-isc: disable Kafka auto-commit, ack per record only on success with
  SeekToCurrentErrorHandler; SQLite busy_timeout/WAL; warn on exhausted retries
- Supplier row locks use FOR UPDATE WAIT 10 on Oracle; reject duplicate idCard
  on supplier person update
- Manual SQL: WHENEVER SQLERROR headers, batched VERSION backfill, README index
- Restore PENDING state in two existing AuthSelection tests broken by the new
  stageNext guard; confirm dialog before trusted-query retry in smart-ui

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
SmtSecurityAuthDeleteServiceImpl previously hard-failed with
RELIABLE_DELETE_UNAVAILABLE whenever a park was not in the reliable
engine's enabled-parks whitelist. Restore the pre-PR behavior for those
parks: delete the local relation first, then create the legacy device
delete task, matching origin/main and PR #192's split. Enabled parks
keep routing through the reliable engine unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Product decision: local permission-group / device-auth rows must not be
deleted before the device-side revocation actually confirms success.
Extend the CR-C9-001 fix (admittance/staff/leave-handover/security-zone)
to the vehicle revocation entry points as well.

- EmployeeVehicleRevocationService.deleteVehicle/removeApplications/
  revokeAuthority now return a tri-state: null when none of the vehicle's
  parks are enabled (caller falls back to legacy), unchanged reliable path
  when fully enabled, explicit rejection when parks are mixed (can't split
  one vehicle's revocation protocol)
- SmtVehicleServiceImpl.deleteVehicle/Logout, SmtVehicleApplyServiceImpl's
  removeById/removeByIds/removeAuthToDevice/removeByAuthId and the
  reject-application path fall back to the pre-PR196 legacy device-task +
  physical-delete flow when not applicable
- EmployeeAuthOperationAdapter.guardLegacyDeletion restored to only block
  subjects with a genuine in-flight reliable selection (matches origin/main),
  instead of unconditionally rejecting any legacy physical delete
- Updated/added tests for the new legacy-fallback paths (staff device auth,
  leave handover, vehicle service/apply, adapter orphan-row guard)

Full regression: platform-core 553, platform-biz 995 (1 unrelated failure:
ModiftyDormitorData, a pre-existing empty test class), bridge-isc-biz 35.
smart-schedule's AuthOperationPersonOwnerTest fails identically on
unmodified PR #196 head (a5 pre-existing defect, out of scope, not fixed).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
PR #196's AuthOperationTransportFacade.executePending added an ISC-only
gate that blocks any phase whose resourceType is not exactly "PERSON"
(commit 65263bc, "resourceType 是冻结来源的协议边界"). The sibling
AuthOperationTransportFacadeTest was updated for this, but
AuthOperationPersonOwnerTest's own `config()` fixture never set
resourceType, so every phase it builds got silently blocked and dropped
before dispatch, producing zero HTTP calls in 5 of its 12 tests and an
empty owners map (NoSuchElementException) in a 6th.

Set resourceType("PERSON") in the shared fixture, matching how every
other ISC-person test in the codebase represents a staff card resource.
All 12 tests pass; full platform-core/platform-biz/smart-schedule
regression is now green (553/994/468, 0 failures/errors).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ModiftyDormitorData was a one-off dormitory-history data-migration and
photo-backfill script from 2020, never a real automated test: all three
methods have their @test annotation commented out, and its class name
("ModiftyDormitorData") doesn't match Surefire's default include
patterns (*Test.java etc.), so plain `mvn test` never runs it.

It only ever surfaces as "No runnable methods" when Surefire is invoked
with an exclusion-only -Dtest filter (e.g. `-Dtest='!SomeOtherTest'`),
which makes Surefire fall back to including every compiled test class
regardless of naming, bypassing the default pattern. That's how it
showed up during this session's ad hoc regression runs; it was not
actually breaking the project's normal build.

Removed as inert dead code (no @test methods run, unreferenced
elsewhere, depends on the removed-in-modern-JDKs sun.misc.BASE64Encoder,
hardcodes internal employee badge numbers). platform-biz: 994 tests,
0 failures, both under plain `mvn test` and the exclusion-filter form.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@JnyRoad
JnyRoad merged commit 06cd8a4 into main Sep 9, 2026
2 checks passed
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