Skip to content

spec: issue-3644 convert a contract between organization level and project level - #3789

Merged
jiparis merged 2 commits into
chainloop-dev:mainfrom
jiparis:issue-3644-spec-contract-scope-conversion
Nov 6, 2026
Merged

jiparis merged 2 commits into
chainloop-dev:mainfrom
jiparis:issue-3644-spec-contract-scope-conversion

Conversation

@jiparis

@jiparis jiparis commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Summary

This spec lets an organization admin convert an existing workflow contract between organization level and project level, in both directions. The contract keeps its ID, name, revision history, and workflows. Today the only way to change the level is to delete the contract and create it again, and that loses the history and the workflow links.

The CLI gets two flags on chainloop wf contract update, and a user can give only one of them: --project <name> and --org. The update API gets an optional level field. When the field is not set, the level does not change.

Key points for review:

  • Only callers that can manage organization-level contracts today can convert: organization owners and admins, and organization-level API tokens (D-004).
  • The system rejects an organization-to-project conversion when workflows of other projects use the contract, and the error names them (D-005).
  • A level change does not create a contract revision (D-006).
  • The workflow update command gets the same project check as the workflow create command, so no workflow can use a contract of a different project (R-010, D-007). Conversions and workflow changes lock the contract to prevent a race (D-008).
  • Out of scope: a move from one project to a different project, chainloop apply, and the web UI.

Open questions for reviewers

None.

We would like two reviewers to approve this spec before it merges.

Refs #3644

AI disclosure: Claude Code assisted with the drafting of this spec.

…oject level

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
@jiparis jiparis added the spec Design spec label Nov 6, 2026
@jiparis
jiparis requested a review from a team November 6, 2026 09:20
@chainloop-platform

chainloop-platform Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

PR validation — ✅ 3 passing

Status Policy Material Messages
✅ Passed pr-min-approvals pr-info -
✅ Passed pr-description-required pr-info -
✅ Passed pr-user-story-linked pr-info -

View attestation ↗

AI Session Checks — 🟢 93% · ✅ 0 failing

Avg score Sessions Failing policies Attribution Files Lines Total Duration
🟢 93% 1 ✅ 0 100% AI / 0% Human 1 +201 / -0 1h3m13s

🟢 93% — 100% AI — ✅ All policies passing

Nov 6, 2026 08:39 UTC · 1h3m13s · $4.68 · 176 in / 51.4k out · claude-code 2.1.318 (claude-opus-5-5)

View session details ↗

Change Summary

Adds a design specification for contract scope conversion, including user-approved workflow project checks and concurrency decisions; no runtime behavior changes.

AI Session Overall Score

🟢 93% — Spec-only work preserves user decisions and scope; implementation quality and runtime verification remain unassessed.

AI Session Analysis Breakdown

🟢 96% · scope-discipline

🟢 Kept the PR to one design document after the user explicitly requested a spec-only PR. · High Impact

🟢 93% · alignment

🟢 Review revisions match the approved workflow-check and shared-lock decisions without claiming the feature was implemented. · High Impact

🟢 91% · context-and-planning

🟢 Presented three CLI alternatives and unresolved authorization, workflow, audit, and apply choices before drafting. · High Impact

🟢 90% · user-trust-signal

No notes.

abstained · solution-quality

🟡 solution-quality not assessed — reviewer should confirm coverage · Low Severity

abstained · verification

🟡 verification not assessed — reviewer should confirm coverage · Low Severity


File Attribution

████████████████████ 100% AI / 0% Human

Status Attribution File Lines
created ai docs/specs/issue-3644-contract-scope-conversion.md +201 / -0

Policies (4)

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 — ✅ 5 passing

✅ Nothing this change touches re-opens a recorded security fix.

View in Chainloop ↗ · How this works ↗
✅ Nothing this change touches re-opens a recorded security fix.

View in Chainloop ↗ · How this works ↗
✅ Nothing this change touches re-opens a recorded security fix.

View in Chainloop ↗ · How this works ↗
✅ Nothing this change touches re-opens a recorded security fix.

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 -
Scans not applied (3)
Scan Reason
vulnerability-scan no manifest/lockfile changed
github-actions-scan no workflow files changed
iac-scan no IaC files changed

View attestation ↗


Powered by Chainloop and Chainloop Trace

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 1 file

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Adds R-010, D-007 and D-008 from the PR review.

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
@jiparis
jiparis merged commit c06dffc into chainloop-dev:main Nov 6, 2026
17 checks passed
@jiparis
jiparis deleted the issue-3644-spec-contract-scope-conversion branch November 6, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spec Design spec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants