offplan · online
Plan · stage1

Stage 1 — Wave 2 Chunk 8: ADR placeholders + 0005 v3 + callout cleanup

Approvedplanstage1priority P0
Ratified
2026-05-09
Created
2026-05-09
Priority
P0
Tags
architecture, ops, billing, security

Goal

Закрыть Wave 2 — последний chunk after 7 завершённых. Кодифицировать 5 архитектурных решений как ADR файлы (две Full spec из ratified Foundational, один Skeleton с structural anchor + open numbers, два Shell для pending tech estimate), добавить v3 ревизию к 0005 (Microsoft + Custom SSO scope для Tier 3 Stage 2), почистить ~15 stale «pending ADR» pointer'ов в плане. После Chunk 8 — переход на 4 sub-plan ratifications (permission-and-tenancy-model / onboarding-trial-mode / legal-multi-party-framework / buyer-profile-and-presentation).

Success Criteria

См. frontmatter success_criteria. Дублируем для clarity:

Plan ratified когда: (a) созданы 5 ADR файлов (0008 Skeleton + 0009 Full + 0010 Full + 0011 Shell + 0012 Shell) с per-ADR depth pattern из Locked Decision L2; (b) revised 0005 с v3 секцией (Microsoft + Custom SSO scope как Stage 2 Tier 3 features); (c) launch-plan-stage-1.html имеет 3 broken-pointer fixes на 0005 + ~12-15 «pending» callouts/task-deps → live links на новые ADRs; (d) launch-plan-changelog.html получает v4.14 entry; (e) preview repo синкнут + push; (f) workstreams/stage1-roman-integration.md обновлён: Wave 2 closed → 4 sub-plan ratifications next.

Без: правок в sub-plan stub файлах; правок Foundational/Phase deferral text content (только link targets обновляются); final pricing numbers в 0008 (defers to sub-plan).

Locked Decisions (CONV-31 interview)

# Тема Решение
L1 Scope для 0005 update Variant B — Microsoft + Custom SSO scope для Tier 3 Stage 2. Старая формулировка «Google + email/password» уже сделана 2026-05-07 (CONV-17 revision). Реальный pending update per line 753 plan'а = добавить Microsoft (Azure AD) + Custom SSO (SAML/OIDC через Okta/Entra ID) как Tier 3 Enterprise features в Stage 2.
L2 Per-ADR depth pattern Per-ADR judgment на основе «насколько decision уже ratified в Foundational/Phase»: 0008 = Skeleton (~50 строк, 4-tier структура зафиксирована, numbers/naming defer to sub-plan); 0009 = Full spec (~80-100 строк, ratified Foundational §1+§2+§4 консолидируется); 0010 = Full spec (~60-70 строк, Closed pool default + S·1 ratified в §4.4+§4.5); 0011 = Shell (~30 строк, decision не сформировано); 0012 = Shell (~30 строк, pending Илья tech estimate).
L3 ADR 0012 scope Variant (i) — narrow scope (только Buyer Remote Presentation). Use-case B (unit status sync между SAs) НЕ включается в 0012; resolve в Phase 1.10 implementation как simple polling, без отдельного ADR. Phase 1.11.6-8 риски Stage-2 deferral — поэтому over-investment в общую Real-time Platform не оправдан.
L4 ADR 0012 content depth 4 архитектуры расписаны для discussion с Ильёй + командой: Polling / SSE / WebSocket / Managed (Pusher/Ably/Supabase Realtime). Trade-off table: build simplicity / ops cost / latency / pricing. Decision criteria: latency budget, ops complexity, scale. Ratified architecture pending — это shell, не Skeleton.
L5 0005 revision mechanism In-place revision в существующем файле docs/decisions/0005-sso-google-only.md. Add «Revision 2 (2026-05-09, CONV-31)» note секцию перед Context, update revised: field, extend «Decision» с Stage 2 Tier 3 SSO scope subsection, добавить Microsoft/Custom SSO в Alternatives Considered как resolved-now (vs resolved-later). НЕ создавать новый ADR; не override старую revision note (preserve history).
L6 Plan callout cleanup scope 3 типа правок: Type A (3 broken pointers на 0005 — lines 753 / 1388 / 1531 + 2 changelog entries) → формулировка «0005 v3 (Microsoft + Custom SSO scope для Tier 3)»; Type B (~12-15 pending pointer/task-deps → live links на новые ADR файлы) — найти grep'ом все <a href="../decisions/"> placeholder ссылки + текстовые «ADR 0008 (pending)» pointer'ы и обновить; Type C (deferral text content) — НЕ трогаем, только link targets.
L7 Approach (sequencing + commit granularity) Approach B — Draft-all + single ratification. Все 5 ADRs + 0005 v3 пишутся в один заход с internal cross-references; user ratify полным batch'ем; 3 commits: (1) ADRs batch, (2) plan callout cleanup, (3) changelog + preview sync + workstream update. 1 ratification touch-point.
L8 Order of writing (внутри batch) 0009 → 0010 → 0008 → 0005 v3 → 0011 → 0012 — dependency order: 0009 (entities, scoping) — anchor for everything; 0010 (stock) — refs 0009 entities; 0008 (tier) — refs 0009 Org type; 0005 v3 (Tier 3 SSO) — refs 0008 tier scoping; 0011 (email shell) — refs 0008 Tier 2 DKIM; 0012 (real-time shell) — standalone. Cross-refs ratified atomically в одном batch'е.
L9 Workstream структура No new workstream file — Chunk 8 расширяет existing workstreams/stage1-roman-integration.md (parent). Pattern matches Chunk 7 + Chunk 7.5: per-chunk plan file, shared parent workstream. После Chunk 8 — Wave 2 closed, parent workstream pivot'ит What's Next на 4 sub-plan ratifications.
L10 Stale Learnings handling Не fix'им в Chunk 8 — фиксируем в Risks. Two Learnings stale: L «S·1 (Shared default + Single)» (CONV-16) — captured pre-CONV-18 «Closed pool default» reshape; L «Multi-level access: 5-tier model» (CONV-7) — superseded by Org-based RBAC. ADRs используют ratified version (Closed default + Org-based); stale Learnings будут обновлены в /handoff learning entry после Chunk 8 ratification.
L11 Step 4.4 (Business review) Skip — pure plan-document refactor (ADR consolidation of already-ratified decisions). Underlying decisions прошли prior ratification cycles (Foundational §1-§5, Phase 1.3-1.11 deep rewrites в Chunks 4-7). Chunk 8 не вводит новых user-facing changes — кодифицирует existing decisions. Business surface уже review'нут при оригинальной ratification.
L12 Step 4.5 (Ratification sweep) Run — query Notion Learnings DB по новым keywords (DKIM / SAML / OIDC / Pusher / WebSocket / Postmark / SES / Closed pool) до finalisation. Если новые relevant Learnings surface — добавить в Risks → From Learnings DB.

Approach

Approach B — Draft-all + single ratification. Из 3 предложенных в Step 3:

Diff scope:

Implementation Steps

Stage A — Draft 5 ADRs + 0005 v3 (single commit)

A1. Write docs/decisions/0009-tenancy-permission.md (Full spec, ~80-100 строк).

A2. Write docs/decisions/0010-stock-allocation.md (Full spec, ~60-70 строк).

A3. Write docs/decisions/0008-tier-model.md (Skeleton, ~50 строк).

A4. Edit docs/decisions/0005-sso-google-only.md — add v3 revision.

A5. Write docs/decisions/0011-email-sender.md (Shell, ~30 строк).

A6. Write docs/decisions/0012-realtime-sync.md (Shell, ~30 строк).

A7. Present batch (6 files) для user review per Approach B. Wait for ratification.

A8. Stage commit on ratification:

git add docs/decisions/0008-*.md docs/decisions/0009-*.md docs/decisions/0010-*.md docs/decisions/0011-*.md docs/decisions/0012-*.md docs/decisions/0005-sso-google-only.md
git commit -m "decisions: 5 new ADRs (0008-0012) + 0005 v3 (Microsoft + Custom SSO scope) — Wave 2 Chunk 8 ADR layer"

Stage B — Plan callout cleanup (single commit)

B1. Type A fixes (3 broken pointers на 0005 в launch-plan-stage-1.html):

B2. Type B fixes (~12-15 pending pointer/task-deps → live links). Sweep grep'ом всех <a href="../decisions/"> placeholder + «(pending)» / «pending Chunk 8» / «Will be written в Chunk 8» строк, обновить:

B3. Verify через grep что никакие <a href="../decisions/"> пустые ссылки не остались + текстовые «ADR 000X (pending)» / «Will be written в Chunk 8» паттерны зачищены.

B4. Stage commit:

git add docs/rendered/launch-plan-stage-1.html
git commit -m "docs: Phase callout pointer fixes — 0005 v3 + ~15 live links to new ADRs (Wave 2 Chunk 8 cleanup)"

Stage C — Changelog + preview sync + workstream update (final commit)

C1. Add v4.14 entry в docs/rendered/launch-plan-changelog.html с full breakdown:

C2. Update changelog lines 334 + 434:

C3. Sync to preview repo:

cp docs/rendered/launch-plan-stage-1.html ~/code/offplan-online/preview/plan/launch-plan-stage-1.html
cp docs/rendered/launch-plan-changelog.html ~/code/offplan-online/preview/plan/launch-plan-changelog.html
cd ~/code/offplan-online/preview && git add plan/ && git commit -m "sync: Wave 2 Chunk 8 closed — 5 ADRs + 0005 v3 + plan cleanup" && git push
cd ~/code/offplan-online/os

C4. Update workstreams/stage1-roman-integration.md:

C5. Stage commit:

git add docs/rendered/launch-plan-changelog.html workstreams/stage1-roman-integration.md plans/stage1-chunk-8-adr-placeholders.md
git commit -m "handoff: Wave 2 Chunk 8 closed — changelog v4.14 + workstream pivot to 4 sub-plan ratifications"
git push origin main

Files to Create/Modify

File Type Change
docs/decisions/0008-tier-model.md NEW Skeleton ~50 строк (4-tier + admin mode coupling, numbers/naming defer)
docs/decisions/0009-tenancy-permission.md NEW Full spec ~80-100 строк (entity model + 5 roles + auth-scoped views + cross-entity invitations)
docs/decisions/0010-stock-allocation.md NEW Full spec ~60-70 строк (Closed pool default + S·1 + locking + 3 sub-rules)
docs/decisions/0011-email-sender.md NEW Shell ~30 строк (3 architectures + criteria, pending Phase 1.8)
docs/decisions/0012-realtime-sync.md NEW Shell ~30 строк (4 architectures detailed + criteria, pending Илья estimate)
docs/decisions/0005-sso-google-only.md EDIT Add «Revision 3 (2026-05-09)» — Microsoft + Custom SSO Stage 2 Tier 3 scope
docs/rendered/launch-plan-stage-1.html EDIT Type A: 3 broken-pointer fixes на 0005; Type B: ~12-15 pending → live links на новые ADRs
docs/rendered/launch-plan-changelog.html EDIT Add v4.14 entry; update lines 334 + 434 (move Chunk 8 candidates → historical)
~/code/offplan-online/preview/plan/launch-plan-stage-1.html SYNC Copy from os/
~/code/offplan-online/preview/plan/launch-plan-changelog.html SYNC Copy from os/
workstreams/stage1-roman-integration.md EDIT Session Log CONV-31 entry; What's Next pivot to 4 sub-plan ratifications; last_session bump
plans/stage1-chunk-8-adr-placeholders.md NEW This file (ratified plan)

НЕ трогаем:

Dependencies

Testing & Verification

После Stage A (ADRs batch):

  1. wc -l docs/decisions/0008-*.md docs/decisions/0009-*.md docs/decisions/0010-*.md docs/decisions/0011-*.md docs/decisions/0012-*.md — ожидаемо ~50/~80-100/~60-70/~30/~30 строк.
  2. head -10 на каждом — frontmatter format consistency (id / title / status / date поля).
  3. head -15 docs/decisions/0005-sso-google-only.md — verify revised: 2026-05-09, original CONV-17 note preserved как «Revision 2».
  4. Manual user review per Approach B — все 6 файлов в одном passe.

После Stage B (callout cleanup):

  1. grep -n '<a href="../decisions/">[^<]*</a>' docs/rendered/launch-plan-stage-1.html | wc -l — должно вернуть 0 (все placeholder ссылки заменены).
  2. grep -n "ADR 0008\|ADR 0009\|ADR 0010\|ADR 0011\|ADR 0012\|ADR 0005" docs/rendered/launch-plan-stage-1.html | grep -v "decisions/00\|0009-\|0010-\|0011-\|0012-\|0008-\|0005-" — должно вернуть 0 (нет неживых ADR mentions).
  3. grep -n "(pending)\|Will be written в Chunk 8\|placeholder, write в Chunk 8\|вторая ревизия pending" docs/rendered/launch-plan-stage-1.html — должно вернуть 0.

После Stage C (changelog + sync + workstream):

  1. Open docs/rendered/launch-plan-changelog.html → verify v4.14 entry visible at top + lines 334/434 updated.
  2. diff docs/rendered/launch-plan-stage-1.html ~/code/offplan-online/preview/plan/launch-plan-stage-1.html — должно быть пусто.
  3. cd ~/code/offplan-online/preview && git log -1 — verify push успешен.
  4. head -25 workstreams/stage1-roman-integration.md — verify last_session: CONV-31, What's Next mention'ит 4 sub-plan ratifications.

Workstreams

Name Priority Depends On Tags Tasks
stage1-roman-integration (existing parent) P0 architecture, ux, domain, security All Stage A + B + C steps; Wave 2 Chunk 8 closes Wave 2

Important: No new workstream file. Chunk 8 расширяет existing workstreams/stage1-roman-integration.md (parent workstream), matching pattern Chunk 7 + Chunk 7.5. Single workstream row отражает что весь Chunk 8 — sub-unit под parent.

Risks & Edge Cases

Technical risks

Scope risks

From Learnings DB

From ratification sweep (Step 4.5 surfaced)

Evaluation

Field Description
Artefact 5 new ADR files + 1 revised ADR + updated stage-1.html + updated changelog + synced preview + updated workstream + this plan file
2-min check (a) ls docs/decisions/ shows 0008-0012 + 0005; (b) grep "Revision 3" docs/decisions/0005-*.md matches; (c) grep "v4.14" docs/rendered/launch-plan-changelog.html matches; (d) git log -3 shows 3 expected commits; (e) head -5 workstreams/stage1-roman-integration.md shows last_session: CONV-31
Agent self-check Run all 3 Testing & Verification sections per stage; verify zero placeholder <a href="../decisions/"> left; verify cross-refs между ADRs consistent (grep ADR mentions in each file); confirm preview repo HEAD sync to os/ HEAD via diff