Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
ad07bcd
test: specify deterministic policy JSON export
seonghobae Sep 8, 2026
d82485a
test: require browser JSON download
seonghobae Sep 8, 2026
e834aa7
test: prevent credential URL export
seonghobae Sep 8, 2026
553c1a6
test: keep export cases independently runnable
seonghobae Sep 8, 2026
856958a
feat: project deterministic policy draft export
seonghobae Sep 8, 2026
d883d16
feat: download policy draft JSON locally
seonghobae Sep 8, 2026
384c337
test: type the exported Blob mock argument
seonghobae Sep 8, 2026
2a4249c
docs: define local draft export boundary
seonghobae Sep 8, 2026
e386140
test: expose export portability edge cases
seonghobae Sep 8, 2026
eaf18cb
fix: preserve portable export semantics
seonghobae Sep 8, 2026
b72ce67
docs: record export review repairs
seonghobae Sep 8, 2026
0f1a608
test: expose export data and mock leaks
seonghobae Sep 8, 2026
5c803b1
fix(export): strip query credentials from service URL
seonghobae Sep 8, 2026
90a3d68
test(export): restore browser URL spies
seonghobae Sep 8, 2026
2833391
docs: record export disclosure controls
seonghobae Sep 8, 2026
0e9a349
test(export): reject UI status sentinels in schema types
seonghobae Sep 8, 2026
f3f0f9e
fix(export): narrow portable status schema types
seonghobae Sep 8, 2026
7be6d36
test: verify policy draft browser download
seonghobae Sep 8, 2026
35b9fbd
docs: record browser download evidence
seonghobae Sep 8, 2026
b731c01
docs: preserve non-recursive evidence wording
seonghobae Sep 8, 2026
798f2c4
test: cover JSON export interactions
seonghobae Sep 8, 2026
b9507d9
docs: record JSON export interaction evidence
seonghobae Sep 8, 2026
4d57f60
test: bind revoked URLs to created downloads
seonghobae Sep 8, 2026
bc4c7f1
test: specify download activation failure recovery
seonghobae Sep 8, 2026
d8117e2
fix: report local export activation failures
seonghobae Sep 8, 2026
f7c3ee2
docs: record export activation failure recovery
seonghobae Sep 8, 2026
01ab876
test: fail closed on lossy service URL export
seonghobae Sep 8, 2026
3f16e06
fix: reject lossy service URL export
seonghobae Sep 8, 2026
c2f4887
test: preserve service URL destination semantics
seonghobae Sep 8, 2026
71ef187
docs: align service URL authority contract
seonghobae Sep 8, 2026
170a658
test: preserve complete service URL rejection matrix
seonghobae Sep 8, 2026
bc539d7
docs: preserve service URL rejection lineage
seonghobae Sep 8, 2026
0580f46
test: reject empty service URL delimiters
seonghobae Sep 8, 2026
9d92a9e
fix: reject empty service URL delimiters
seonghobae Sep 8, 2026
6032102
docs: record empty URL delimiter repair evidence
seonghobae Sep 8, 2026
a6cf635
test: preserve encoded service URL path data
seonghobae Sep 8, 2026
a7cac94
docs: bind encoded URL path regression
seonghobae Sep 8, 2026
83f189e
test: expose pre-activation export failure
seonghobae Sep 8, 2026
8d637f9
fix: contain export preparation failures
seonghobae Sep 8, 2026
751e3d5
docs: record export preparation recovery
seonghobae Sep 8, 2026
6529617
docs: define export preparation failure boundary
seonghobae Sep 8, 2026
fd44c84
docs: align export error contract
seonghobae Sep 8, 2026
9edb24f
docs: bind export preparation RED and GREEN
seonghobae Sep 8, 2026
becfd95
docs: document authoring helper invariants
seonghobae Sep 8, 2026
4c74e5d
docs: document policy helper contracts
seonghobae Sep 8, 2026
cef8c0b
merge: restack export stack on full writer-stack tip
seonghobae Sep 9, 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
2 changes: 1 addition & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Core invariants:
11. External legal-source updates produce explicit re-evaluation, not silent rewriting.

## Current implementation
The active MVP is a React/Vite browser workspace. State is in memory and there is no production persistence or publication backend. The seven PRD steps are routed to distinct editing surfaces. The collection taxonomy is metadata only. `src/policy.ts` owns deterministic collection-selection/no-collection/mode/purpose/path and non-collection authoring-completeness findings; `src/App.tsx` owns browser orchestration, explicit no-collection and transfer-status capture, warning-to-source navigation, stale dependent-fact invalidation, and deterministic preview rendering. `src/AuthoringFocusController.tsx` is a browser interaction adapter: after explicit rail, previous/next, or review-warning navigation changes the active editing surface, it moves programmatic focus to that surface's heading without changing domain state, intercepting ordinary field interaction, or overriding the separate preview-focus shortcut.
The active MVP is a React/Vite browser workspace. State is in memory and there is no production persistence or publication backend. The browser can download a deterministic versioned JSON draft containing normalized operator-authored facts and readiness finding codes; this local portability projection is not publication, persistence, or legal approval. The seven PRD steps are routed to distinct editing surfaces. The collection taxonomy is metadata only. `src/policy.ts` owns deterministic collection-selection/no-collection/mode/purpose/path and non-collection authoring-completeness findings; `src/App.tsx` owns browser orchestration, explicit no-collection and transfer-status capture, warning-to-source navigation, stale dependent-fact invalidation, and deterministic preview rendering. `src/AuthoringFocusController.tsx` is a browser interaction adapter: after explicit rail, previous/next, or review-warning navigation changes the active editing surface, it moves programmatic focus to that surface's heading without changing domain state, intercepting ordinary field interaction, or overriding the separate preview-focus shortcut.

Authoring completeness is deliberately separate from legal sufficiency. Current readiness rules prove that product-defined fact responsibilities were explicitly addressed; they do not assert that a policy complies with law. Source/effective-date-bound legal validation belongs to the Legal Source Registry -> Review & Publication boundary.

Expand Down
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable product changes are recorded here. PolicyWeave is pre-release; entri
## Unreleased

### Added
- Deterministic local JSON draft export with a versioned `snake_case` contract, normalized operator-authored facts, explicit incomplete/review-ready state, readiness finding codes, and fail-closed rejection of service URLs containing credentials, query, or fragment components. Unresolved collection mode is serialized as `null`, not the UI empty-string sentinel, and object-URL cleanup is deferred until after download navigation starts. The browser download performs no network transfer and does not claim publication.
- PostgreSQL restart and custom-format dump/restore evidence that preserves NULL-safe complete service/collection-item values, a collecting-without-retention cross-state fixture, and independent no-collection and applies-retention facts, then re-executes no-collection plus both retention-status/rule contradictions against the restored database.
- PostgreSQL two-session concurrency evidence that observes real lock waits, rejects a collection-item writer racing with a no-collection update, and proves competing same-item UPSERTs converge to one row carrying the second writer's label, mode, and path with NULL-safe complete-value assertions and without timing-based transaction sleeps.
- PostgreSQL 18 runtime contract coverage for migration apply/down/apply cycles, item-key UPSERT idempotency, and deferred rejection of no-collection, missing-retention-rule, and revision-owner contradictions. The database remains CI-only and is not a hosted product backend.
Expand All @@ -16,7 +17,7 @@ All notable product changes are recorded here. PolicyWeave is pre-release; entri
- Explicit unresolved/yes/no states for third-party provision and international transfer, with dependent detail capture only for confirmed `yes` cases.
- Regression coverage for all seven step routes, zero-inferred startup facts, first-responsibility startup state, explicit no-collection state and stale-item invalidation, independent retention authority and stale-period invalidation, collection-mode/path confirmation, seven-step readiness, explicit no-transfer attestations, transfer-dependent fact invalidation, whitespace normalization, service URL projection, warning navigation, collection-path/purpose separation, stale collection evidence invalidation, buyer-facing publication guidance, non-deceptive handling of unshipped affordances, authored focus-indicator contrast, and authoring-step focus transfer.
- Product/technical gap ledger, architecture, technical requirements, security baseline, and legal-source/accessibility traceability.
- Playwright/axe browser evidence harness covering desktop, tablet, and mobile rendering; horizontal overflow; keyboard activation and focus transfer; explicit no-collection progression; retention-status transitions and stale-period invalidation; effective 200% browser-zoom reflow from the desktop profile; serious/critical automated accessibility findings; and exact-head screenshot artifacts.
- Playwright/axe browser evidence harness covering desktop, tablet, and mobile rendering; horizontal overflow; keyboard activation and focus transfer; explicit no-collection progression; retention-status transitions and stale-period invalidation; effective 200% browser-zoom reflow from the desktop profile; serious/critical automated accessibility findings; real-browser JSON download events with mouse, keyboard, and touch activation; fixed filename; JSON MIME; byte-stable repeated exports; review-ready payload semantics; success and preparation/activation-error object-URL cleanup; and exact-head screenshot artifacts.

### Changed
- PostgreSQL negative-path evidence now matches each expected domain error message, so an unrelated SQL or connection failure cannot masquerade as a passing invariant check.
Expand All @@ -36,6 +37,7 @@ All notable product changes are recorded here. PolicyWeave is pre-release; entri
- Public-readiness includes product-defined service name/URL, explicit retention status and any required period, transfer-status/detail, and privacy-contact completeness.
- Service URL and privacy-contact email are shape-validated as usability contracts without claiming endpoint reachability or mailbox ownership.
- Credential-bearing service URLs are rejected and withheld from the review projection so embedded usernames or passwords cannot leak into a generated draft.
- Query- or fragment-bearing service URLs are rejected consistently by readiness, preview, and export so a source fact cannot be silently rewritten to a different destination.
- Blank transfer state is no longer treated as an implicit `none`; explicit `없음` confirmation is required, while `있음` requires dependent recipient/purpose or country/recipient facts.
- Changing a transfer status away from `있음` clears its dependent details so stale customer facts cannot silently revive.
- Disabling a collection item clears its collection mode, processing purpose, and collection-path evidence so re-enabling cannot silently revive stale customer facts.
Expand All @@ -45,7 +47,7 @@ All notable product changes are recorded here. PolicyWeave is pre-release; entri
- Step-rail, previous/next, and review-warning navigation now transfers programmatic focus to the newly active step heading; ordinary form controls and the dedicated preview shortcut are excluded from that transfer.
- Review-warning navigation now lets the browser scroll the focused owner heading into view; the previous `preventScroll` option could leave that heading hundreds of pixels above the desktop or mobile viewport.
- The publication-area CTA describes a readiness check and directs the operator to responsible review rather than exposing internal implementation boundaries.
- Unshipped JSON export is visibly disabled as `준비 중`, the redundant no-op `검토본 생성` control was removed, and the document title is non-interactive status text.
- JSON export now downloads the current structured draft locally, contains download preparation and activation exceptions, reports a retry action through the existing live status output, and revokes the temporary object URL whenever allocation succeeded; the redundant no-op `검토본 생성` control remains removed, and the document title remains non-interactive status text.
- Authored generic and custom-checkbox keyboard focus outlines now use the high-contrast `--green` token; a CSS regression test computes and enforces at least 3:1 contrast against white instead of relying on a low-contrast focus color.
- Responsive review behavior and mobile publication feedback were repaired during PR review.
- Responsive CSS contract tests use literal media-query regular expressions, removing the Semgrep dynamic-RegExp finding without suppressing or weakening the scanner gate.
Expand All @@ -58,3 +60,4 @@ All notable product changes are recorded here. PolicyWeave is pre-release; entri
- A product persistence adapter, durable hosted storage, tenant authorization, immutable audit history, encryption, operational backup/restore, and production-scale contention evidence. Bounded CI database execution, including process restart and dump/restore, does not constitute a hosted runtime.
- Authenticated immutable publication revisions and public URL lifecycle.
- Hosted tenant/security/operability evidence and endpoint load testing.
- Versioned DB-backed ko/en/ja/zh/vi/es/de/fr translation resources and localized export acceptance evidence.
3 changes: 2 additions & 1 deletion docs/PRD.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ PolicyWeave는 법률 문장을 임의로 창작하는 도구가 아니다. 운
- 제3자 제공과 국외 이전의 명시적 `있음`/`없음` 확인; `있음`일 때만 종속 상세 사실 요구
- 공개 전 검토 요약과 버전 정보
- 정적 공개 URL 발행 계약(후속 백엔드에서 구현)
- JSON 내보내기 가능한 정책 데이터 모델
- 버전이 명시된 JSON으로 현재 정책 사실과 검토 상태를 로컬 내보내기

## 비목표

Expand All @@ -45,5 +45,6 @@ PolicyWeave는 법률 문장을 임의로 창작하는 도구가 아니다. 운
- 제3자 제공 또는 국외 이전을 `있음`으로 확인한 경우 해당 수령자/목적 또는 국가/수령자 사실까지 확인되어야 한다.
- `없음` 확인은 명시적 운영자 사실이며, 이전에 입력한 종속 제공·이전 상세 사실은 상태 변경 시 폐기된다.
- 모든 경고는 해당 입력 단계로 이동할 수 있다.
- JSON 내보내기는 확인되지 않은 값을 임의 사실로 채우지 않고, 자격정보가 포함된 잘못된 서비스 URL을 파일에 기록하지 않으며, 네트워크 전송 없이 현재 작성 사실과 검토 상태를 재현한다.
- 모바일에서도 작성과 미리보기를 전환할 수 있다.
- 키보드만으로 모든 입력과 주요 동작을 수행할 수 있다.
6 changes: 5 additions & 1 deletion docs/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ Protected assets include policy facts, contact details, processing descriptions,
6. Validate and encode user-entered content at output boundaries; do not treat imported HTML/Markdown/source material as executable instructions.
7. Define backup/restore, incident response, access review, retention/deletion, and evidence collection before claiming SOC 2 readiness. Map hosted controls toward CSAP and SOC 2 without describing an unassessed product as certified.
8. Tests/docs use fictionalized organizations and people; real personal/institutional names are not fixtures.
9. Credential-bearing service URLs are invalid and are withheld from the review projection; operators must provide a credential-free HTTP(S) location.
9. Service URLs containing credentials, query, or fragment components are invalid and withheld from the review projection; operators must provide a credential-free HTTP(S) location whose destination can be exported without lossy rewriting.

## Verification
Security posture is head-specific. A successful predecessor scan, unresolved finding dismissal, or queued security workflow is not passing evidence. Merge/release decisions must reacquire the exact current head's organization-required security/SAST/review checks.


## Local JSON export
The export path serializes only the current in-memory PolicyWeave draft and deterministic readiness codes into a browser Blob. It makes no network request, uses a fixed filename rather than customer-controlled path text, and defers object-URL revocation until the next task after initiating the download so browsers with deferred navigation can consume the Blob. If local download preparation or activation throws, the exception is contained and the existing live status output directs the operator to retry. A temporary object URL is revoked exactly when allocation succeeded; preparation failure before allocation has no fabricated cleanup target. A service URL containing username, password, query, or fragment components is omitted from the file and remains represented by the `service_url_format` finding. The same shared validator withholds it from preview and readiness, preventing token disclosure and destination-changing rewrites. The file is still customer-controlled sensitive data; operators remain responsible for its storage and transfer. This control is not encryption, persistence, publication, backup, authorization, or mid-transfer cancellation evidence.
Loading