---
name: angular-value-trace
description: Diagnose a wrong, stale, inconsistent, timing-sensitive, or mysteriously local Angular UI value by tracing its contract and provenance before editing the visible component. Use when one observable Angular value may have the wrong authority, derivation path, writer, runtime owner, item identity, or readiness state.
metadata:
  version: "0.1.0"
  author: "Yevgeniy Sorokin"
---

# Angular Value Trace

Use this skill when one observable Angular UI value is wrong, stale, inconsistent across consumers, timing-sensitive, tied to repeated-item identity, or suspected to have multiple owners or writers.

Do not use it as a generic Angular debugger, a Signals migration recipe, or evidence that every UI bug is data-flow.

## Procedure

1. Freeze the exact observation and reproduction.
2. Establish the expected contract.
3. Resolve authority for the current phase, or record UNKNOWN.
4. Trace the material derivation path.
5. Enumerate writers, patches, resets, rebinds, and activation conditions.
6. Prove runtime owner and instance identity where relevant.
7. Prove item identity and cardinality for repeated UI.
8. Record readiness prerequisites and whether partial state is allowed.
9. Classify each material edge as OBSERVED, INFERRED, or UNKNOWN.
10. Classify differences as intended or candidate contract violations.
11. Find the earliest causally evidenced contract violation.
12. STOP when evidence is insufficient or no state/data-flow violation exists.
13. Repair the smallest evidenced boundary.
14. Verify counterfactually under the same scenario.
15. Run a nearby valid adversarial case to guard against over-application.

## Decision rule

Choose the earliest causally evidenced contract violation, not the earliest structural difference. If contract or causality is not established, stop.

## Diagnosis statuses

- REPAIR when the earliest causally evidenced contract violation has a smallest justified repair boundary and verified counterfactual.
- STOP_UNKNOWN when evidence does not justify a repair.
- STOP_NO_VIOLATION when the material trace stays inside the evidenced contract.
- STOP_VIEW_LAYER when the failing domain is outside the traced state/data path.

## STOP semantics

- STOP_UNKNOWN when the intended contract cannot be established.
- STOP_UNKNOWN when a material repair boundary depends only on INFERRED or UNKNOWN evidence.
- STOP_UNKNOWN when multiple candidate causes remain observationally equivalent.
- STOP_NO_VIOLATION when no material contract violation exists; investigate another layer.
- STOP_VIEW_LAYER when the failing domain is view/CSS rather than the traced state path.

## Expected output

Return:

- observation
- expected contract and evidence
- authority phase
- ordered material edges with evidence class and causal role
- writers and activation conditions
- runtime owner and instance facts
- identity and cardinality constraints
- readiness prerequisites
- intended differences
- evidence gaps
- first causally evidenced violation or STOP reason
- smallest justified repair boundary
- counterfactual verification
- nearby negative or adversarial verification

## Evidence rules

- OBSERVED is necessary but not sufficient; causality must also be evidenced.
- INFERRED or UNKNOWN alone never justifies a repair.
- Precedence is not causality.
- A later writer is not automatically wrong; authority may change by phase.
- Different runtime instances are not automatically wrong; local scope may be intentional.
- Do not treat two different values as a bug before proving they are supposed to agree.

## Permission boundary

Default to read-only inspection. Do not edit code, install packages, access the network, use secrets, perform destructive actions, or broaden scope without the normal repository/user authorization governing the task.

## Applicability

The method is version-durable. Use version-appropriate Angular adapters.

For current Angular, relevant adapters can include Injector Tree/runtime ownership inspection, signals/computed/linkedSignal where appropriate, Reactive Forms, and signal queries.

For maintained legacy Angular, use provider, RxJS, form, and query mechanisms appropriate to that codebase. Do not force modernization to use this method.

## Canonical knowledge

Human canonical:
https://yevgeniy-sorokin.pages.dev/knowledge/angular-value-trace/

This public Skill is a reusable derivative of KA-0016@0.3.1 / MP-0002@0.3.0. The canonical article and public machine manifest remain the truth parent.
