Uh oh!
There was an error while loading. Please reload this page.
feat(projects): project unified guide compilation outputs - #357
feat(projects): project unified guide compilation outputs#357durutheguru wants to merge 24 commits into
Conversation
Description: Documents changes across .agent-loop; notable files: .agent-loop/initiatives/WS-POL-003-unified-project-guide-compilation/chunks/WS-POL-003-04A3-hidden-compilation-projections.md. clarify the latest workflow and implementation details. Stats: files=1 +7/-1 A=0 M=1 D=0 R=0 Driver: docs Areas: - .agent-loop: files=1 +7/-1 churn=8 Top files: - [M] .agent-loop/initiatives/WS-POL-003-unified-project-guide-compilation/chunks/WS-POL-003-04A3-hidden-compilation-projections.md (+7/-1) Reason: capture the current local repository changes on the selected branch.
Description: Fixes changes across backend and .agent-loop; notable files: .agent-loop/initiatives/WS-POL-003-unified-project-guide-compilation/chunks/WS-POL-003-04A3-hidden-compilation-projections.md, backend/tests/projects/guide_compilation/test_request_operation_postgresql.py. capture the latest implementation updates. Stats: files=2 +11/-3 A=0 M=2 D=0 R=0 Driver: code Areas: - backend: files=1 +7/-1 churn=8 - .agent-loop: files=1 +4/-2 churn=6 Top files: - [M] backend/tests/projects/guide_compilation/test_request_operation_postgresql.py (+7/-1) - [M] .agent-loop/initiatives/WS-POL-003-unified-project-guide-compilation/chunks/WS-POL-003-04A3-hidden-compilation-projections.md (+4/-2) Reason: capture the current local repository changes on the selected branch.
Description: Updates changes across backend and .agent-loop; notable files: .agent-loop/initiatives/WS-POL-003-unified-project-guide-compilation/chunks/WS-POL-003-04A3-hidden-compilation-projections.md, .github/workflows/backend.yml. keep automation aligned with repository changes. Stats: files=5 +105/-28 A=0 M=5 D=0 R=0 Driver: ci Areas: - backend: files=3 +90/-20 churn=110 - .agent-loop: files=1 +12/-6 churn=18 - ci: files=1 +3/-2 churn=5 Top files: - [M] backend/tests/projects/guide_compilation/test_projection_postgresql.py (+66/-0) - [M] backend/tests/projects/guide_compilation/test_projection_migration.py (+24/-4) - [M] .agent-loop/initiatives/WS-POL-003-unified-project-guide-compilation/chunks/WS-POL-003-04A3-hidden-compilation-projections.md (+12/-6) - [M] backend/app/modules/projects/repository.py (+0/-16) - [M] .github/workflows/backend.yml (+3/-2) Reason: capture the current local repository changes on the selected branch.
Description: Covers changes across backend; notable files: backend/tests/projects/guide_compilation/test_projection_postgresql.py. capture the latest expected behavior. Stats: files=1 +0/-67 A=0 M=1 D=0 R=0 Driver: test Areas: - backend: files=1 +0/-67 churn=67 Top files: - [M] backend/tests/projects/guide_compilation/test_projection_postgresql.py (+0/-67) Reason: capture the current local repository changes on the selected branch.
Description: Documents changes across .agent-loop; notable files: .agent-loop/initiatives/WS-POL-003-unified-project-guide-compilation/reviews/WS-POL-003-04A3-implementation-review-evidence.md. clarify the latest workflow and implementation details. Stats: files=1 +111/-0 A=1 M=0 D=0 R=0 Driver: docs Areas: - .agent-loop: files=1 +111/-0 churn=111 Top files: - [A] .agent-loop/initiatives/WS-POL-003-unified-project-guide-compilation/reviews/WS-POL-003-04A3-implementation-review-evidence.md (+111/-0) Reason: capture the current local repository changes on the selected branch.
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Avoid stale human-worker terminology while preserving the hidden projection cutover boundary.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:0484b7b314
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if new.facts_digest is distinct from | ||
| project_guide_projection_facts_digest(new) | ||
| or new.authority_resource_digest is distinct from | ||
| project_guide_projection_authority_digest(new) then |
There was a problem hiding this comment.
Bind projection custody to the referenced product row
When projection custody is inserted through direct SQL, these checks only prove that the operation and audit event agree with the operation's self-declared digests; they never recompute output_digest from the referenced sufficiency report or submission policy. A writer can therefore insert arbitrary business content first, attach an internally consistent operation, and have the later immutability triggers permanently seal a false custody receipt. Validate the referenced row's canonical content and identity before accepting the operation.
Useful? React with 👍 / 👎.
| "create trigger projected_policy_update_guard before update on submission_artifact_policies for each row execute function guard_compilation_projection_business_change()", | ||
| "create trigger projected_report_delete_guard before delete on guide_sufficiency_reports for each row execute function reject_compilation_projection_business_delete()", | ||
| "create trigger projected_policy_delete_guard before delete on submission_artifact_policies for each row execute function reject_compilation_projection_business_delete()", | ||
| "create trigger projected_usage_delete_guard before update or delete on guide_sufficiency_report_source_usages for each row execute function reject_compilation_projection_business_delete()", |
There was a problem hiding this comment.
Reject provenance inserts after projection custody exists
For a report already referenced by a projection operation, this trigger protects existing source usages from update/delete but still permits inserting another valid usage at a new item order. That changes the supposedly immutable provenance set after its receipt was committed, and downstream _verified_report_usages will reject the report when the usage count/order no longer matches the snapshot, potentially blocking later activation. Add an insert guard that rejects new usages once the report has projection custody.
Useful? React with 👍 / 👎.
| "create trigger projected_policy_update_guard before update on submission_artifact_policies for each row execute function guard_compilation_projection_business_change()", | ||
| "create trigger projected_report_delete_guard before delete on guide_sufficiency_reports for each row execute function reject_compilation_projection_business_delete()", | ||
| "create trigger projected_policy_delete_guard before delete on submission_artifact_policies for each row execute function reject_compilation_projection_business_delete()", | ||
| "create trigger projected_usage_delete_guard before update or delete on guide_sufficiency_report_source_usages for each row execute function reject_compilation_projection_business_delete()", |
There was a problem hiding this comment.
Preserve updates to unprojected source usages
For any legacy or otherwise unprojected source-usage row, this BEFORE UPDATE OR DELETE trigger reaches return old; on an UPDATE, PostgreSQL consequently reports success while replacing NEW with the unchanged old tuple. The migration is intended to make only usages referenced by a projection immutable, so use separate update/delete trigger functions or return NEW for an unprotected update.
Useful? React with 👍 / 👎.
| "key": f"required-artifact-{index:03d}", | ||
| "path": value, | ||
| "hash_required": True, |
There was a problem hiding this comment.
Validate required artifacts as canonical relative paths
When a compilation proposes a value such as " README.md ", the existing safe-text check and ArtifactRuleInput length constraint both accept it, and this transform persists it unchanged as the policy path. Such noncanonical paths will not match the actual submission artifact even though the projection contract requires canonical relative paths. Apply canonical relative-path validation before constructing these rules, rejecting rather than trimming or repairing invalid values.
Useful? React with 👍 / 👎.
Summary
Verification
Boundaries
This PR creates hidden projections only. AUTH-12J must activate their exact service authority, and POL-04A2 must add hidden setup-ledger finalization before any live cutover. Human merge is required.