Skip to content
Draft
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
a4e97cb
feat(noema-agent): add calendar conflict-check tool
claude Aug 30, 2026
206655c
Merge remote-tracking branch 'origin/develop' into claude/noema-conte…
claude Aug 30, 2026
6a5365e
fix(noema-agent): fail closed on oversized existing-commitment batches
claude Aug 30, 2026
dff8550
feat(calendar): persist conflict judgments and human corrections (G-06)
claude Aug 30, 2026
7c20155
fix(calendar): address Devin review findings on the judgment/correcti…
claude Aug 30, 2026
86f4bd9
fix(calendar): scope judgments by workspace_id, fix 5 more Devin find…
claude Aug 30, 2026
e3e09ad
fix(calendar): no-op overrides preserve original reason; update stale…
claude Aug 30, 2026
a5cebe5
docs: fix self-contradiction in the just-updated doctoring doc
claude Aug 30, 2026
ee83eff
feat(attachments): quarantine content-type mismatches, add attachment…
claude Aug 30, 2026
dcc9fcd
fix(attachments,calendar): OOXML false-positive quarantine, unprocess…
claude Aug 30, 2026
ba9a01b
feat(attachments): add AttachmentReparseWorker to consume reparse_pen…
claude Aug 30, 2026
522d422
fix(attachments,calendar): Devin review round on AttachmentReparseWorker
claude Aug 30, 2026
ef49fc9
fix(attachments): correct cursor starvation and advisory-lock connect…
claude Aug 30, 2026
da81656
fix(migrations,calendar): correct downgrade constraint drop and add o…
claude Aug 30, 2026
733f22c
fix(newsdom-worker): dedicated lease connection + starvation-free cur…
claude Aug 30, 2026
d93cc8c
fix(workers): set AUTOCOMMIT on the dedicated advisory-lease connection
claude Aug 31, 2026
603ff17
fix(security): scope Email/Attachment queries by workspace_id, not ju…
claude Aug 31, 2026
fae8dbc
docs(security): verify workspace-claim trust boundary raised by review
claude Aug 31, 2026
af9ed1e
fix(security): enforce workspace claim matches org at auth layer
claude Aug 31, 2026
6cd3892
fix: add missing bootstrap_db columns and stop reparse from deleting …
claude Aug 31, 2026
ffed35e
fix: populate workspace_id in the ZIP-archive fixture importer's bulk…
claude Aug 31, 2026
b778fb6
fix: enforce workspace-safe Noema identity
seonghobae Aug 31, 2026
6df8f44
fix: match email upsert/bootstrap uniqueness to the workspace-scoped …
claude Aug 31, 2026
62b74a0
fix: migration 0020 also recognizes bootstrap's owner-only email index
claude Aug 31, 2026
d05e2a6
fix: enforce workspace identity across mail flows
seonghobae Aug 31, 2026
25e8e60
Merge commit '62b74a0532cbd2f7374ccc3c6febbb77846367dc' into codex/pr…
seonghobae Aug 31, 2026
9c49bd2
docs(adr-0005): correct stale auth workspace-claim rejection description
claude Aug 31, 2026
2c0fe37
test: align bootstrap identity regression
seonghobae Aug 31, 2026
2a6c8a5
test: accept early legacy index cleanup
seonghobae Aug 31, 2026
94f02eb
fix: create workspace identity after bootstrap backfill
seonghobae Aug 31, 2026
b355ec3
Merge commit '9c49bd29af162b8fea88f136b89744f4154f3d85' into codex/pr…
seonghobae Aug 31, 2026
611c9b5
fix: migration 0020 must check constraint before dropping backing index
claude Aug 31, 2026
e11cb07
Merge remote-tracking branch 'origin/claude/noema-contextualwisdomlab…
claude Aug 31, 2026
c3e2856
fix(pop3): resolve workspace from existing mail instead of nonexisten…
claude Aug 31, 2026
399c1e5
fix(fixtures): store imported email under the configured workspace id
claude Aug 31, 2026
c6085ef
fix(email-import): scope owner quota count to owner, not workspace
claude Aug 31, 2026
1b85703
fix(calendar): rename correction rationale column to two-word name
claude Aug 31, 2026
a3b5f8f
fix(db): preserve calendar rationale migration path
seonghobae Aug 31, 2026
a1027af
style(tests): replace unnecessary lambda with named function
claude Aug 31, 2026
786d154
fix(import): scope duplicate lookup and graph projection to workspace
claude Aug 31, 2026
968b21f
fix(search): exclude non-parsed attachments from hybrid search
claude Aug 31, 2026
96cd0c0
fix(db): skip absent legacy email table during bootstrap
seonghobae Aug 31, 2026
d3422db
fix(tests): add missing skip-on-no-postgres guard to two new smoke tests
claude Aug 31, 2026
b9b02dd
fix(db): stop 0001's fresh-install migration from crashing, fix hidde…
claude Sep 1, 2026
c1f02e2
fix(newsdom): stop pending-result starvation; fix(data-api): lock att…
claude Sep 1, 2026
780d910
fix(attachments): index reparsed attachment content into the content …
claude Sep 1, 2026
5096d1f
fix(attachments): preload graph relationships for reparse
seonghobae Sep 1, 2026
beded49
fix(attachments): persist reparsed graph topology and vectors
seonghobae Sep 1, 2026
f63a109
fix(attachments): chunk reparsed embedding sources
seonghobae Sep 1, 2026
41ae6a2
fix(db): skip absent legacy email read-state table
seonghobae Sep 1, 2026
a4e0119
fix(ci): treat draft governance as waiting
seonghobae Sep 1, 2026
bd4b5ae
Merge remote-tracking branch 'refs/remotes/origin/claude/noema-contex…
seonghobae Sep 1, 2026
86074f6
test(attachments): skip the persisted-reparse postgres smoke cleanly …
claude Sep 1, 2026
4b4b1cb
Merge remote-tracking branch into HEAD
claude Sep 1, 2026
51245f7
test: fail reparse smoke on postgres defects
seonghobae Sep 1, 2026
db97962
fix(ci): wire repo-root governance contract tests into CI; fix 2 brok…
claude Sep 1, 2026
de11149
fix(db): make 0011_email_read_state's legacy-table guard offline-safe
claude Sep 1, 2026
3cbbba8
merge: refresh attachment reparse stack base
seonghobae Sep 1, 2026
3a2246d
Merge remote-tracking branch 'origin/claude/attachment-reparse-conten…
seonghobae Sep 1, 2026
ede7f4b
fix(ci): parse app-ci.yml as YAML in the CI-wiring regression test; s…
claude Sep 1, 2026
87ef2e5
fix(db): defer 0011's legacy-table check to SQL, not Python
claude Sep 1, 2026
d78655a
Merge remote-tracking branch into HEAD
claude Sep 1, 2026
8e47575
fix(ci): stop the root governance test step from crashing under PYTHO…
claude Sep 1, 2026
09a2443
fix(db): resolve 0011's legacy-table check through search_path, not r…
claude Sep 1, 2026
c249096
docs(db): document 0011's op.execute as a deliberate structured-ops e…
claude Sep 1, 2026
26e685e
merge: refresh reparse stack and narrow postgres skip
seonghobae Sep 1, 2026
d244ccc
fix(attachments): resolve reparse embedding source and migration down…
claude Sep 1, 2026
f316b2d
merge: bring in base-branch CI-wiring fixes merged onto this branch a…
claude Sep 1, 2026
212acb9
fix(ci): add repo-root pytest.ini to stop the root-tests step crashing
claude Sep 1, 2026
f3af149
merge: bring in base-branch changes to resolve mergeable_state DIRTY
claude Sep 1, 2026
6294b8b
fix(migrations): suppress bandit B608 false positive on 0011 DDL cons…
claude Sep 1, 2026
0345eda
test(alembic): narrow the connectivity-probe exception handler in the…
claude Sep 1, 2026
5cb5e49
fix(noema-agent): route LLM calls through contextual-orchestrator, no…
claude Sep 2, 2026
ba1b9cc
docs(noema-agent): correct 'two separate agents, share only a name' f…
claude Sep 2, 2026
34c71d2
fix(newsdom-worker,attachment-reparse-worker): stop a stuck row from …
claude Sep 2, 2026
66f4f0f
docs(noema-agent): stop citing an ADR file that doesn't exist on this…
claude Sep 2, 2026
836c274
fix(newsdom-worker,tenant-config): wire the Noema gateway config and …
claude Sep 2, 2026
b8bccf7
fix(newsdom-worker,attachment-reparse-worker): rediscover rows revert…
claude Sep 2, 2026
cdcf2da
Merge remote-tracking branch 'origin/claude/noema-contextualwisdomlab…
claude Sep 2, 2026
d7e5d2d
fix(test): add missing refresh() to _LiveReparsePendingSession fake
claude Sep 2, 2026
ff8807a
fix(attachments): index reparsed attachment content into the content …
seonghobae Sep 2, 2026
b32954d
fix(migrations): suppress Semgrep false positive on 0011_email_read_s…
seonghobae Sep 3, 2026
7ce6592
fix(tasks): preserve scheduler lease across transactions
seonghobae Sep 5, 2026
1709ebb
test(tasks): preserve database import boundary
seonghobae Sep 5, 2026
90ae37e
test(reply-sla): capture bounded batch conflict recovery RED
seonghobae Sep 12, 2026
e868a6b
fix(reply-sla): bound owner conflict recovery batches
seonghobae Sep 12, 2026
36e63db
fix(reply-sla): preserve typed conflict codes at API boundary
seonghobae Sep 12, 2026
16e1639
fix(reply-sla): preserve owner harness and bounded retries
seonghobae Sep 12, 2026
236c986
fix(reply-sla): reconcile pre-flush compatibility races
seonghobae Sep 12, 2026
2e0b5f8
chore(ci): adopt PostgreSQL parent without losing governance tests
seonghobae Sep 12, 2026
da03f10
test(ci): adopt PostgreSQL parent contract
seonghobae Sep 12, 2026
95ad7cf
merge: adopt stacked CI PostgreSQL prerequisite
seonghobae Sep 12, 2026
838f7a7
test(ci): preserve parent stacked-trigger regression
seonghobae Sep 12, 2026
7f7008a
test(ci): adopt parent runtime-secret contract
seonghobae Sep 12, 2026
8dfa81b
chore(ci): adopt parent ephemeral runtime auth step
seonghobae Sep 12, 2026
5e88d2e
merge: adopt runtime-auth CI prerequisite
seonghobae Sep 12, 2026
db33cc6
test(ci): adopt immutable pgvector parent contract
seonghobae Sep 12, 2026
d924c27
chore(ci): adopt parent pgvector digest pin
seonghobae Sep 12, 2026
2d39207
merge: adopt immutable PostgreSQL CI prerequisite
seonghobae Sep 12, 2026
0d2fcdc
ci: mask ephemeral PostgreSQL acceptance secret
seonghobae Sep 12, 2026
5a9fd42
test(ci): require secret masking before env export
seonghobae Sep 12, 2026
7e10c79
merge: adopt masked PostgreSQL CI prerequisite
seonghobae Sep 12, 2026
012afe8
test(db): rollback destructive migration smoke fixture
seonghobae Sep 12, 2026
7851809
test: reproduce owner-scope authorization regressions
seonghobae Sep 12, 2026
7174b27
fix: enforce workspace source scope for tasks
seonghobae Sep 12, 2026
5684b0b
style: preserve minimal task-scope diff
seonghobae Sep 12, 2026
fd83a88
fix: preserve integrity and workspace authorization boundaries
seonghobae Sep 12, 2026
9ebb595
test: match compiled email scope identity
seonghobae Sep 12, 2026
4d61c59
test: reject live Alembic inspection offline
seonghobae Sep 12, 2026
e412d67
fix: support offline calendar migrations
seonghobae Sep 12, 2026
a0dda3f
test: quarantine empty ZIP disguises
seonghobae Sep 12, 2026
28f94e7
fix: recognize empty ZIP magic
seonghobae Sep 12, 2026
8fd7e17
test: preserve NewsDOM batch ids across rollback
seonghobae Sep 12, 2026
5e26422
fix: snapshot NewsDOM attachment ids before rollback
seonghobae Sep 12, 2026
1bac3a3
test: isolate Reply SLA owner-load failures
seonghobae Sep 12, 2026
1b3df3b
fix: isolate Reply SLA config refresh failures
seonghobae Sep 12, 2026
a71791b
test: fail closed on corrupt calendar evidence
seonghobae Sep 12, 2026
8268825
fix: fail closed on corrupt calendar evidence
seonghobae Sep 12, 2026
718eba1
fix: use migration context for offline calendar rename
seonghobae Sep 12, 2026
6192911
fix: share Alembic context-safe offline detection
seonghobae Sep 12, 2026
114ea8b
fix: tolerate standalone Alembic migration tests
seonghobae Sep 12, 2026
17545a1
fix: preserve standalone and offline migration modes
seonghobae Sep 12, 2026
78147bd
test(imap): assert workspace forwarding contract
seonghobae Sep 12, 2026
1e14ad8
test(threading): assert workspace query predicate
seonghobae Sep 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/app-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ name: Application CI

on:
pull_request:
branches:
- develop
- master
- "release/**"
push:
branches:
- develop
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches: [ develop, master ]
pull_request:
branches: [ develop, master ]
workflow_dispatch:

permissions:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ name: Dependency Review

on:
pull_request:
branches:
- develop
- master
- "release/**"
workflow_dispatch:

permissions:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ on:
tags:
- "v*"
pull_request:
branches:
- develop
- master
- "release/**"

permissions:
contents: read
Expand Down
588 changes: 588 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions backend/alembic/versions/0001_initial_control_plane.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from sqlalchemy import text

from db.models import Base
from scripts.bootstrap_db import schema_backfill_sql
from scripts.bootstrap_db import execute_schema_backfill

revision = "0001_initial_control_plane"
down_revision = None
Expand All @@ -19,8 +19,7 @@ def upgrade() -> None:
connection = op.get_bind()
connection.execute(text("CREATE EXTENSION IF NOT EXISTS vector"))
Comment thread
seonghobae marked this conversation as resolved.
Base.metadata.create_all(connection)
for statement in schema_backfill_sql():
connection.execute(statement)
execute_schema_backfill(connection)
Comment thread
coderabbitai[bot] marked this conversation as resolved.


def downgrade() -> None:
Expand Down
109 changes: 109 additions & 0 deletions backend/alembic/versions/0018_calendar_conflict_judgments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
"""add calendar conflict judgments and corrections

Revision ID: 0018_calendar_conflict_judgments
Revises: 0017_merge_newsdom_carddav_heads
Create Date: 2026-08-30 00:00:00.000000
"""

from alembic import op
import sqlalchemy as sa

revision = "0018_calendar_conflict_judgments"
down_revision = "0017_merge_newsdom_carddav_heads"

_JUDGMENT_TABLE = "calendar_conflict_judgments"
_CORRECTION_TABLE = "calendar_conflict_corrections"


def upgrade() -> None:
connection = op.get_bind()
inspector = sa.inspect(connection)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

if not inspector.has_table(_JUDGMENT_TABLE):
op.create_table(
Comment thread
seonghobae marked this conversation as resolved.
_JUDGMENT_TABLE,
sa.Column("calendar_conflict_judgment_id", sa.Integer(), nullable=False),
sa.Column("judgment_uid", sa.String(length=96), nullable=False),
sa.Column("user_id", sa.String(), nullable=False),
sa.Column("organization_id", sa.String(), nullable=True),
sa.Column("workspace_id", sa.String(), nullable=False),
sa.Column("proposed_commitment_id", sa.String(length=256), nullable=False),
sa.Column("source_thread_id", sa.String(), nullable=True),
sa.Column("source_message_id", sa.String(), nullable=True),
sa.Column("decision_code", sa.String(length=32), nullable=False),
sa.Column("reason_code", sa.String(length=64), nullable=False),
sa.Column("recommended_action", sa.Text(), nullable=False),
sa.Column("policy_version", sa.String(length=32), nullable=False),
sa.Column("conflicts_json", sa.JSON(), nullable=False),
sa.Column("status_code", sa.String(length=32), nullable=False),
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
sa.Column("updated_at", sa.DateTime(timezone=True), nullable=False),
sa.PrimaryKeyConstraint("calendar_conflict_judgment_id"),
sa.UniqueConstraint(
"judgment_uid", name="uq_calendar_conflict_judgments_uid"
),
)

if not inspector.has_table(_CORRECTION_TABLE):
op.create_table(
_CORRECTION_TABLE,
sa.Column("calendar_conflict_correction_id", sa.Integer(), nullable=False),
sa.Column("correction_uid", sa.String(length=96), nullable=False),
sa.Column("calendar_conflict_judgment_id", sa.Integer(), nullable=False),
sa.Column("user_id", sa.String(), nullable=False),
sa.Column("organization_id", sa.String(), nullable=True),
sa.Column("workspace_id", sa.String(), nullable=False),
sa.Column("actor_user_id", sa.String(), nullable=False),
sa.Column("correction_action", sa.String(length=64), nullable=False),
sa.Column("before_json", sa.JSON(), nullable=False),
sa.Column("after_json", sa.JSON(), nullable=False),
sa.Column("rationale", sa.Text(), nullable=True),
Comment thread
seonghobae marked this conversation as resolved.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
sa.Column("created_at", sa.DateTime(timezone=True), nullable=False),
sa.ForeignKeyConstraint(
["calendar_conflict_judgment_id"],
["calendar_conflict_judgments.calendar_conflict_judgment_id"],
),
sa.PrimaryKeyConstraint("calendar_conflict_correction_id"),
sa.UniqueConstraint(
"correction_uid", name="uq_calendar_conflict_corrections_uid"
),
)

