Repository navigation
Conversation
…level Adds an optional level to the contract update API and the --project and --org flags to 'chainloop workflow contract update', so organization admins can move a contract between the organization and a project while it keeps its revisions and workflows. Workflow updates now reject a contract of a different project, and conversions and workflow changes lock the contract. Implements spec issue-3644 (R-001 to R-010, D-008). Closes chainloop-dev#3644 Assisted-by: Claude Code Signed-off-by: Jose Ignacio Paris Prieto <jiparis@chainloop.dev> Chainloop-Trace-Sessions: bc6fbb4d-3bf8-4fd0-b81e-10aa03bf1e58
PR validation — ✅ 3 passing
AI Session Checks — 🟢 88% · ✅ 0 failing
|
| Status | Policy | Material | Messages |
|---|---|---|---|
| ✅ Passed | ai-config-ai-agents-allowed |
ai-coding-session-bc6fbb |
- |
| ✅ Passed | ai-config-no-dangerous-commands |
ai-coding-session-bc6fbb |
- |
| ✅ Passed | ai-config-no-secrets |
ai-coding-session-bc6fbb |
- |
| ✅ Passed | ai-config-mcp-servers-allowed |
ai-coding-session-bc6fbb |
- |
Security Checks — ✅ 6 passing
✅ Reviewed this change against the project's security context (23 concerns hunted) — no introduced risk found.
View in Chainloop ↗ · How this works ↗
✅ Reviewed this change against the project's security context (23 concerns hunted) — no introduced risk found.
View in Chainloop ↗ · How this works ↗
✅ secret-scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | secrets-detection |
- |
✅ sast-scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | owasp-top10-2025 |
- |
| ✅ Passed | sast |
- |
| ✅ Passed | cwe-top25 |
- |
| ✅ Passed | cwe-top26-40-cusp |
- |
✅ iac-scan
| Status | Policy | Messages |
|---|---|---|
| ✅ Passed | iac-misconfiguration |
- |
Scans not applied (2)
| Scan | Reason |
|---|---|
vulnerability-scan |
no manifest/lockfile changed |
github-actions-scan |
no workflow files changed |
Powered by Chainloop and Chainloop Trace
There was a problem hiding this comment.
All reported issues were addressed across 23 files
This PR changes authentication, authorization, or input validation. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.
View guided diff | Re-trigger cubic
- Rename the CLI flag --org to --org-level. The local --org hid the global --org flag that selects the organization. Add a test that no command flag hides a global flag. - Take the old level of the audit event from the conversion, which reads it under the contract lock, and write the event only when the level changed. - Add validation tests for the level field of the update request. - Spec issue-3644: D-009 supersedes D-003, R-011 supersedes R-002, add D-010. Refs chainloop-dev#3644 Assisted-by: Claude Code Signed-off-by: Jose Ignacio Paris Prieto <jiparis@chainloop.dev> Chainloop-Trace-Sessions: bc6fbb4d-3bf8-4fd0-b81e-10aa03bf1e58
There was a problem hiding this comment.
All reported issues were addressed across 9 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
The repository now reports the level before and after a conversion, both read while the conversion holds the contract lock, so a later conversion can not change the new level that the audit event records. Refs chainloop-dev#3644 Assisted-by: Claude Code Signed-off-by: Jose Ignacio Paris Prieto <jiparis@chainloop.dev> Chainloop-Trace-Sessions: bc6fbb4d-3bf8-4fd0-b81e-10aa03bf1e58
Summary
Lets an organization admin convert an existing workflow contract between the organization level and a project level, in both directions. The contract keeps its ID, name, revisions, and workflows. This implements spec issue-3644.
organization_scoped. When it is not set, the level does not change (R-001, R-011, R-009).chainloop workflow contract updategets--project <name>and--org-level, which cannot be used together.WorkflowContractScopeChangedevent records the old and the new level, both read under the contract lock (R-008, D-010).Spec changes in this PR: D-009 supersedes D-003 (the flag is
--org-level, because a local--orghides the global organization flag), R-011 supersedes R-002 (the same requirement with the new flag), and D-010 is new.Closes #3644
AI disclosure: this change was implemented with the assistance of Claude Code.