Skip to content

fix(identity-invariants): never echo left-of-operator text in unsupported-fact rejection - #24

Merged
BunsDev merged 2 commits into
mainfrom
fix/threads-ype-elide-invariant-echo
Jul 27, 2026
Merged

fix(identity-invariants): never echo left-of-operator text in unsupported-fact rejection#24
BunsDev merged 2 commits into
mainfrom
fix/threads-ype-elide-invariant-echo

Conversation

@BunsDev

@BunsDev BunsDev commented Jul 24, 2026

Copy link
Copy Markdown
Member

Closes threads-ype (N-2 from the fresh-context review of OpenCoven/coven#464).

Problem

parse_identity_declaration formatted unsupported identity fact {:?} echoing the left-of-operator text verbatim. A reversed declaration like 'Val Alexander' == familiar.person would echo principal-adjacent text into migration reports and stdout.

Fix

The rejection now names only the expected grammar (the five supported familiar.* facts) and never echoes input:

unsupported identity fact left of operator; expected one of: familiar.name, familiar.person, familiar.pronouns, familiar.purpose, familiar.coven

Downstream compatibility

The unsupported identity fact prefix is preserved. Both known downstream assertions match on that prefix only:

  • tests/support/phase5_retired_ward_corpus.rs (expected_error_contains)
  • coven PR #464 ward_migrate.rs rejection-lane test

Per-declaration locability is retained via the invariant[N]: index prefix added by IdentityInvariantSet::compile.

Validation

  • New regression test: reversed declaration rejected without echoing the principal value
  • Full crate suite: 212 passed, 0 failed
  • cargo fmt --check and cargo clippy -p coven-threads-core --all-targets clean

…rted-fact rejection

threads-ype (N-2 from coven PR #464 fresh-context review):
parse_identity_declaration echoed the left-of-operator text verbatim in
the 'unsupported identity fact' rejection. A reversed declaration like
'Val Alexander' == familiar.person would carry principal-adjacent text
into migration reports and stdout.

The rejection now names only the expected grammar (the five supported
familiar.* facts) and never echoes input. The 'unsupported identity
fact' prefix is preserved — downstream assertions in the retired-Ward
corpus and coven ward_migrate tests match on that prefix only.

Adds a regression test proving a reversed declaration is rejected
without echoing the principal value.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@BunsDev
BunsDev force-pushed the fix/threads-ype-elide-invariant-echo branch from e381494 to dd314cc Compare July 27, 2026 06:17
@BunsDev
BunsDev marked this pull request as ready for review July 27, 2026 06:18
Copilot AI review requested due to automatic review settings July 27, 2026 06:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens identity-invariant parsing to avoid echoing potentially principal-adjacent input text in error messages, while preserving downstream-compatible error prefixes and adding a regression test to prevent reintroduction.

Changes:

  • Replace the unsupported identity fact … rejection so it no longer includes the left-of-operator input text, and instead reports the supported familiar.* grammar.
  • Add a regression test ensuring reversed declarations are rejected without leaking the principal-like text.
  • Preserve downstream compatibility by keeping the unsupported identity fact prefix and relying on invariant[N]: indexing for locability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/coven-threads-core/src/identity_invariants.rs
Signed-off-by: Val Alexander <bunsthedev@gmail.com>
@BunsDev
BunsDev merged commit 1d4b08b into main Jul 27, 2026
1 check passed
@BunsDev
BunsDev deleted the fix/threads-ype-elide-invariant-echo branch July 27, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants