Skip to content

bug(constraints): task-specific PROFILE/LOCKED constraints (C2F, artifact-first) lack aspect_classification — always flood into every session #116

@hugolytics

Description

@hugolytics

Problem

_is_stage_relevant_constraint correctly gates aspect-classified constraints by session_aspect_ids (fixed in #116). But several PROFILE/LOCKED tactical rules that are task-specific have no aspect_classification in their hints, so they bypass that gate entirely and fall through to the MUST+LOCKED always-pass check (lines 6677-6681).

Affected constraints (confirmed via DB query):

Constraint UID rule_kind Problem
C2F framing cap 15m tactical_focus/c2f_framing_cap_15m/v1 capacity Only relevant when a C2F task exists
Artifact-first scheduling gate tactical_focus/artifact_first/v1 sequencing Relevant for any session with unclarified tasks
Block exit criteria + hard stop tactical_focus/block_exit_hard_caps/v1 Could be universal, needs review

Observed in session 1773616609.406049: All three appear in every constraints_active_snapshot regardless of session content.

Root cause

These constraints were created before the aspect_classification schema was introduced. They lack an aspect_id, so _is_stage_relevant_constraint cannot gate them by session context.

Acceptance criteria

  • Each affected constraint is either:
    • A) Given an aspect_classification with an appropriate aspect_id (e.g. c2f_work) — code-only change once data is updated
    • B) Confirmed as truly universal and left with MUST+LOCKED pass-through
  • Data migration script updates the hints column in timeboxing_constraints for affected rows
  • After migration, a session with no C2F tasks shows no C2F constraints in constraints_active_snapshot
  • New test: session with c2f_work aspect in session_aspect_ids → C2F framing cap included; session without → excluded

Scope

data/admonish.dbtimeboxing_constraints table, hints column for uid starting with tactical_focus/c2f_*
Possible new Alembic migration to backfill aspect_classification

Related

Fixes the code-side gate: PR for #116

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions