Skip to content

feat(adf): introduce unified evidence/enforcement pipeline #9

Closed

Description

@SmartBrandStrategies

Linked feedback: ADX-007

Problem

Enforcement is fragmented:

  • metric/weight evidence is computed in validator.ts
  • token budget/module budget checks are computed in bundler.ts

This creates multiple result shapes and multiple enforcement entry points.

Evidence:

  • Metric evidence: packages/adf/src/validator.ts:27
  • Bundle budget checks: packages/adf/src/bundler.ts:252

Scope

  • Introduce a single evaluator API (e.g. evaluateEvidence(...)) under packages/adf/src/evidence.ts.
  • Combine:
    • metric constraint results (pass/warn/fail)
    • weight summary
    • token budget utilization
    • per-module budget overruns
    • advisory-only module warnings
  • Update bundler and CLI evidence flows to consume shared evaluator output.

Acceptance Criteria

  • One typed result envelope is used by both bundle and evidence flows.
  • Validator semantics for metric status remain backward compatible.
  • No loss of fields currently emitted in bundle/evidence outputs.
  • Tests cover both metric and budget enforcement in one pipeline.

Test Plan

  • pnpm run test --filter @stackbilt/adf
  • Add tests for:
    • under/at/over ceiling metric statuses
    • bundle token budget utilization
    • per-module budget overrun emission
    • advisory-only module warnings

Activity

  1. added this to the v0.6.0 milestone on Mar 2, 2026
  2. added
    area:adf
    type:feature
    priority:p0
    on Mar 2, 2026
  3. SmartBrandStrategies commented on Mar 2, 2026

    @SmartBrandStrategies
    ContributorAuthor

    Blocked by #8 — bundler split must land first so the evidence pipeline integrates against the new merger.ts/manifest.ts boundaries rather than the monolithic bundler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:adfpriority:p0type:feature

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions