Skip to content

Release/75 - #6474

Draft
bobbykolev wants to merge 15 commits into
masterfrom
release/75
Draft

Release/75#6474
bobbykolev wants to merge 15 commits into
masterfrom
release/75

Conversation

@bobbykolev

Copy link
Copy Markdown
Contributor

No description provided.

bobbykolev and others added 5 commits September 4, 2026 09:59
)

* fix: stop whiteboard-draft sweep crashing on distinctAlias column

The hourly WhiteboardDraftSweepService.sweep crashed on every run with
Postgres 42703 (column "distinctAlias.Whiteboard_draftExpiresAt" does not
exist). findExpired used repository.find({ select: { id: true },
order: { draftExpiresAt: 'ASC' }, take }). Whiteboard's inherited eager
`authorization` relation forces a LEFT JOIN, so TypeORM applied the LIMIT by
wrapping the read in a `SELECT DISTINCT ... FROM (<inner>) "distinctAlias"`
pagination query. It appended the ORDER BY column to the outer select/order,
but because `select` restricted the inner projection to `id`, the derived
table never emitted `draftExpiresAt` — so the outer reference could not
resolve. It is a query-construction defect, not a schema/migration problem:
the column exists, and it failed on every sweep regardless of data.

Rebuild findExpired as an explicit, join-free query that selects only the
scalar `id`, which keeps the SQL flat and avoids the distinct-alias path.

Tests: the service spec now drives the query builder and guards against
regressing to the eager-join `find` path (proven red against the old code);
a new find-expired.query.spec builds real TypeORM SQL offline to show the old
option shape omits the ORDER BY column from its projection while the new query
is flat and self-consistent.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013tVHtw561B9drGNY6kL8BS

* test: await protected buildMetadatas() in a beforeAll

Addresses CodeRabbit review on #6437. In our TypeORM fork buildMetadatas()
is async and populates entityMetadatas only after two awaits, so calling it
at describe-body scope and discarding the promise left correctness to depend
on the tick gap before the it() callbacks. Await it in an async beforeAll so
metadata is deterministically populated before any createQueryBuilder call.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013tVHtw561B9drGNY6kL8BS

* refactor: unify sweep expiry predicate + harden find-expired tests

Addresses the /code-review high pass on #6437 (fix itself confirmed correct):

- findExpired now expresses the expiry boundary as
  `.where({ draftExpiresAt: LessThanOrEqual(new Date()) })`, the same operator
  cleanupExpired's locked re-read uses, so the candidate query and the re-check
  can't drift (was a raw string after the initial fix). Generated SQL is
  identical and still flat/join-free.
- find-expired.query.spec: match on our own identifiers + case-insensitive
  keywords instead of exact quoting/casing, so a fork SQL-formatting change
  can't silently break or falsely pass; mirror the object-where form; and
  reframe the old-shape test honestly as asserting the distinct-alias
  *precondition* (join present + ORDER BY column unprojected), not the executed
  crash. The real-code behavioural guard stays in the service spec.
- service spec asserts the where() operator is a lessThanOrEqual FindOperator.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013tVHtw561B9drGNY6kL8BS

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* fix: repin TypeORM preview dependency

* fix: use durable TypeORM package
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

📊 PR Metrics Summary

Title: Release/75
Total LOC Changed: 413
Files Changed: 5
Proposed Review Type: HUMAN_AUGMENTED_LLM
Rationale:

  • critical_path_change
  • LOC>200
  • files<=10

Flags

  • Critical Path Change
  • Composite High Risk Trigger

Thresholds

{
  "critical_loc": 200,
  "simple_loc": 100,
  "file_count": 10
}

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Schema Diff Summary: No blocking changes

Category Count
breaking 0
prematureRemoval 0
invalidDeprecation 0
deprecated 0
additive 17
info 2

Baseline branch: master
Current schema MD5: 1aa66d5c969976fc3b8423f8ab502ebf (size 347704)
Previous schema MD5: 0acda231ee705b7ce3cac6bf8b547b9a

antst and others added 10 commits September 9, 2026 10:05
* feat: add signing attempt persistence

* test: strengthen signing persistence evidence

* test: specify memo signing preparation

* test: strengthen signing persistence evidence

* test: specify memo signing API boundaries

* test: retain changed coverage evidence

* test: specify actor-bound signing attempt read

* test: fail closed on missing coverage targets

* test: support shallow CI coverage checkouts

* test: address final signing persistence review

* feat: prepare memo signing previews

* test: retain changed coverage evidence

* test: fail closed on missing coverage targets

* test: support shallow CI coverage checkouts

* test: address final signing persistence review

* test: enforce signing preview coverage

* chore: update signing preview schema

* test: verify signing preview glyph behavior

* test: specify memo signing continuation

* test: verify signing preview glyph behavior

* feat: harden memo signing preparation

* fix: map lost memo access in signing preview

* test: cover prepare deletion boundaries

* test: tie live-read failure to memo deletion

* test: label modelled collaboration deletion boundary

* test: model collaboration purge error precisely

* feat: start memo signing through trust gateway

* test: prove memo signing continuation boundaries

* fix: close memo signing continuation gates

* test: specify memo signing return flow

* test: assert safe signing failure logs

* fix: address memo signing review findings

* test: include signing inputs in scoped coverage

* test: report file-service revision mismatch

* feat: complete memo signing returns

* fix: harden memo signing returns

* test: harden memo signing return wiring

* fix: validate memo signing gateway responses

* feat: wire local memo signing gateway

* docs: make local signing fixture reproducible

* docs: correct signing gateway eviction check

* chore: pin trust gateway v0.2.0 locally

* feat: verify signed memo integrity

* fix: tighten memo signature verification

* docs: add sandbox signing acceptance runbook

* docs: correct sandbox signing prerequisites

* chore: pin trust gateway v0.2.1

* fix: populate authentication identity in actor context

* test: verify actor context identity caching

The User authenticationID query runs only on an actor-context cache miss. The complete context, including authenticationID, is retained in the existing per-actor cache entry.

* fix: route memo signing previews to server

The generated preview URL uses the private REST content-signing prefix. The local quickstart now gives that owned prefix a dedicated GET router instead of falling through to the client catch-all.

* docs: verify natural signing expiry

The Alkemio browser gate leaves a continued attempt uncompleted and observes the persisted deadline plus sweep outcome. Gateway restart eviction remains covered by the gateway contract tests rather than the local Alkemio journey.
Move the real-service suite out of the trusted ARC test job, which has no Docker daemon, into an unconditional Ubuntu job. Keep unit LCOV and Sonar wiring unchanged while retaining scoped integration coverage as a separate artifact.
* test(signing): define space gating behavior

Capture the RED expectations for default-off license propagation, endpoint enforcement, and the entitlement migrations before the implementation.

* feat(signing): gate signing by space license

Add a default-off memo-signing space entitlement and license plan, inherit it through collaboration licenses, and enforce it before prepare and continue side effects. Existing signed-copy reads and verification remain available.

* docs(migrations): clarify signing rollback scope

* test(signing): pin space gating boundaries

* docs(signing): record entitlement boundaries
Co-authored-by: Bobby Kolev <bobbykolev@abv.bg>
* test(signing): cover certificate subject mapping

RED: the existing reader still returns the OIDC provider subject when certificate metadata is present, including malformed or unusable claims.

* feat(signing): map Cleverbase certificate subject

Prefer the subject serialNumber RDN from the mapped signing-certificate PEM while retaining the linked-provider prerequisite. Fall back to the provider subject only when the metadata claim is absent; present invalid claims fail closed.

* test(signing): cover stored ID token mapping

RED: the existing metadata_admin implementation falls back for seven token-path cases. The approved design reads the already declassified initial ID token from the same Kratos response.

* feat(signing): map stored Cleverbase ID token

Kratos validates and stores the initial ID token when the OIDC provider is linked, then declassifies it on the existing admin identity response. Read the signing certificate from that token payload without a second Kratos call; preserve fallback only for absent token or claim and fail closed for malformed present data.

* test(signing): cover token fallback diagnostics

* fix(signing): decode stored Cleverbase ID token safely
* test(memo): reproduce signing PDF structure loss

* fix(memo): preserve block structure in signing PDFs

* fix(memo): preserve blank paragraph representation

* fix(memo): preserve mixed nested list hierarchy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants