Skip to content

[NOD-002] Delegate policy authority to Core #30

Description

@mrnicholasbcarter-code

User story

As a Node integrator, I need verdict-node to delegate policy authority to verdict-core, so the edge adapter cannot approve work independently.

Problem

verdict-node has validation/forwarding behavior but no tracked issue proving that eligibility, ranking, policy versioning, and denial decisions come from Core. A second policy authority can drift or bypass governance.

Current state

Core issues #218-#236 define the authority path. Node has no open issues. Node must remain transport/edge adapter.

Target state

Node accepts Core decisions/envelopes, validates them, forwards allowed requests, and returns typed denial/degraded results. It never recalculates eligibility or silently falls back.

Design

  • Use the versioned Core TaskSpec, Decision, and ExecutionEnvelope contracts.
  • Remove or isolate policy-adjacent Node classification/fallback logic behind an explicitly compatibility-only path.
  • Validate decision ID, policy version, envelope version/hash, expiry, allowed models/tools/agents, budget, and verification requirements.
  • Preserve stable machine-readable error codes.
  • Add Core↔Node conformance fixtures and document authority ownership.

Repositories/files

  • verdict-node/src/middleware/**
  • verdict-node/src/adapters/**
  • shared generated contract fixtures
  • related Core API integration from verdict-core#236

Dependencies

  • verdict-core#218, #219, #220, #221, #236
  • verdict-ecosystem#2

Acceptance criteria

  • Node makes zero eligibility/ranking/policy-authorization decisions in the production path.
  • A valid Core decision/envelope forwards successfully.
  • Expired, tampered, wrong-version, missing-policy, disallowed-model, over-budget, and missing-verification envelopes are rejected before upstream execution.
  • Unknown fields and stale provider/policy state fail closed or return explicit degraded/approval-required codes.
  • SSE and non-SSE paths use the same authority/enforcement check.
  • Tests prove Core decision and Node transport behavior with shared fixtures.
  • Documentation states Core is authoritative and Node is an adapter.

Testing

Add unit, contract, negative, tamper, expiry, budget, SSE, and forwarding integration tests. Run the Node build and full test suite; attach output/evidence.

Security/NFR

No secret logging. No provider/model substitution. Deterministic validation. Validation p95 target <5ms excluding network.

Definition of done

Code, tests, generated fixtures, docs, and CI conformance gate merged; no policy bypass test remains possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions