Skip to content

Choose preserved original sources in Companion - #2855

Open
Chris0Jeky wants to merge 7 commits into
mainfrom
codex/2808-original-source-context
Open

Choose preserved original sources in Companion#2855
Chris0Jeky wants to merge 7 commits into
mainfrom
codex/2808-original-source-context

Conversation

@Chris0Jeky

Copy link
Copy Markdown
Owner

Companion can now use an explicitly chosen preserved answer or evidence asset without copying private text into the message. The picker shows bounded excerpts and labels superseded answers as historical. The saved turn retains the exact asset ID, memory version, content hash and supersession state across reloads and all four experiences.

Server reads enforce owner, active board access, native capture membership and expected version/hash. Current context reads avoid memory-history graphs; source choices page ten rows and the combined five-private-source/20,000-character context limits remain. Existing context JSON stays compatible. No migration, implicit retrieval, external fetch or automatic board Apply is introduced. This reduces source-copying and maintenance while preserving Review/Approve/Apply.

Validation:

  • Full frontend: 6,307 passed, three existing skips; typecheck, production build and scoped lint passed.
  • Full backend execution: Domain 1,639, Application 4,258, API 2,980, CLI 243 and Integration 7 passed. Three Architecture checks initially rejected the new controller declaration syntax; it now uses the repository pattern, and all 28 Architecture checks plus 26 contextual API tests pass. The initial failed run is retained; this is scoped repair evidence, not a claim that that command originally exited green. Existing skips total 34 across the suites.
  • Chromium journey passed: original-only POST references, historical receipt/reload across Classic/Studio/Companion/Unified, 375px layout, no serious/critical scoped axe findings, board unchanged. Screenshot inspected; synthetic source-context.e2e.db only.
  • Documentation links/governance and diff checks passed. Independent read-only Luna review found no HIGH/CRITICAL privacy, authorization, wrong-source, replay or JSON-compatibility defect. Controller follow-up only aligns declaration/constructor syntax without changing authorization or behavior.

Stacked on the older-memory preservation branch until its parent lands. Related to #2808; audio/transcription, richer observations/attention, proposal overlays and other retained follow-through remain open. Test/Mock transport evidence does not establish live model quality, physical-device acceptance or deployment.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 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-09-09T23:01:07.892193Z 427e6b8 New commits
ℹ️ 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.

@Chris0Jeky Chris0Jeky moved this from Pending to Review in Taskdeck Execution Sep 9, 2026

@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: d7767a7239

ℹ️ 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 on lines +37 to +38
} catch {
if (request === generation) error.value = 'Originals could not be checked. Retry, or refresh all sources if this memory changed.'

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 Surface source authorization failures as permission errors

When board access is revoked while the picker is open, the new endpoint returns 403, but this catch collapses it into the same retry/refresh message as stale-version and network failures. That leaves the user repeatedly retrying an operation they no longer have permission to perform; inspect the response status and show the required permission-specific state for 403 while retaining the generic retry message for transient failures.

AGENTS.md reference: frontend/AGENTS.md:L5-L6

Useful? React with 👍 / 👎.

@Chris0Jeky

Copy link
Copy Markdown
Owner Author

Review disposition for comment3973520894: MEDIUM usability, non-blocking. The API enforces revoked board access with403 and the picker does not reveal a source; the defect is that its error text does not distinguish permission loss from transient/stale selection failures. Track permission-specific picker messaging and retry disabling in #2808's remaining frontend follow-through. No security authorization bypass or data-loss path was identified, so this does not trigger a parent fix/review cascade.

@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: 427e6b86c5

ℹ️ 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".

{
public async Task<Result<ChatAssetPage>> ListSourcesAsync(Guid actorId, Guid boardId, Guid memoryId, int revision, int offset, CancellationToken ct)
{
if (boardId == Guid.Empty || memoryId == Guid.Empty || revision < 1 || offset < 0 || offset > 1000)

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 Allow continuation past offset 1000

When a memory accumulates at least 1,011 inline assets through corrections, the page at offset 1000 returns nextOffset: 1010, but this guard rejects that continuation request with 400. Capture.AppendSourceAsset deliberately leaves superseded correction history unbounded, so preserved originals after the first 1,010 assets become unreachable; either accept every emitted offset or stop emitting an unusable continuation.

Useful? React with 👍 / 👎.

Comment on lines +50 to +51
<button v-if="!loaded || nextOffset !== null" type="button" :disabled="disabled || loading" @click="load">
{{ loading ? 'Checking originals…' : loaded ? 'Load more originals' : 'Choose original sources' }}

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 Identify each source picker by its memory

When a board has multiple memories, every child renders the same accessible button name (Choose original sources or Load more originals), and the plain containing div has no semantic association with the corresponding memory label. Screen-reader button navigation and voice control therefore cannot distinguish which memory each button operates on; include the memory title in the accessible name or group each picker under an associated label.

Useful? React with 👍 / 👎.

@Chris0Jeky

Copy link
Copy Markdown
Owner Author

PR2855 comments3973786334 and3973786336 are MEDIUM, non-blocking follow-through: pagination stops accepting offsets beyond1000 despite emitting the next offset for longer correction histories; repeated source-picker buttons lack a memory-specific accessible name. Neither bypasses authorization or deletes evidence. Track accepting every emitted continuation within a bounded page size and adding memory-specific accessible labels in the #2808 source-picker follow-through. The existing permission-message finding3973520894 remains tracked separately. No parent review loop or broad source audit is reopened.

Base automatically changed from codex/2808-legacy-originals to main September 9, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Review

Development

Successfully merging this pull request may close these issues.

1 participant