Skip to content

pm-stack(schema): orch_items.state is NOT NULL but TierItem.state is optional — valid items without state are rejected (from PR #8458) #8856

Closed

Description

@dezren39

Finding (unaddressed PR review comment)

Codex P2 on open PR #8458 — comment #8458 (comment) by chatgpt-codex-connector[bot], 2026-11-11T02:49:13Z, at pm-stack/shared-schema/migrations/20261111_0001_orchestration_state.up.sql:34:

Allow classification items without a state — When importing a valid non-session tier item, this column rejects the snapshot because the existing contract makes TierItem.state optional (pm-stack/aggregator/src/model.ts), and the decision item in pm-stack/aggregator/test/contract-corpus/v1/orchestration.json actually omits it. There is no default or normalization specified in the new writer contract, and an empty-string fallback also fails this check. Make the column nullable for absent state, or explicitly define a compatible normalization before fixing the schema contract.

Grace rule: the PR is still open; the comment is more than 24 hours old (2026-11-11T02:49:13Z) with no fix or reply since, so it counts as unaddressed.

No-response evidence

Still live on the PR head (verified 2026-11-11, two gh api reads at ref 2532da6)

  • Migration, line 34: state text NOT NULL CHECK (btrim(state) <> '').
  • pm-stack/aggregator/src/model.ts on the head: TierItem.state?: string (line ~596, "AttentionState for sessions; a free label otherwise") — optional.
  • pm-stack/aggregator/test/contract-corpus/v1/orchestration.json on the head: the needsDrew decision item (example-owner/example-repo#812, kind "decision") has no state field at all, so importing the corpus snapshot would be rejected by the column as written.

Acceptance criteria

  • The schema contract accepts valid tier items without a state — the column is nullable for absent state, or a compatible normalization is explicitly defined in the writer contract and applied before insert — or the finding is resolved by a documented decision on this issue.
  • The contract corpus (including the state-less decision item) imports cleanly under the final schema.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    on Nov 12, 2026
  2. developing-today commented on Nov 12, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 12, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  4. dezren39 commented on Nov 12, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · triaged (inline) + picked up task 15081 for issue #8856

    • Agent: repo queue worker, lane any-b (repo-worker-code). Lane assignment: direct.
    • Fresh check: issue pm-stack(schema): orch_items.state is NOT NULL but TierItem.state is optional — valid items without state are rejected (from PR #8458) #8856 is OPEN with status/needs-triage; source PR pm-stack: orchestration state schema contract (#5005 phase 1, P1 vetting slice) #8458 is OPEN at head 2532da6, branch queue/14783-5005-orchestration-schema, no hard-stop labels, and untouched since the Codex comment (2026-11-11T02:49Z) — its owning task 14783 is not claimed or parked, so the fix proceeds on that branch in this session rather than as a parallel PR.
    • Triage: work kind small-fix (task/small-fix); priority/normal (already applied — a valid snapshot rejected by the schema is a correctness bug, but the affected import path is an internal orchestration store, not user-facing); effort/s (one migration line plus an import probe); kind/bug already present.
    • First concrete step: verify the three cited reads on the PR branch (migration line 34 NOT NULL + non-empty check; TierItem.state optional in aggregator model.ts; contract-corpus decision item omitting state), then make orch_items.state nullable and run the import probe.
    • Acceptance check: the contract-corpus orchestration.json, including the state-less decision item, inserts cleanly under the final schema; existing state-carrying rows are unaffected.
  5. added
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    effort/sSmall: expected under 2 hours of work
    queue/claimedQueue worker lifecycle state
    and removed on Nov 12, 2026
  6. 1 remaining item

  7. dezren39 commented on Nov 12, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · fixed — task 15081 (issue #8856)

  8. dezren39 commented on Nov 12, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · already done — task 15085 (issue #8856)

  9. added this to the PM stack coherence milestone on Nov 12, 2026
  10. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Fixed by PR #8458 (squash-merged 8b42925, 2026-11-14): orch_items.state is now nullable with a non-blank-when-present CHECK. Verified on the merged head by pm-stack/shared-schema/test-orchestration-migration.sh on disposable PostgreSQL 16: state-less contract-corpus item imports with NULL state; blank state still rejected. — repo-worker-code, lane any-b, task 17224

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

Metadata

Metadata

Assignees

Labels

app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/sSmall: expected under 2 hours of workepic/pm-stackReprioritization program epic (2026-11-12)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/pr-comment-reviewFiled by the pr-comment-review jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted teststask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions