Skip to content

Use producer-owned material identity for attention replay - #77

Open
TKCen wants to merge 16 commits into
mainfrom
feat/producer-owned-attention
Open

TKCen wants to merge 16 commits into
mainfrom
feat/producer-owned-attention

Conversation

@TKCen

@TKCen TKCen commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Problem

Sensorium needs to distinguish producer material from transport wrappers. Wrapper IDs and thematic similarity cannot establish that observations describe the same material. Replay, retained ownership and disclosure must agree, including when a prepared delivery survives a stricter source policy.

Changes

  • Validate producer-owned item/revision identity, complete retained joins and unique canonical records before effects. Reject forged claims, conflicting aliases and ambiguous IDs.
  • Replay equivalent material without new pressure or observer effects. Only eligible owners absorb changed revisions; stricter replay narrows disclosure without reopening restricted content. Validate every retained policy-mutation target before writing and rebuild stale disposable indexes from canonical records.
  • Share source-bound disclosure across status, exact access, attention, cards, pointers and historical rationale. Malformed policy and unbound advisories fail closed. Iterative, bounded metadata traversal withholds an over-limit record without crashing readers or hiding valid neighbors.
  • Recheck prepared delivery against its current unique source owner while holding the outbox-before-candidate transaction through dispatch and receipt. Present null or other malformed origins cannot acquire standalone authority; legitimate absent/empty-string historical declarations remain supported.
  • Add synthetic causal and inverse regressions, source-complete fixtures, and generic architecture, rationale, migration and capability-boundary documentation. Bounded multi-record progress and optional default-off latent metadata remain covered by their existing source regressions.

How it works

flowchart LR
    R[Raw observation] --> V[Validate producer identity and retained joins]
    V --> M{Same material revision?}
    M -->|Yes| P[Replay without new material effects]
    M -->|No| A[Fresh admission or eligible-owner coalescing]
    P --> C[Canonical source and policy]
    A --> C
    C --> D[Source-bound readers]
    C --> E[Current delivery-owner check]
    E --> F[Dispatch under stable owner transaction]
Loading

This explains the source contract, not a deployed host integration.

Verification

Candidate: bd98a400798f2b90a0e568d77b33ddb2f9348c50.

  • Complete network-isolated source suite: 3,067 passed, 3 unchanged optional skips, zero failures or errors. Tested bytes match the committed source.
  • Focused owner/disclosure/replay/lock-order union: 229 passed. Ruff, in-memory compilation and diff checks pass; original regression assertions remain protected.
  • Independent scoped review accepted the delivery-owner repair, assertion integrity and composed-source privacy, including 10 fresh causal/inverse probes. Hosted Python 3.11 fails the deep-JSON fixture during decoding, before disclosure traversal; the completed Python 3.12 push job passed. The current automated review identifies three P1 gaps: canonical-null disclosure, concurrent replay admission and current-instance delivery policy. These and cross-version closure remain open. Not merge-ready.

Limitations

Source-only contribution. Optional companion-host/adapter and Wiki integrations remain unverified. Native sessions, finite workrooms, accounting migration and choice transport are documented proposals, not implemented host guarantees. Optional latent metadata bounds emitted output, not input scanning. No merge, installation or runtime activation is included.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T19:24:05.151586Z bd98a40 Manual request
🔒 Security Review ✅ Completed 2026-10-13T14:04:45.733512Z cab480d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d7b944311d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agent_sensorium/admission_index.py Resolved
Comment thread agent_sensorium/admission.py Resolved
Comment thread agent_sensorium/tools.py Resolved
Comment thread agent_sensorium/admission.py Resolved
@TKCen

TKCen commented Oct 13, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review the current head 3f839956f27c785516d2117012f169c9dfe9dcb9.

The normal follow-up commits address the validated cursor boundary, legacy revision attribution, stricter replay visibility and mixed-revision join findings. Ordinary status now gates direct and source-bound historical prose, including advisory choices whose source linkage cannot be recovered.

Independent source review passed 121 focused cases; all four Python 3.11/3.12 push and pull-request CI checks pass at this head. This remains a source-only contribution, without merge or runtime activation.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3f839956f2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agent_sensorium/tools.py Resolved
Comment thread agent_sensorium/tools.py Resolved
Comment thread agent_sensorium/admission.py Resolved
@TKCen

TKCen commented Oct 14, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Please review the current head 30413b69108ff9effdb87c3e41f68cad9f07b8b6. The inherited wrapper-replay, malformed-status-visibility and duplicate-event-ID findings are addressed with canonical owner validation and synthetic regressions. Dispatch execution overrides now narrow, but cannot broaden, retained disclosure policy.

Verification at this head: complete source suite 2,621 passed with 3 optional integration skips; independent policy review 129/129 passed; Python 3.11/3.12 push and PR CI all pass. This is a source-only contribution; merge and runtime adoption are separate.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30413b6910

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agent_sensorium/tools.py Resolved
Comment thread agent_sensorium/tools.py Resolved
Comment thread agent_sensorium/tools.py Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e56655ba7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agent_sensorium/tools.py
Comment on lines +700 to +704
("threads", threads, selected_threads),
("candidates", candidates, [require("candidates", ref, policy=True)
for ref in selected_candidates]),
("events", events, [require("events", ref, policy=True) for ref in event_ids]),
("signals", signals, [require("signals", ref, policy=True) for ref in signal_ids]),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Narrow prepared outbox records on replay

When producer material has already created a prepared external outbox request, a stricter replay (for example, changing public_safe/Discord to local_only) narrows the signal, event, candidate, and thread here but leaves the prepared outbox row with its original broader surfaces. With direct dispatch enabled, dispatch_outbox_request trusts that retained row and can still send its message to Discord after the source and thread have been restricted; include pending outbox descendants in this closure or revalidate their current source owner before dispatch.

AGENTS.md reference: AGENTS.md:L7-L8

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Addressed in bd98a400798f2b90a0e568d77b33ddb2f9348c50. Preparation and dispatch revalidate the current unique thread/candidate owner. The outbox-before-candidate transaction remains held through the adapter effect and receipt, so a stricter replay cannot interleave with that decision. Present null or other malformed origins cannot acquire historical standalone authority; absent/empty-string compatibility remains. Source-backed fake-transport tests cover stricter replay, denial without mutation and legitimate delivery. Keeping this thread open until exact-head hosted checks finish.

Comment thread agent_sensorium/config.py Outdated
Comment on lines +892 to +893
valid, resolved = self._linked(child, trail, owner=owner,
source_refs=field == "source_refs" and isinstance(value, dict))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Bound nested disclosure traversal

When an otherwise valid retained candidate or thread contains deeply nested JSON metadata, this recursive walk can exceed Python's recursion limit and raise RecursionError instead of denying that record. A roughly 995-level nested dictionary is still accepted by read_jsonl but makes status and other DisclosureVisibility-backed readers crash, so traverse iteratively or enforce a bounded depth/node budget and fail the subject closed when it is exceeded.

AGENTS.md reference: AGENTS.md:L7-L8

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Addressed in bd98a400798f2b90a0e568d77b33ddb2f9348c50. Disclosure traversal is iterative with depth/node bounds and denies an over-limit retained subject instead of raising recursion errors. Regressions cover actual JSONL loading of decoder-admitted deep metadata, normal disclosure readers, valid neighbors and malformed/deep inputs. Keeping this thread open until exact-head hosted checks finish.

Comment thread agent_sensorium/config.py
Comment on lines +899 to +903
if not linked and record.get("type") == "subconscious.advisory":
if (record.get("output_action") in ("DROP", "SAVE", "CREATE_CONSCIOUS_TASK")
or record.get("action") in ("drop", "save", "would_create_conscious_task",
"created_conscious_task_candidate", "updated_conscious_task_candidate")):
return False, False

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Withhold unbound advisory candidates

When a retained advisory candidate has kind="subconscious_advisory" but its source IDs and admission binding are missing, linked remains false and this guard does not run because it checks only the receipt type. The candidate's source-derived summary is consequently exposed by status, candidate-open, volunteer-card, and pointer readers on any surface allowed by its own stale metadata; treat the advisory candidate kind like advisory receipts and deny it unless at least one canonical source link resolves.

AGENTS.md reference: AGENTS.md:L8-L9

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Addressed in bd98a400798f2b90a0e568d77b33ddb2f9348c50. Both advisory receipt types and the subconscious_advisory candidate kind require canonical source binding before source-derived prose is disclosed. Real advisory construction regressions cover unbound denial, hidden sources and valid visible bindings across status, candidate-open, cards and pointers. Keeping this thread open until exact-head hosted checks finish.

@TKCen

TKCen commented Oct 14, 2026

Copy link
Copy Markdown
Owner Author

@codex review

Current source head: bd98a400798f2b90a0e568d77b33ddb2f9348c50. The prepared-delivery, deep-disclosure and unbound-advisory findings are addressed; current-owner validation also rejects malformed origin declarations while preserving legitimate historical absence. Please review this exact successor.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd98a40079

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread agent_sensorium/config.py
Comment on lines +891 to +892
if field not in record or (identifier is None and not source_refs):
continue

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reject null owners on canonical subjects

When a retained canonical thread has a present origin_candidate_id: null, this branch treats it as if the owner declaration were absent. The thread can then pass subject() using only its own visibility and expose source-derived title/summary through status, open, pointers, and volunteer cards even after the originating candidate is hidden; the new delivery guard rejects the same malformed row, so disclosure and delivery now disagree. Reserve the null compatibility exception for standalone operational receipts rather than canonical candidate/thread subjects.

AGENTS.md reference: AGENTS.md:L7-L8

Useful? React with 👍 / 👎.

Comment thread agent_sensorium/tools.py
Comment on lines +1030 to +1032
signals = store.read_jsonl("signals")
try:
replays = _canonical_replays(signals, normalized,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Serialize canonical replay checks with signal appends

When two workers concurrently ingest the same producer material under different wrapper IDs, both can read the pre-append signal snapshot here and pass _canonical_replays; both signals are then persisted, while the candidate transaction deduplicates the second event against the first. This leaves one signal orphaned, reports both calls as fresh promotions, emits duplicate observer effects, and makes every later replay fail with ambiguous_ingress_material because two equivalent retained wrappers now exist. Hold one source transaction from this replay check through the signal/event/candidate commit so equality cannot change between validation and append.

AGENTS.md reference: AGENTS.md:L7-L8

Useful? React with 👍 / 👎.

Comment thread agent_sensorium/outbox.py
Comment on lines +319 to +322
surface = request.get("surface")
policy = {"max_sensitivity": request.get("sensitivity"),
"allowed_surfaces": request.get("allowed_surfaces")}
if not visible_on_surface(request, surface, policy):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Intersect delivery ownership with the current instance policy

When a Discord request was prepared while the profile allowed Discord and the operator later narrows instance.config.json to allowed_surfaces: [] (or lowers max_sensitivity), dispatch still invokes the adapter because this policy is reconstructed solely from the stale prepared row. All ordinary disclosure readers honor the current profile policy, but _current_delivery_owner never loads or intersects it, so an explicit deny-all configuration does not stop an already prepared outbound effect. Revalidate the request and current subjects against the current instance visibility policy before calling the adapter.

AGENTS.md reference: AGENTS.md:L7-L8

Useful? React with 👍 / 👎.

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