Feat/v0.13.0 (#270)

* feat(release): add release-manager feature flag (default off)

* feat(release): change classification + semver-bump derivation

* feat(release): readiness audit (changelog/version-ref/docs/migration/gate)

* feat(release): release-manager engine proposes a gated release

* feat(release): fail-closed release executor (bump, gate, publish)

* feat(release): CEO approve/reject release-proposal surface

* docs(release): document the gated release manager

* feat(memory): add org-memory feature flags (default off)

* feat(memory): add playbooks table + status enum + migration

* feat(memory): playbook service with auditor curation transitions

* feat(memory): playbooks RAG index plugin

* feat(memory): index a playbook into RAG on approval

* feat(memory): distill a high-signal lesson at task completion

* feat(memory): keep private journal reflections out of the shared RAG corpus

* feat(memory): draft_playbook verb + auditor curation verbs

* fix(ci): resolve mypy tests/ errors blocking the gate (UUID casts, annotations)

* feat(memory): auto-inject similar lessons/playbooks into the briefing

* feat(memory): auditor playbook review queue (api + panel)

* docs(memory): document the org-memory loop + playbook verbs

* fix(provisioning): idempotent pitch provisioning (reuse product/project by slug on re-approval)

* fix(memory): add chunks_playbooks to the chunk schema + isolate release route tests

- Migration 030's CHUNK_TABLES was missing chunks_playbooks, breaking the
  IndexType<->migration parity guard once the PLAYBOOKS index landed. The
  upgrade is ALTER ... IF EXISTS so adding it is safe on any DB shape.
- The release-route fixture's approve/reject paths call db.commit() (real
  behavior), so a held proposal outlived the per-test rollback and leaked
  into engine tests that read the global list_open_release_proposals().
  Tear down source=release_manager rows after each test.
- Make the gather_snapshot real-repo smoke version-agnostic (semver match)
  so it stops pinning the literal repo version.

* chore(release): 0.13.0

* ++

---------

Co-authored-by: Renn F <rennf93@users.noreply.github.com>
This commit is contained in:
Renzo F
2026-06-26 01:43:08 +02:00
committed by GitHub
co-authored by Renn F
parent 153723406e
commit 5612375cba
87 changed files with 5032 additions and 91 deletions
+51
View File
@@ -76,12 +76,17 @@ def _patch_topology(monkeypatch: pytest.MonkeyPatch) -> dict[str, MagicMock]:
proj.id = uuid4()
project_svc = MagicMock()
project_svc.create = AsyncMock(return_value=proj)
# Default: nothing pre-exists, so provisioning takes the create path. The
# idempotency tests override these to return an existing row.
project_svc.get_by_slug = AsyncMock(return_value=None)
monkeypatch.setattr(pitch_module, "get_project_service", lambda _s: project_svc)
prod = MagicMock()
prod.id = uuid4()
product_svc = MagicMock()
product_svc.create = AsyncMock(return_value=prod)
product_svc.get_by_slug = AsyncMock(return_value=None)
product_svc.update = AsyncMock(return_value=prod)
monkeypatch.setattr(pitch_module, "get_product_service", lambda _s: product_svc)
task = MagicMock()
@@ -215,3 +220,49 @@ async def test_approve_blocked_when_provisioning_disabled(
await svc.approve(
uuid4(), "x", uuid4(), provisioning=_FakeProvisioning(enabled=False)
)
@pytest.mark.asyncio
async def test_approve_reuses_existing_project(
monkeypatch: pytest.MonkeyPatch,
) -> None:
"""Re-approval after a partial provision reuses a committed Project by slug —
no repo re-create, no slug collision (idempotent provisioning)."""
svcs = _patch_topology(monkeypatch)
existing = MagicMock()
existing.id = uuid4()
svcs["project"].get_by_slug = AsyncMock(return_value=existing)
svc = PitchService(_session())
monkeypatch.setattr(
svc, "get", AsyncMock(return_value=_pitch(target_cells=["backend"]))
)
prov = _FakeProvisioning()
await svc.approve(
uuid4(), "ship it, aligned with the charter", uuid4(), provisioning=prov
)
assert prov.created == [] # repo NOT re-created
svcs["project"].create.assert_not_awaited() # Project reused, not re-created
@pytest.mark.asyncio
async def test_approve_reuses_existing_product(
monkeypatch: pytest.MonkeyPatch,
) -> None:
"""Multi-cell re-approval reuses the committed Product and refreshes its cell
map (no uq_product_projects_product_team collision)."""
svcs = _patch_topology(monkeypatch)
existing = MagicMock()
existing.id = uuid4()
svcs["product"].get_by_slug = AsyncMock(return_value=existing)
svc = PitchService(_session())
monkeypatch.setattr(
svc, "get", AsyncMock(return_value=_pitch(target_cells=["backend", "frontend"]))
)
await svc.approve(
uuid4(),
"ship it, aligned with the charter",
uuid4(),
provisioning=_FakeProvisioning(),
)
svcs["product"].update.assert_awaited_once() # reused + cell map refreshed
svcs["product"].create.assert_not_awaited() # NOT re-created