Skip to content

M7: IdentityIntegrity (within-session) — mechanical identity-drift gate - #33

Merged
GodSpeed313 merged 1 commit into
mainfrom
feature/m7-identity-integrity
Jul 16, 2026
Merged

GodSpeed313 merged 1 commit into
mainfrom
feature/m7-identity-integrity

Conversation

@GodSpeed313

Copy link
Copy Markdown
Owner

Implements the M7 IdentityIntegrity constraint, spec-first, per docs/m7_identity_integrity_ruling.md (LOCKED). Third M7 constraint, after CredentialIntegrity (#31) and LinkRestriction (#32).

Scope: within-session only (v1), by design

An agent's declared identity (handle/name, persona, asserted role) must stay consistent for the duration of a session once declared. Cross-session change-rate ("how often do legitimate agents change bios/names") is an explicit deferred gap (§5) — it isn't observable from a single snapshot and needs the longitudinal cohort read now in progress. Shipping within-session now because it's a self-contained mechanism with no data dependency.

Grounded in the baseline pass

The baseline sampling found ✓ Verified is near-universal and non-discriminating, so IdentityIntegrity can't lean on platform trust signals — it's self-referential (does the agent stay consistent with what it declared).

The load-bearing refinement: detection is mechanical only (§6)

The baseline pass also measured that first-person "I am / I do X" is the dominant normal register on Moltbook. A detector that fired on "identity claims" would collide with the most common sentence structure on the platform. So v1 detection is mechanical only:

  • handle/name — explicit self-naming constructs ("my name/handle is X", "call me X", "I am @X", "this is u/X") naming something other than the declared identity.
  • role_negation — direct negation of a captured declared role.
  • Never fires on bare "I am / I do X" or on @other-agent references.

freeze + escalate is kept because detection is high-confidence and narrow — severity paired to confidence, not kept by default. Semantic persona-drift is deferred as an xfail(strict)-pinned gap.

What's here

  • moltbook/moltbook.pi — identity_drift field + IdentityIntegrity (priority: high, freeze + escalate); all three M7 constraints now enforced.
  • moltbook/detector.py — scan_identity (mechanical).
  • moltbook/client.py — captures declared identity once at session start (immutable; fresh client == fresh session == legitimate reset, §2), gate as Gate 3, IdentityDriftBlocked.

Tests

16 (15 pass + 1 xfail). Highlight: test_bare_first_person_claims_do_not_fire encodes the refinement — the detector stays silent on exactly the dominant register the baseline measured. Plus the violation/clean pair, role-negation, fresh-session reset, end-to-end block→freeze, and the xfail(strict) pinning the deferred semantic-drift gap. Updated the CredentialIntegrity/LinkRestriction enforce assertions for the third constraint.

Full suite: 330 passed, 4 xfailed.

Not in scope (by ruling)

Cross-session identity change-rate (v1.1, pending cohort data), semantic persona-drift (deferred gap), and automation-cadence / coordinated-cluster signals (ManipulationFlag v1.1/v2).

🤖 Generated with Claude Code

Spec-first ruling docs/m7_identity_integrity_ruling.md (LOCKED), then the
implementation. Scoped to WITHIN-session identity consistency (v1); cross-session
change-rate is an explicit deferred gap pending the longitudinal cohort read.

- moltbook/moltbook.pi — identity_drift field + IdentityIntegrity (must equal
  false; freeze + escalate; priority high). Joined enforce (all three M7
  constraints); arbiter never_acceptable gains identity_declaration_self_modification.
- moltbook/detector.py — scan_identity, MECHANICAL ONLY (ruling §6): handle/name
  contradiction via explicit self-naming constructs, and direct role negation.
  Deliberately never fires on bare "I am / I do X" (the dominant normal register
  the baseline pass measured) or on @other-agent references. Semantic persona-drift
  is a deferred, xfail-pinned gap.
- moltbook/client.py — captures declared identity once at session start (immutable
  for the session; a fresh client == fresh session == legitimate reset, ruling §2),
  adds the identity gate as Gate 3, latches identity_drift, raises
  IdentityDriftBlocked. freeze + escalate is justified BY the narrow high-confidence
  detection scope, not kept by default.
- tests — violation/clean pair, detector cases, the dominant-register GUARD
  (bare first-person claims must not fire), fresh-session reset, end-to-end
  block->freeze, and an xfail(strict) pinning the deferred semantic-drift gap.
  Updated CredentialIntegrity/LinkRestriction enforce assertions for the third
  constraint.

Full suite: 330 passed, 4 xfailed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@GodSpeed313
GodSpeed313 merged commit 6c558e5 into main Jul 16, 2026
2 checks passed
@GodSpeed313
GodSpeed313 deleted the feature/m7-identity-integrity branch July 16, 2026 23:37
GodSpeed313 added a commit that referenced this pull request Jul 17, 2026
…ate (#34)

Implements docs/m7_identity_integrity_ruling_addendum_1.md (LOCKED 2026-07-17),
the verified response to an external technical review of #33:

- A1: declared_handle is required — MoltbookClient fails closed (ValueError)
  instead of running the identity gate against a {""} baseline.
- A2: multi-word display names supported — bounded 4-token self-naming capture
  + bidirectional leading-token-prefix comparison. Fixes the truthful
  "My name is Continuum Guardian" self-DoS false positive.
- A3: role-negation regex anchored both ends ("art" no longer matches
  "I am not an artist").
- A4: quoted/reported speech documented as a named gap, pinned xfail(strict);
  quote-exclusion zones deliberately not implemented (evasion channel).
- A5: pre-send gate is now scan-all-then-block per v0.1 Q1 ("no violation is
  silently dropped"): all detectors run, every finding latches, link log always
  written, then one raise, most severe first. The resolver now sees the full
  co-active set for a multi-violation message.
- A6: consistency-vs-authenticity scope distinction documented in the addendum.

Post-lock implementation note: A2 has a pinned residual gap — truncating a
multi-word name and continuing unpunctuated pollutes the capture and
false-positives (xfail-pinned; capitalization-gated continuation is the
candidate v1.1 fix).

Tests 330 + 4 xfail -> 344 passed + 6 xfail. README/CLAUDE.md stale "278 tests"
corrected; M7 status row added to the README build table.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant