Data Model: setup-plan local outcome and hosted-delivery evidence

All values are invocation-scoped and immutable after construction. No new persistent schema is introduced.

SessionAssessment

FieldTypeRules
completedbooleanTrue only when canonical local session evaluation completed.
usable_sessionboolean or nullBoolean when completed; null when assessment failed.
reasonstable local reason codeContains no credential material.

Invariant rules:

usable or not known expired.

session exists; this is conclusively logged out.

materialization, or evaluation failed.

  • completed=true, usable_session=true: session is readable and its refresh token is
  • completed=true, usable_session=false: storage evaluation succeeded but no usable
  • completed=false, usable_session=null: initialization, storage, decryption, parsing,

Assessment failure and logged out both refuse hosted effects but produce different diagnostics. Failure is not an authentication state.

BoundaryEvaluation

FieldTypeRules
state`safe \unsafe \
reasonstable reason codeRequired when not safe.
evidencesanitized mapping or nullDerived from preflight result; no raw exception/credential data.

Known structural mismatches are unsafe. Failure to evaluate is unknown. Both are insufficient permission for hosted effects.

HostedSyncDiagnostic

FieldTypeRules
codestable stringAuth, boundary, and route codes remain distinct.
severitywarningNonfatal to the local command.
hosted_dispositionrefusedThe affected hosted effect does not run.
messagestringHuman-readable and free of secrets.
detailsmapping or nullSanitized structured evidence.
remediationlist of stringsAdvice only; no automatic login or repair.

Diagnostics are deduplicated by code and ordered authentication → structural → route. Route refusal uses SAAS_SYNC_ROUTE_UNAVAILABLE and is derived only from the canonical read-only routing resolver.

HostedSyncDecision

FieldTypeRules
requestedbooleanFalse when SaaS is disabled.
allow_effectsbooleanTrue only when all required evidence is affirmatively safe.
diagnosticstuple of diagnosticsEmpty on disabled or fully allowed paths.

Truth table:

RequestedAuthBoundaryRouteAllow
nonot evaluatednot evaluatednot evaluatedno effects attempted
yescompleted + usablesafeavailableyes
yescompleted + no usable sessionanyanyno
yesassessment failedanyanyno
yescompleted + usableunsafe/unknownanyno
yescompleted + usablesafeunavailable/unknownno

Route is available only when resolve_checkout_sync_routing_readonly() returns a value with non-empty project_uuid and effective_sync_enabled=true. Null, resolver failure, missing identity, unreadable policy, or denied consent is unavailable.

LifecycleEventIntent

FieldTypeRules
envelopeexisting event envelopePersisted locally before hosted fan-out.
log_pathlocal path/contextUsed for compatible adapter fan-out only.

Transition:

built → persisted_locally → offered_to_executor
                              ├─ allowed → hosted_fanout_attempted
                              └─ refused → terminal_local_only

No refused intent reaches a hosted adapter.

SetupPlanLocalOutcome

FieldTypeRules
payloadmappingExisting primary JSON fields for the local path.
exit_codeintegerExisting local exit; never derived from hosted diagnostics.
render_kindsuccess/scaffold/blocked/errorMirrors existing local classification.

The reporter produces one output document from SetupPlanLocalOutcome plus optional diagnostics. It never mutates primary result fields.

Relationships

classDiagram
    SessionAssessment --> HostedSyncDecision
    BoundaryEvaluation --> HostedSyncDecision
    HostedSyncDecision o-- HostedSyncDiagnostic
    HostedSyncDecision --> LifecycleEventIntent : permits or refuses fan-out
    SetupPlanLocalOutcome --> ResultEnvelope
    HostedSyncDiagnostic --> ResultEnvelope