for table_name, indexes in _calendar_conflict_indexes().items():
for index_name, column_names in indexes:
op.create_index(
index_name,
table_name,
column_names,
if_not_exists=True,
)


def downgrade() -> None:
connection = op.get_bind()
inspector = sa.inspect(connection)

for table_name in (_CORRECTION_TABLE, _JUDGMENT_TABLE):
if inspector.has_table(table_name):
for index_name, _column_names in reversed(
_calendar_conflict_indexes()[table_name]
):
op.drop_index(index_name, table_name=table_name, if_exists=True)
op.drop_table(table_name)


def _calendar_conflict_indexes() -> dict[str, list[tuple[str, list[str]]]]:
return {
_JUDGMENT_TABLE: [
(
"ix_calendar_conflict_judgments_scope_thread",
["user_id", "organization_id", "workspace_id", "source_thread_id"],
),
],
_CORRECTION_TABLE: [
(
"ix_calendar_conflict_corrections_judgment",
["calendar_conflict_judgment_id"],
),
],
}
97 changes: 97 additions & 0 deletions backend/alembic/versions/0019_attachment_uid.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
"""add attachment_uid opaque id to email_attachments

Revision ID: 0019_attachment_uid
Revises: 0018_calendar_conflict_judgments
Create Date: 2026-08-30 00:00:00.000000
"""

import uuid

from alembic import op
import sqlalchemy as sa

revision = "0019_attachment_uid"
down_revision = "0018_calendar_conflict_judgments"

_ATTACHMENT_TABLE = "email_attachments"
_ATTACHMENT_UID_INDEX = "uq_email_attachments_uid"


def _attachment_table_stub() -> sa.TableClause:
return sa.table(
_ATTACHMENT_TABLE,
sa.column("id", sa.Integer()),
sa.column("attachment_uid", sa.String()),
)


def upgrade() -> None:
connection = op.get_bind()
inspector = sa.inspect(connection)
if not inspector.has_table(_ATTACHMENT_TABLE):
return

existing_columns = {
column["name"] for column in inspector.get_columns(_ATTACHMENT_TABLE)
}
if "attachment_uid" not in existing_columns:
op.add_column(
_ATTACHMENT_TABLE,
sa.Column("attachment_uid", sa.String(length=96), nullable=True),
)
attachments = _attachment_table_stub()
rows = connection.execute(
sa.select(attachments.c.id).where(attachments.c.attachment_uid.is_(None))
).fetchall()
for (attachment_id,) in rows:
connection.execute(
sa.update(attachments)
.where(attachments.c.id == attachment_id)
.values(attachment_uid=f"attachment_{uuid.uuid4().hex}")
)
op.alter_column(_ATTACHMENT_TABLE, "attachment_uid", nullable=False)

existing_indexes = {
index["name"] for index in inspector.get_indexes(_ATTACHMENT_TABLE)
}
if _ATTACHMENT_UID_INDEX not in existing_indexes:
op.create_index(
_ATTACHMENT_UID_INDEX,
_ATTACHMENT_TABLE,
["attachment_uid"],
unique=True,
if_not_exists=True,
)
Comment thread
seonghobae marked this conversation as resolved.


def downgrade() -> None:
connection = op.get_bind()
inspector = sa.inspect(connection)
if not inspector.has_table(_ATTACHMENT_TABLE):
return

# A database built by alembic upgrade carries _ATTACHMENT_UID_INDEX as a
# plain unique index (this file's own upgrade() uses op.create_index), but
# one bootstrapped fresh via Base.metadata.create_all() (db/models.py's
# Attachment declares the same name as a table-level UniqueConstraint)
# carries a constraint-owned index of the identical name instead --
# PostgreSQL rejects a bare DROP INDEX on that shape ("cannot drop index
# ... because constraint ... requires it"), so the two shapes need
# different drop statements rather than one op.drop_index() for both.
unique_constraint_names = {
constraint["name"]
for constraint in inspector.get_unique_constraints(_ATTACHMENT_TABLE)
}
if _ATTACHMENT_UID_INDEX in unique_constraint_names:
op.drop_constraint(
_ATTACHMENT_UID_INDEX, _ATTACHMENT_TABLE, type_="unique"
)
else:
op.drop_index(
_ATTACHMENT_UID_INDEX, table_name=_ATTACHMENT_TABLE, if_exists=True
)
existing_columns = {
column["name"] for column in inspector.get_columns(_ATTACHMENT_TABLE)
}
if "attachment_uid" in existing_columns:
op.drop_column(_ATTACHMENT_TABLE, "attachment_uid")
Loading
Loading