Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
57 changes: 57 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!--
This description is the durable work record for both human and agent contributions.
Keep every heading. Replace the guidance with concrete evidence; use
"N/A — external contribution" only when no TreeSeed authority record exists.
Draft PRs may mark incomplete evidence as "Pending". Ready PRs must complete the
submission checklist.
-->

## Outcome

<!-- What user-visible or system outcome does this PR produce? -->

## Work authority

- Work item / Issue: <!-- Closes #123, URL, or N/A — external contribution -->
- Proposal / decision: <!-- TreeSeed IDs/URLs or N/A with reason -->
- Assignment / checkpoint: <!-- TreeSeed IDs/URLs or N/A with reason -->
- Actor: <!-- human handle or stable agent identity -->
- Human authority: <!-- accountable human handle; required for agent work -->
- Agent / capacity provider: <!-- stable identities or N/A -->
- Exact base ref: <!-- branch plus full commit SHA -->
- Exact head ref: <!-- branch plus full commit SHA -->

Contributor mode (select one):

- [ ] Human-authored
- [ ] Agent-assisted under human authority
- [ ] Agent-authored under human authority

## Plan

<!-- State the objective, bounded steps, current status, and any plan revisions. -->

## Changes and commits

<!-- Summarize the changes and link/list the commits that lock them in. -->

## Verification

<!-- Record exact commands, checks, contract/compatibility evidence, and results. -->

## Risk and rollback

<!-- Identify risks, migration effects, and an exact rollback/recovery path. -->

## Completion summary

<!-- Summarize the journey, final status, unresolved blockers, and next action. -->

## Submission checklist

- [ ] The change is bounded to the stated work item and target repository.
- [ ] Exact base and head refs are recorded and the branch is ready for review.
- [ ] Verification and compatibility evidence are recorded above.
- [ ] No plaintext secrets, credentials, machine state, or unrelated residue are included.
- [ ] Plan, status, commits, and completion summary form a complete durable record.
- [ ] Rollback or recovery steps are documented and executable.
103 changes: 103 additions & 0 deletions .github/workflows/pull-request-contract.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Pull Request Submission Contract

on:
pull_request_target:
types: [opened, edited, reopened, synchronize, ready_for_review, converted_to_draft]

permissions:
contents: read
pull-requests: read

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Validate durable PR record
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
with:
script: |
const pullRequest = context.payload.pull_request;
const body = (pullRequest?.body ?? '').replace(/<!--[\s\S]*?-->/gu, '');

const requiredSections = [
'Outcome',
'Work authority',
'Plan',
'Changes and commits',
'Verification',
'Risk and rollback',
'Completion summary',
'Submission checklist',
];
const missingSections = requiredSections.filter(
(section) => !body.includes(`## ${section}`),
);

const requiredFields = [
'Work item / Issue',
'Proposal / decision',
'Assignment / checkpoint',
'Actor',
'Human authority',
'Agent / capacity provider',
'Exact base ref',
'Exact head ref',
];
const fieldValues = new Map(requiredFields.map((field) => {
const escaped = field.replace(/[.*+?^$()|[\]\\]/gu, '\\$&');
const match = body.match(new RegExp(`^- ${escaped}:\\s*(\\S.+)$`, 'mu'));
return [field, match?.[1]?.trim() ?? ''];
}));
const missingFields = requiredFields.filter((field) => !fieldValues.get(field));

const contributorModes = body.match(
/^- \[[xX]\] (?:Human-authored|Agent-assisted under human authority|Agent-authored under human authority)$/gmu,
) ?? [];

const errors = [];
if (missingSections.length > 0) {
errors.push(`missing sections: ${missingSections.join(', ')}`);
}
if (missingFields.length > 0) {
errors.push(`missing work-authority values: ${missingFields.join(', ')}`);
}
if (contributorModes.length !== 1) {
errors.push('select exactly one contributor mode');
}

for (const [field, expectedSha] of [
['Exact base ref', pullRequest?.base?.sha],
['Exact head ref', pullRequest?.head?.sha],
]) {
const recordedSha = fieldValues.get(field)?.match(/(?:^|[^0-9a-f])([0-9a-f]{40})(?:$|[^0-9a-f])/u)?.[1];
if (!recordedSha) {
errors.push(`${field} must contain a full 40-character commit SHA`);
} else if (recordedSha !== expectedSha) {
errors.push(`${field} is stale: expected ${expectedSha}`);
}
}

if (!pullRequest?.draft) {
const readinessItems = [
'The change is bounded to the stated work item and target repository.',
'Exact base and head refs are recorded and the branch is ready for review.',
'Verification and compatibility evidence are recorded above.',
'No plaintext secrets, credentials, machine state, or unrelated residue are included.',
'Plan, status, commits, and completion summary form a complete durable record.',
'Rollback or recovery steps are documented and executable.',
];
const unchecked = readinessItems.filter(
(item) => !body.split(/\r?\n/u).some(
(line) => line.trim() === `- [x] ${item}` || line.trim() === `- [X] ${item}`,
),
);
if (unchecked.length > 0) {
errors.push(`ready PR has incomplete checklist items: ${unchecked.join(' | ')}`);
}
}

if (errors.length > 0) {
core.setFailed(
`Complete .github/PULL_REQUEST_TEMPLATE.md in the PR description: ${errors.join('; ')}`,
);
}
11 changes: 7 additions & 4 deletions docs/src/content/agents/architect.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ activityProfiles:
outputs:
messageTypes: []
modelMutations:
- proposal:create
- linked_note:create
- proposal_feedback:create
- question:create
Expand All @@ -161,12 +162,14 @@ activityProfiles:
activityType: estimating
enabled: true
handler: estimate
planningIntent:
subjectModel: proposal
prompt:
system: |
You are the Architect for this TreeSeed project. Defines the project architecture, objectives, standards, and decision-aligned knowledge structure. Use TreeDX-backed content tools for all project content and keep work scoped to the current activity profile.
task: estimating
branchPolicy:
kind: read-only
kind: main-planning-content
base: main
permissions:
content:
Expand Down Expand Up @@ -241,7 +244,7 @@ activityProfiles:
- validate
- commit
commit:
allowed: false
allowed: true
tools:
allowed:
- treeseed.content.describe
Expand Down Expand Up @@ -278,7 +281,7 @@ activityProfiles:
You are the Architect for this TreeSeed project. Defines the project architecture, objectives, standards, and decision-aligned knowledge structure. Use TreeDX-backed content tools for all project content and keep work scoped to the current activity profile.
task: reviewing
branchPolicy:
kind: read-only
kind: main-planning-content
base: main
permissions:
content:
Expand Down Expand Up @@ -353,7 +356,7 @@ activityProfiles:
- validate
- commit
commit:
allowed: false
allowed: true
tools:
allowed:
- treeseed.content.describe
Expand Down
27 changes: 21 additions & 6 deletions docs/src/content/agents/engineer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,14 @@ activityProfiles:
activityType: estimating
enabled: true
handler: estimate
planningIntent:
subjectModel: proposal
prompt:
system: |
You are the Engineer for this TreeSeed project. Implements decision-scoped code and configuration changes without modifying tests. Use TreeDX-backed content tools for all project content and keep work scoped to the current activity profile.
task: estimating
branchPolicy:
kind: read-only
kind: main-planning-content
base: main
permissions:
content:
Expand Down Expand Up @@ -240,7 +242,7 @@ activityProfiles:
- validate
- commit
commit:
allowed: false
allowed: true
tools:
allowed:
- treeseed.content.describe
Expand Down Expand Up @@ -277,7 +279,7 @@ activityProfiles:
You are the Engineer for this TreeSeed project. Implements decision-scoped code and configuration changes without modifying tests. Use TreeDX-backed content tools for all project content and keep work scoped to the current activity profile.
task: reviewing
branchPolicy:
kind: read-only
kind: main-planning-content
base: main
permissions:
content:
Expand Down Expand Up @@ -352,7 +354,7 @@ activityProfiles:
- validate
- commit
commit:
allowed: false
allowed: true
tools:
allowed:
- treeseed.content.describe
Expand Down Expand Up @@ -386,8 +388,8 @@ activityProfiles:
handler: actor
prompt:
system: |
You are the Engineer for this TreeSeed project. Implements decision-scoped code and configuration changes without modifying tests. Use TreeDX-backed content tools for all project content and keep work scoped to the current activity profile.
task: acting
You are the Engineer for this TreeSeed project. Begin only from an approved decision, ready execution node, accepted capacity plan, recorded exact base ref, and a verified failing-test integration ref from the Tester. Integrate that exact test ref through the assigned TreeSeed workflow operation, implement the smallest owning-abstraction change, and do not modify test files. Run focused and affected verification, use the assignment checkpoint tool to create the local implementation commit, record changed paths and command receipts, and return that commit ref for review. Use TreeDX for project content. Never push, merge, tag, deploy, or mutate provider infrastructure directly.
task: implement-against-failing-test
branchPolicy:
kind: assignment-feature
base: staging
Expand Down Expand Up @@ -492,6 +494,7 @@ activityProfiles:
- treedx.commit_workspace
- treeseed.changed_paths
- treeseed.verify
- treeseed.checkpoint
- treeseed.dev_plan
outputs:
messageTypes: []
Expand All @@ -508,6 +511,18 @@ activityProfiles:
maxRuntimeSeconds: 1800
maxRetries: 2
verificationRequired: true
allowedPaths:
- src/**
- scripts/**
- package.json
- package-lock.json
- treeseed.package.yaml
- tsconfig*.json
forbiddenPaths:
- test/**
- tests/**
- spec/**
- specs/**
---

Engineer for the agent TreeSeed project.
Expand Down
14 changes: 8 additions & 6 deletions docs/src/content/agents/releaser.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,14 @@ activityProfiles:
activityType: estimating
enabled: true
handler: estimate
planningIntent:
subjectModel: proposal
prompt:
system: |
You are the Releaser for this TreeSeed project. Verifies staged changes and coordinates reliable release from staging through TreeSeed release operations. Use TreeDX-backed content tools for all project content and keep work scoped to the current activity profile.
task: estimating
branchPolicy:
kind: read-only
kind: main-planning-content
base: main
permissions:
content:
Expand Down Expand Up @@ -244,7 +246,7 @@ activityProfiles:
- validate
- commit
commit:
allowed: false
allowed: true
tools:
allowed:
- treeseed.content.describe
Expand Down Expand Up @@ -281,7 +283,7 @@ activityProfiles:
You are the Releaser for this TreeSeed project. Verifies staged changes and coordinates reliable release from staging through TreeSeed release operations. Use TreeDX-backed content tools for all project content and keep work scoped to the current activity profile.
task: reviewing
branchPolicy:
kind: read-only
kind: main-planning-content
base: main
permissions:
content:
Expand Down Expand Up @@ -356,7 +358,7 @@ activityProfiles:
- validate
- commit
commit:
allowed: false
allowed: true
tools:
allowed:
- treeseed.content.describe
Expand Down Expand Up @@ -390,8 +392,8 @@ activityProfiles:
handler: releaser
prompt:
system: |
You are the Releaser for this TreeSeed project. Verifies staged changes and coordinates reliable release from staging through TreeSeed release operations. Use TreeDX-backed content tools for all project content and keep work scoped to the current activity profile.
task: acting
You are the Releaser for this TreeSeed project. Assess release readiness only after approved review, required revision completion, passing verification, documentation evidence, complete artifact manifests, and settled usage. Invoke only assignment-scoped TreeSeed operations-runner handles. Do not call git or hosting providers directly, and do not claim deployment while hosted deployment is suspended. Record the exact ref, guarantees, blockers, and permitted next operation through TreeDX.
task: verify-release-readiness-and-handoff
branchPolicy:
kind: staging-release
base: staging
Expand Down
10 changes: 6 additions & 4 deletions docs/src/content/agents/researcher.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,14 @@ activityProfiles:
activityType: estimating
enabled: true
handler: estimate
planningIntent:
subjectModel: proposal
prompt:
system: |
You are the Researcher for this TreeSeed project. Answers questions and improves project knowledge through TreeDX-backed research content. Use TreeDX-backed content tools for all project content and keep work scoped to the current activity profile.
task: estimating
branchPolicy:
kind: read-only
kind: main-planning-content
base: main
permissions:
content:
Expand Down Expand Up @@ -241,7 +243,7 @@ activityProfiles:
- validate
- commit
commit:
allowed: false
allowed: true
tools:
allowed:
- treeseed.content.describe
Expand Down Expand Up @@ -278,7 +280,7 @@ activityProfiles:
You are the Researcher for this TreeSeed project. Answers questions and improves project knowledge through TreeDX-backed research content. Use TreeDX-backed content tools for all project content and keep work scoped to the current activity profile.
task: reviewing
branchPolicy:
kind: read-only
kind: main-planning-content
base: main
permissions:
content:
Expand Down Expand Up @@ -353,7 +355,7 @@ activityProfiles:
- validate
- commit
commit:
allowed: false
allowed: true
tools:
allowed:
- treeseed.content.describe
Expand Down
Loading
Loading