Skip to content

Document Lab branch identity contract#6

Merged
samscarrow merged 2 commits into
mainfrom
work/branch-identity-contract
May 22, 2026
Merged

Document Lab branch identity contract#6
samscarrow merged 2 commits into
mainfrom
work/branch-identity-contract

Conversation

@samscarrow
Copy link
Copy Markdown
Collaborator

Summary

Adds a Lab branch identity contract documenting that Work Item identity is canonical and branch names are execution artifacts.

Policy

  • Preferred new branch names should include the Work Item handle.
  • Existing substantial work on a noncanonical branch may be accepted when it maps cleanly to one Work Item and passes acceptance checks.
  • Branch-name mismatch is metadata, not failure.
  • Rebranch only for contamination, unsafe base, mixed scope, or unclear Work Item mapping.

Why

This prevents agents from rebranching useful work solely for naming hygiene, while preserving the existing contamination guard based on git log main..HEAD --oneline.

Repos in scope

This PR covers the control-plane contract in notion-forge. A companion agent-env PR adds the agent-facing reference.

Copilot AI review requested due to automatic review settings May 7, 2026 02:58
@samscarrow
Copy link
Copy Markdown
Collaborator Author

Reviewed docs-only branch identity contract. No blockers from my pass: the policy cleanly distinguishes canonical Work Item identity from branch naming hygiene, preserves the contamination guard via scope cleanliness / git log main..HEAD --oneline, and matches the intended Lab behavior. Lint is passing and the PR is mergeable.\n\nNote: GitHub will not let me submit an approving review because this PR is authored by the same account identity available to this runner.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a control-plane documentation contract clarifying that Lab Work Item identity is canonical and Git branch names are execution artifacts, with guidance on when branch-name mismatches are acceptable and when rebranching is justified.

Changes:

  • Introduces a “Lab Branch Identity Contract” doc defining canonical identity vs. execution branch naming.
  • Documents branch policy, rebranching criteria (contamination/unsafe base), and PR conventions for noncanonical branches.
  • Clarifies interpretation of the dispatch packet branch field and Work Item Branch property (though this section currently diverges from observed implementation behavior).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/branch-identity-contract.md Outdated
Comment on lines +65 to +66
If the Work Item `Branch` property is empty, execution agents may default to `main` for read-only/audit work or create a preferred branch for new code work.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in f322995 by clarifying the branch-name casing rule, using the canonical Kill/Stop Condition property name, and aligning empty Branch behavior with dispatch branch=main for non-sandbox items.

Comment thread docs/branch-identity-contract.md Outdated
2. The branch is pushed or otherwise inspectable.
3. The Work Item records the actual branch name in `Branch`.
4. The issue or PR title/body references the Work Item handle.
5. The branch passes the Work Item objective, stop condition, metrics, and acceptance checks.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in f322995 by clarifying the branch-name casing rule, using the canonical Kill/Stop Condition property name, and aligning empty Branch behavior with dispatch branch=main for non-sandbox items.

Comment on lines +23 to +33
Preferred branch names should include the Work Item handle:

```text
work/sra-imp-1
```

or:

```text
sra-imp-1
```
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in f322995 by clarifying the branch-name casing rule, using the canonical Kill/Stop Condition property name, and aligning empty Branch behavior with dispatch branch=main for non-sandbox items.

@samscarrow
Copy link
Copy Markdown
Collaborator Author

Addressed Copilot review comments in f322995: empty Branch semantics now match dispatch (branch=main for non-sandbox items unless Branch is set before dispatch), the canonical Kill/Stop Condition property is referenced, and branch handle casing flexibility is explicit. Lint is passing on the updated PR head.

@samscarrow samscarrow merged commit c10e940 into main May 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants