Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
90b606a
build(changelog): add tools/changelog/add_entry.py and Make target; h…
flyingrobots Sep 15, 2025
18ca7de
hooks(pre-push): enforce CHANGELOG on pushes to main; docs: add hooks…
flyingrobots Sep 15, 2025
5965e14
refactor(constants): unify public/internal constants; move CBOR const…
flyingrobots Sep 15, 2025
4e9444a
chore(ci/docs/core): fix CI gating and docs; allow git-style refs; RE…
flyingrobots Sep 15, 2025
00adcb8
docs(agents): log 2025-09-15 activities (CI fixes, ref validation, do…
flyingrobots Sep 15, 2025
34a3d69
build(meson): enforce Docker-only builds with force_local_builds flag…
flyingrobots Sep 15, 2025
056a167
chore(repo): commit remaining pending changes (docs, tests, tools)
flyingrobots Sep 15, 2025
bc4c086
fix(tests/core): align OID-first equality; harden ref builder; stabil…
flyingrobots Sep 16, 2025
e4f3f90
fix(util/ref,tests): portable ref validation and Docker CI test branc…
flyingrobots Sep 16, 2025
2504517
chore(review): address PR169 feedback (hook changelog regex, C++ guar…
flyingrobots Sep 16, 2025
95eebe5
docs(review): complete PR169 feedback responses and implement remaini…
flyingrobots Sep 16, 2025
6cf3aa5
feat(review): add PR feedback seeding script; add CodeRabbit config, …
flyingrobots Sep 16, 2025
c33f0db
docs(AGENTS): add Regression Guardrails and PR Review Checklist with …
flyingrobots Sep 16, 2025
2cab0d3
chore(tooling): add docs-verify, header-compile, seed-review make tar…
flyingrobots Sep 16, 2025
6c5f01a
ci(review): auto-seed review doc on PRs; commit to same-repo branches…
flyingrobots Sep 16, 2025
b8f708b
ci(review): try push to fork with BOT_PAT when allowed; fallback to a…
flyingrobots Sep 16, 2025
4a53e56
ci(review): rename bot secret to GITMIND_PR_WORKSHEET_BOT
flyingrobots Sep 16, 2025
88aceda
docs(tools): add Review_Seeding guide; link from AGENTS.md and CONTRI…
flyingrobots Sep 16, 2025
a6d643c
docs(review): add Future Work section to Review_Seeding with GH App a…
flyingrobots Sep 16, 2025
406db64
Potential fix for code scanning alert no. 19: Workflow does not conta…
flyingrobots Sep 16, 2025
3a0f4e6
feat(review): add workflow to apply feedback replies to PR comments f…
flyingrobots Sep 16, 2025
cea8502
chore(review): add worksheet checker and pre-push gate for unfilled t…
flyingrobots Sep 16, 2025
e7fe150
chore(agents): curate Recent Developments and archive older activity …
flyingrobots Sep 16, 2025
027f74b
fix(agents): correct Recent Developments YAML format and sanitized du…
flyingrobots Sep 16, 2025
8b39980
feat(ledger): add Features_Ledger with group progress + updater scrip…
flyingrobots Sep 16, 2025
2147914
docs(agents): log recent developments (review seeding + replies, work…
flyingrobots Sep 16, 2025
c0f1a42
chore: update features tooling
flyingrobots Sep 16, 2025
02c818b
chore: checkpoint planning docs and animated dag
flyingrobots Sep 17, 2025
4c81894
chore: refresh issue lifecycle svg
flyingrobots Sep 17, 2025
74236e4
docs: add graph lvl-up tank
flyingrobots Sep 17, 2025
8b603ef
docs: resolve pr169 review worksheet
flyingrobots Sep 17, 2025
2e11fb1
docs: archive legacy src notes
flyingrobots Sep 18, 2025
b39e24f
docs: align examples with core layout
flyingrobots Sep 18, 2025
62c7e48
tests: cover cache branch limits and tree size
flyingrobots Sep 18, 2025
20a17d1
docs: propose sandbox transaction blocks
flyingrobots Sep 18, 2025
222dd1f
docs: refine sandbox transactions rfc
flyingrobots Sep 18, 2025
0cf63a9
docs: capture feedback on sandbox transactions
flyingrobots Sep 18, 2025
bf5c7d4
docs: slot sandbox transactions into alpha roadmap
flyingrobots Sep 18, 2025
6104167
docs: break out features ledger task list
flyingrobots Sep 18, 2025
62577ae
docs: restructure tasklist and add dependency dag
flyingrobots Sep 18, 2025
a4cac3a
docs: regenerate tasklist and dependency svg
flyingrobots Sep 18, 2025
21d29c3
docs: tweak dependency dag layout
flyingrobots Sep 18, 2025
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
36 changes: 36 additions & 0 deletions .coderabbit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
version: 1

review:
summary_preferred: true
max_total_comments: 50
max_comments_per_file: 5
prefer_patch_suggestions: true
tone: "concise, constructive, and action-oriented"
style:
- "Group similar issues together; avoid duplicates"
- "Reference rules/patterns (e.g., markdownlint MD041) over fragile line numbers"
- "Propose concrete fix-it snippets where possible"
- "Avoid inline comments on docs unless correctness is at stake; use summary"

Comment on lines +3 to +14

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.

⚠️ Potential issue

Key mismatch with config schema: use reviews, not review.

Per schema, the top-level key is reviews. Using review likely causes settings to be ignored.

-review:
+reviews:
   summary_preferred: true
   max_total_comments: 50
   max_comments_per_file: 5
   prefer_patch_suggestions: true
   tone: "concise, constructive, and action-oriented"
   style:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
review:
summary_preferred: true
max_total_comments: 50
max_comments_per_file: 5
prefer_patch_suggestions: true
tone: "concise, constructive, and action-oriented"
style:
- "Group similar issues together; avoid duplicates"
- "Reference rules/patterns (e.g., markdownlint MD041) over fragile line numbers"
- "Propose concrete fix-it snippets where possible"
- "Avoid inline comments on docs unless correctness is at stake; use summary"
reviews:
summary_preferred: true
max_total_comments: 50
max_comments_per_file: 5
prefer_patch_suggestions: true
tone: "concise, constructive, and action-oriented"
style:
- "Group similar issues together; avoid duplicates"
- "Reference rules/patterns (e.g., markdownlint MD041) over fragile line numbers"
- "Propose concrete fix-it snippets where possible"
- "Avoid inline comments on docs unless correctness is at stake; use summary"
🤖 Prompt for AI Agents
In .coderabbit.yml around lines 3 to 14 the top-level key is incorrectly named
"review" but the schema expects "reviews"; rename the key to "reviews"
(preserving the existing nested structure: summary_preferred,
max_total_comments, max_comments_per_file, prefer_patch_suggestions, tone,
style) so the config is recognized, then run/validate against the config schema
or linter and search the repo for any references to ".coderabbit.yml" keys to
update callers if they relied on the old "review" name.

filters:
paths:
docs/**: summary_only
assets/**: ignore
build/**: ignore
.github/**: summary_only

labels:
summary_only:
- docs-only
- chore
skip:
- vendored

rules:
- name: "Front matter required"
paths: ["docs/**/*.md"]
summary: true
- name: "Single H1 per document"
paths: ["docs/**/*.md"]
summary: true

59 changes: 56 additions & 3 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; }
git lfs pre-push "$@"
#!/usr/bin/env bash
set -euo pipefail

# Guard: allow bypass
if [[ "${HOOKS_BYPASS:-}" == "1" ]]; then
exit 0
fi

remote_name=$1
remote_url=$2

status=0
while read -r local_ref local_sha remote_ref remote_sha; do
# Only enforce for pushes to main
if [[ "$remote_ref" == "refs/heads/main" ]]; then
# Determine the range to inspect
range=""
if [[ "$remote_sha" == "0000000000000000000000000000000000000000" ]]; then
# New branch/update; check last commit only
range="$local_sha^..$local_sha"
else
range="$remote_sha..$local_sha"
fi
Comment on lines +18 to +23

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.

⚠️ Potential issue

New-branch range: handle root commits safely.

Use diff-tree on the new commit instead of local^..local to avoid failures on root commits.

-      range="$local_sha^..$local_sha"
+      range="$local_sha"
+      changelog_names="$(git diff-tree --no-commit-id --name-only -r "$local_sha")"
+    else
+      range="$remote_sha..$local_sha"
+      changelog_names="$(git diff --name-only "$range")"
-    else
-      range="$remote_sha..$local_sha"
-    fi
+    fi

Then test changelog_names instead of invoking git diff twice.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if [[ "$remote_sha" == "0000000000000000000000000000000000000000" ]]; then
# New branch/update; check last commit only
range="$local_sha^..$local_sha"
else
range="$remote_sha..$local_sha"
fi
if [[ "$remote_sha" == "0000000000000000000000000000000000000000" ]]; then
# New branch/update; check last commit only
range="$local_sha"
changelog_names="$(git diff-tree --no-commit-id --name-only -r "$local_sha")"
else
range="$remote_sha..$local_sha"
changelog_names="$(git diff --name-only "$range")"
fi
🤖 Prompt for AI Agents
In .githooks/pre-push around lines 18-23, the new-branch handling uses
"$local_sha^..$local_sha" which breaks for root commits and the script currently
invokes git diff twice; replace the new-branch range logic to obtain changed
files from the single new commit using git diff-tree (or equivalent
single-commit name-only listing) for "$local_sha" instead of using the caret
range, and then use that single result (changelog_names) for subsequent checks
rather than calling git diff a second time; ensure the existing-branch path
still uses the remote..local diff to populate changelog_names.


Comment on lines +13 to +24

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.

⚠️ Potential issue

Skip deletions to main.

If local_sha is all zeros (branch deletion), skip enforcement.

   while read -r local_ref local_sha remote_ref remote_sha; do
     # Only enforce for pushes to main
     if [[ "$remote_ref" == "refs/heads/main" ]]; then
+      # Skip deletions
+      if [[ "$local_sha" == "0000000000000000000000000000000000000000" ]]; then
+        continue
+      fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
while read -r local_ref local_sha remote_ref remote_sha; do
# Only enforce for pushes to main
if [[ "$remote_ref" == "refs/heads/main" ]]; then
# Determine the range to inspect
range=""
if [[ "$remote_sha" == "0000000000000000000000000000000000000000" ]]; then
# New branch/update; check last commit only
range="$local_sha^..$local_sha"
else
range="$remote_sha..$local_sha"
fi
while read -r local_ref local_sha remote_ref remote_sha; do
# Only enforce for pushes to main
if [[ "$remote_ref" == "refs/heads/main" ]]; then
# Skip deletions
if [[ "$local_sha" == "0000000000000000000000000000000000000000" ]]; then
continue
fi
# Determine the range to inspect
range=""
if [[ "$remote_sha" == "0000000000000000000000000000000000000000" ]]; then
# New branch/update; check last commit only
range="$local_sha^..$local_sha"
else
range="$remote_sha..$local_sha"
fi
🤖 Prompt for AI Agents
.githooks/pre-push around lines 13 to 24: the hook treats a local_sha of all
zeros (branch deletion) as a new-branch case and proceeds to enforce checks
against main; detect when local_sha equals
0000000000000000000000000000000000000000 and skip enforcement by continuing the
loop (i.e., do not set a range or run checks for deletions to main), leaving
other logic unchanged.

# Check if a changelog file is updated in this push
# Match common variants: CHANGELOG, CHANGES, with optional .md, case-insensitive, with or without paths
if ! git diff --name-only "$range" | grep -iqE '(^|.*/)(CHANGELOG|CHANGES)(\.md)?$'; then
echo "[pre-push] No changelog file updated for push to main ($range)." >&2
echo " Expected one of: CHANGELOG.md, CHANGES.md, or variants (case-insensitive)." >&2
echo " Run: make changelog-add m=\"<one-liner>\"" >&2
echo " Or bypass once: HOOKS_BYPASS=1 git push" >&2
status=1
fi
Comment on lines +26 to +33

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.

🧹 Nitpick

Handle filenames with newlines; reuse computed names.

Use the already captured changelog_names and avoid a second git call; optionally use -z and map to newline if you later need robustness.

-    if ! git diff --name-only "$range" | grep -iqE '(^|.*/)(CHANGELOG|CHANGES)(\.md)?$'; then
+    if ! printf '%s\n' "$changelog_names" | grep -iqE '(^|.*/)?(CHANGELOG|CHANGES)(\.md)?$'; then
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Match common variants: CHANGELOG, CHANGES, with optional .md, case-insensitive, with or without paths
if ! git diff --name-only "$range" | grep -iqE '(^|.*/)(CHANGELOG|CHANGES)(\.md)?$'; then
echo "[pre-push] No changelog file updated for push to main ($range)." >&2
echo " Expected one of: CHANGELOG.md, CHANGES.md, or variants (case-insensitive)." >&2
echo " Run: make changelog-add m=\"<one-liner>\"" >&2
echo " Or bypass once: HOOKS_BYPASS=1 git push" >&2
status=1
fi
# Match common variants: CHANGELOG, CHANGES, with optional .md, case-insensitive, with or without paths
if ! printf '%s\n' "$changelog_names" | grep -iqE '(^|.*/)?(CHANGELOG|CHANGES)(\.md)?$'; then
echo "[pre-push] No changelog file updated for push to main ($range)." >&2
echo " Expected one of: CHANGELOG.md, CHANGES.md, or variants (case-insensitive)." >&2
echo " Run: make changelog-add m=\"<one-liner>\"" >&2
echo " Or bypass once: HOOKS_BYPASS=1 git push" >&2
status=1
fi
🤖 Prompt for AI Agents
.githooks/pre-push lines 26-33: the script is making a second git call and can
mis-handle filenames with newlines; reuse the already-captured changelog_names
variable instead of calling git diff again, and perform matching in a NUL-safe
way by using the NUL-separated names (git diff --name-only -z) or by printing
changelog_names with printf '%s\n' to feed grep; then run grep with the
appropriate flags (-z for NUL-separated input or regular grep for
newline-separated) and the same regex, set status=1 when no match, and avoid
invoking git twice.

fi

# Worksheet gate: block pushes when review worksheets contain unfilled templates
# Determine the range to inspect for all branches
range=""
if [[ "$remote_sha" == "0000000000000000000000000000000000000000" ]]; then
range="$local_sha^..$local_sha"
else
range="$remote_sha..$local_sha"
fi
changed_files=$(git diff --name-only "$range" | grep '^docs/code-reviews/PR' || true)
if [[ -n "$changed_files" ]]; then
# Run worksheet checker
if ! python3 tools/review/check_worksheets.py $changed_files; then
echo "[pre-push] Unfilled review worksheet templates detected in changed files." >&2
echo " Please complete Accepted/Rejected sections before pushing." >&2
echo " Bypass once with HOOKS_BYPASS=1 if necessary." >&2
status=1
fi
fi
done

exit $status
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docs-only:
- changed-files:
- any-glob-to-any-file: ['docs/**', 'README.md', 'AGENTS.md', 'CONTRIBUTING.md']

36 changes: 16 additions & 20 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
## Description
## Summary

Brief description of what this PR does.
Describe the change and why it’s needed. Link issues/PRDs if relevant.

## Related Issue
## Change Areas

Fixes #(issue number)
- [ ] Core (C)
- [ ] CLI / Hooks
- [ ] Docs
- [ ] CI / Tooling

## Type of Change
## Risk

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- [ ] Behavior change
- [ ] Public API change
- [ ] Docs-only

## Testing
## Code Review Guidance (for humans and CodeRabbit)

- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] I have added/updated documentation as needed
- Summarize top risks and propose concrete fix-it blocks where needed.
- Prefer rule/pattern references (e.g., markdownlint MD041) over fragile line numbers.
- Group nits into a brief summary; avoid inline comments on docs unless correctness is impacted.
- Provide patch suggestions for repeated issues.

## Checklist

- [ ] My code follows the style guidelines of this project
- [ ] I have run `make test` in Docker
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
36 changes: 36 additions & 0 deletions .github/workflows/apply-feedback.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Apply PR Feedback Replies

on:
push:
branches-ignore: [ main ]
paths:
- 'docs/code-reviews/**.md'

permissions:
contents: read
pull-requests: write

Comment on lines +9 to +12

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.

⚠️ Potential issue

Missing permission to create PR issue comments.

Posting to /issues/{pr}/comments requires issues: write.

 permissions:
   contents: read
   pull-requests: write
+  issues: write
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
permissions:
contents: read
pull-requests: write
permissions:
contents: read
pull-requests: write
issues: write
🤖 Prompt for AI Agents
.github/workflows/apply-feedback.yml lines 9-12: the workflow currently grants
only contents: read and pull-requests: write but needs permission to post
issue/PR comments; add issues: write to the permissions block so the workflow
can call the /issues/{pr}/comments endpoint.

jobs:
apply:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Detect changed review worksheets
id: files
run: |
set -e
BEFORE=${{ github.event.before }}
AFTER=${{ github.sha }}
git fetch --no-tags origin "$BEFORE" || true
CHANGED=$(git diff --name-only "$BEFORE" "$AFTER" | grep '^docs/code-reviews/PR' || true)
echo "changed=$CHANGED" >> $GITHUB_OUTPUT
- name: Apply feedback replies
Comment on lines +21 to +27

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.

⚠️ Potential issue

Handle new branches and set multi-line outputs correctly.

github.event.before can be all zeros; also, writing multi-line outputs needs the heredoc form.

-          BEFORE=${{ github.event.before }}
-          AFTER=${{ github.sha }}
-          git fetch --no-tags origin "$BEFORE" || true
-          CHANGED=$(git diff --name-only "$BEFORE" "$AFTER" | grep '^docs/code-reviews/PR' || true)
-          echo "changed=$CHANGED" >> $GITHUB_OUTPUT
+          BEFORE=${{ github.event.before }}
+          AFTER=${{ github.sha }}
+          if [[ "$BEFORE" == "0000000000000000000000000000000000000000" ]]; then
+            CHANGED="$(git diff-tree --no-commit-id --name-only -r "$AFTER" | grep '^docs/code-reviews/PR' || true)"
+          else
+            git fetch --no-tags origin "$BEFORE" || true
+            CHANGED="$(git diff --name-only "$BEFORE" "$AFTER" | grep '^docs/code-reviews/PR' || true)"
+          fi
+          {
+            echo "changed<<EOF"
+            printf '%s\n' "$CHANGED"
+            echo "EOF"
+          } >> "$GITHUB_OUTPUT"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
set -e
BEFORE=${{ github.event.before }}
AFTER=${{ github.sha }}
git fetch --no-tags origin "$BEFORE" || true
CHANGED=$(git diff --name-only "$BEFORE" "$AFTER" | grep '^docs/code-reviews/PR' || true)
echo "changed=$CHANGED" >> $GITHUB_OUTPUT
- name: Apply feedback replies
set -e
BEFORE=${{ github.event.before }}
AFTER=${{ github.sha }}
if [[ "$BEFORE" == "0000000000000000000000000000000000000000" ]]; then
CHANGED="$(git diff-tree --no-commit-id --name-only -r "$AFTER" | grep '^docs/code-reviews/PR' || true)"
else
git fetch --no-tags origin "$BEFORE" || true
CHANGED="$(git diff --name-only "$BEFORE" "$AFTER" | grep '^docs/code-reviews/PR' || true)"
fi
{
echo "changed<<EOF"
printf '%s\n' "$CHANGED"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Apply feedback replies
🤖 Prompt for AI Agents
In the .github/workflows/apply-feedback.yml file around lines 21 to 27, the code
that checks for changed files in the docs/code-reviews/PR directory has two
issues:

1. The `github.event.before` value can be all zeros when the PR is created from
a new branch, causing the `git fetch` command to fail. Add a check to handle
this case and fallback to an empty string if `github.event.before` is all zeros.

2. The `echo "changed=$CHANGED" >> $GITHUB_OUTPUT` line does not correctly
handle multi-line output. Instead, use the heredoc form to properly set the
multi-line output variable:

echo <<EOF >> $GITHUB_OUTPUT
changed=$CHANGED
EOF

if: steps.files.outputs.changed != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
OWNER=${GITHUB_REPOSITORY%%/*}
REPO=${GITHUB_REPOSITORY##*/}
python3 -m pip install --upgrade pip >/dev/null 2>&1 || true
python3 tools/review/apply_feedback_to_github.py --owner "$OWNER" --repo "$REPO" ${{ steps.files.outputs.changed }}
123 changes: 123 additions & 0 deletions .github/workflows/auto-seed-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Auto Seed Review Doc

on:
pull_request_target:
types: [opened, reopened, synchronize]

permissions:
contents: write
pull-requests: write

jobs:
seed-same-repo:
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
steps:
- name: Checkout PR branch (same-repo)
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Seed feedback doc into repo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR=${{ github.event.number }}
echo "Seeding review for PR#$PR (same-repo)"
python3 tools/review/seed_feedback_from_github.py \
--owner "${GITHUB_REPOSITORY%%/*}" --repo "${GITHUB_REPOSITORY##*/}" \
--pr "$PR" --out docs/code-reviews
- name: Commit and push
run: |
git config user.name "git-mind-bot"
git config user.email "gitmind-bot@example.com"
git add docs/code-reviews
if git diff --cached --quiet; then
echo "No changes to commit"; exit 0; fi
PR=${{ github.event.number }}
SHA=${{ github.event.pull_request.head.sha }}
git commit -m "chore(review): seed feedback for PR #$PR ($SHA)"
git push

seed-fork:
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
runs-on: ubuntu-latest
steps:
- name: Checkout fork branch (read-only)
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Try to seed and push to fork (if maintainers can modify)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITMIND_PR_WORKSHEET_BOT: ${{ secrets.GITMIND_PR_WORKSHEET_BOT }}
run: |
set -e
PR=${{ github.event.number }}
echo "Seeding review for PR#$PR (fork)"
# Ensure our tools exist (checked out fork branch may not have them in older forks)
if [ ! -f tools/review/seed_feedback_from_github.py ]; then
echo "Tools missing in fork, checking out base repo tools..."
mkdir -p _tools
git clone --depth=1 https://github.com/${GITHUB_REPOSITORY}.git _tools/base
cp -r _tools/base/tools/review . || true
fi
python3 tools/review/seed_feedback_from_github.py \
--owner "${GITHUB_REPOSITORY%%/*}" --repo "${GITHUB_REPOSITORY##*/}" \
--pr "$PR" --out docs/code-reviews
git config user.name "git-mind-bot"
git config user.email "gitmind-bot@example.com"
git add docs/code-reviews
if git diff --cached --quiet; then
echo "No seeded changes to commit"; exit 0; fi
git commit -m "chore(review): seed feedback for PR #$PR"
# Attempt to push using GITMIND_PR_WORKSHEET_BOT if provided and contributor allows edits
if [ -n "$GITMIND_PR_WORKSHEET_BOT" ]; then
repo_full="${{ github.event.pull_request.head.repo.full_name }}"
branch="${{ github.event.pull_request.head.ref }}"
echo "Attempting push to fork $repo_full branch $branch"
git remote set-url origin https://x-access-token:$GITMIND_PR_WORKSHEET_BOT@github.com/$repo_full.git
if git push origin "HEAD:$branch"; then
echo "Pushed seeded doc to fork branch"
exit 0
else
echo "Push to fork failed (likely edits not allowed); will upload artifact instead"
fi
else
echo "GITMIND_PR_WORKSHEET_BOT not set; cannot push to fork. Uploading artifact instead."
fi
# Fall through to artifact path
mkdir -p review-seed && cp -r docs/code-reviews/* review-seed/ || true
Comment on lines +46 to +99

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.

⚠️ Potential issue

Critical: pull_request_target runs untrusted fork code with write-scoped token.

seed-fork checks out the fork and runs python3 tools/review/seed_feedback_from_github.py from the PR branch under pull_request_target with contents: write. This is a known RCE/secrets-exfil risk.

Run the seeding script from the base repo checkout only; never execute code from the fork. Example fix:

   seed-fork:
     if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
     runs-on: ubuntu-latest
     steps:
-      - name: Checkout fork branch (read-only)
-        uses: actions/checkout@v4
-        with:
-          repository: ${{ github.event.pull_request.head.repo.full_name }}
-          ref: ${{ github.event.pull_request.head.ref }}
+      - name: Checkout fork branch (read-only)
+        uses: actions/checkout@v4
+        with:
+          repository: ${{ github.event.pull_request.head.repo.full_name }}
+          ref: ${{ github.event.pull_request.head.ref }}
       - name: Set up Python
         uses: actions/setup-python@v5
         with:
           python-version: '3.x'
-      - name: Try to seed and push to fork (if maintainers can modify)
+      - name: Checkout base repo tools (trusted)
+        uses: actions/checkout@v4
+        with:
+          path: base
+          repository: ${{ github.repository }}
+          ref: ${{ github.sha }}
+      - name: Try to seed and push to fork (if maintainers can modify)
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           GITMIND_PR_WORKSHEET_BOT: ${{ secrets.GITMIND_PR_WORKSHEET_BOT }}
         run: |
           set -e
           PR=${{ github.event.number }}
           echo "Seeding review for PR#$PR (fork)"
-          # Ensure our tools exist (checked out fork branch may not have them in older forks)
-          if [ ! -f tools/review/seed_feedback_from_github.py ]; then
-            echo "Tools missing in fork, checking out base repo tools..."
-            mkdir -p _tools
-            git clone --depth=1 https://github.com/${GITHUB_REPOSITORY}.git _tools/base
-            cp -r _tools/base/tools/review . || true
-          fi
-          python3 tools/review/seed_feedback_from_github.py \
+          # Always use trusted script from base checkout
+          python3 base/tools/review/seed_feedback_from_github.py \
             --owner "${GITHUB_REPOSITORY%%/*}" --repo "${GITHUB_REPOSITORY##*/}" \
             --pr "$PR" --out docs/code-reviews
           git config user.name  "git-mind-bot"
           git config user.email "gitmind-bot@example.com"
           git add docs/code-reviews

Also consider dropping contents: write and only using the fork push path with the bot token.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
seed-fork:
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
runs-on: ubuntu-latest
steps:
- name: Checkout fork branch (read-only)
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Try to seed and push to fork (if maintainers can modify)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITMIND_PR_WORKSHEET_BOT: ${{ secrets.GITMIND_PR_WORKSHEET_BOT }}
run: |
set -e
PR=${{ github.event.number }}
echo "Seeding review for PR#$PR (fork)"
# Ensure our tools exist (checked out fork branch may not have them in older forks)
if [ ! -f tools/review/seed_feedback_from_github.py ]; then
echo "Tools missing in fork, checking out base repo tools..."
mkdir -p _tools
git clone --depth=1 https://github.com/${GITHUB_REPOSITORY}.git _tools/base
cp -r _tools/base/tools/review . || true
fi
python3 tools/review/seed_feedback_from_github.py \
--owner "${GITHUB_REPOSITORY%%/*}" --repo "${GITHUB_REPOSITORY##*/}" \
--pr "$PR" --out docs/code-reviews
git config user.name "git-mind-bot"
git config user.email "gitmind-bot@example.com"
git add docs/code-reviews
if git diff --cached --quiet; then
echo "No seeded changes to commit"; exit 0; fi
git commit -m "chore(review): seed feedback for PR #$PR"
# Attempt to push using GITMIND_PR_WORKSHEET_BOT if provided and contributor allows edits
if [ -n "$GITMIND_PR_WORKSHEET_BOT" ]; then
repo_full="${{ github.event.pull_request.head.repo.full_name }}"
branch="${{ github.event.pull_request.head.ref }}"
echo "Attempting push to fork $repo_full branch $branch"
git remote set-url origin https://x-access-token:$GITMIND_PR_WORKSHEET_BOT@github.com/$repo_full.git
if git push origin "HEAD:$branch"; then
echo "Pushed seeded doc to fork branch"
exit 0
else
echo "Push to fork failed (likely edits not allowed); will upload artifact instead"
fi
else
echo "GITMIND_PR_WORKSHEET_BOT not set; cannot push to fork. Uploading artifact instead."
fi
# Fall through to artifact path
mkdir -p review-seed && cp -r docs/code-reviews/* review-seed/ || true
seed-fork:
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
runs-on: ubuntu-latest
steps:
- name: Checkout fork branch (read-only)
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Checkout base repo tools (trusted)
uses: actions/checkout@v4
with:
path: base
repository: ${{ github.repository }}
ref: ${{ github.sha }}
- name: Try to seed and push to fork (if maintainers can modify)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITMIND_PR_WORKSHEET_BOT: ${{ secrets.GITMIND_PR_WORKSHEET_BOT }}
run: |
set -e
PR=${{ github.event.number }}
echo "Seeding review for PR#$PR (fork)"
# Always use trusted script from base checkout
python3 base/tools/review/seed_feedback_from_github.py \
--owner "${GITHUB_REPOSITORY%%/*}" --repo "${GITHUB_REPOSITORY##*/}" \
--pr "$PR" --out docs/code-reviews
git config user.name "git-mind-bot"
git config user.email "gitmind-bot@example.com"
git add docs/code-reviews
if git diff --cached --quiet; then
echo "No seeded changes to commit"; exit 0; fi
git commit -m "chore(review): seed feedback for PR #$PR"
# Attempt to push using GITMIND_PR_WORKSHEET_BOT if provided and contributor allows edits
if [ -n "$GITMIND_PR_WORKSHEET_BOT" ]; then
repo_full="${{ github.event.pull_request.head.repo.full_name }}"
branch="${{ github.event.pull_request.head.ref }}"
echo "Attempting push to fork $repo_full branch $branch"
git remote set-url origin https://x-access-token:$GITMIND_PR_WORKSHEET_BOT@github.com/$repo_full.git
if git push origin "HEAD:$branch"; then
echo "Pushed seeded doc to fork branch"
exit 0
else
echo "Push to fork failed (likely edits not allowed); will upload artifact instead"
fi
else
echo "GITMIND_PR_WORKSHEET_BOT not set; cannot push to fork. Uploading artifact instead."
fi
# Fall through to artifact path
mkdir -p review-seed && cp -r docs/code-reviews/* review-seed/ || true
🧰 Tools
🪛 actionlint (1.7.7)

63-63: "github.event.pull_request.head.ref" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions for more details

(expression)

🤖 Prompt for AI Agents
.github/workflows/auto-seed-review.yml lines 46-99: the job checks out the
contributor fork and then executes tools/review/seed_feedback_from_github.py
from that fork (untrusted code) while using a write-scoped token — a secrets/RCE
risk; fix by ensuring the workflow uses the base repository’s checked-out tools
to run the seeding script instead of any files from the fork (e.g., checkout
base repo or a trusted tools path first and invoke that script), and remove or
avoid using the workflow-level contents: write permission for untrusted
checkouts — prefer using the bot token only for pushing to the fork (or upload
artifacts) so execution never runs fork-supplied code.

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: review-seed-PR${{ github.event.number }}
path: review-seed/**
- name: Comment with instructions
uses: actions/github-script@v7
with:
script: |
const pr = context.payload.pull_request.number;
const msg = `I've generated a seeded review worksheet as an artifact for this PR (forked branch).

Steps:
1. Download the 'review-seed-PR${pr}' artifact from this workflow run.
2. Copy the file under 'docs/code-reviews/PR${pr}/<sha>.md' into your branch.
3. Fill in {response} sections with Accepted/Rejected templates and push.

Maintainers: merging PR branches into the main repo will allow auto-commit of future seeds.`;
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pr,
body: msg
});
18 changes: 18 additions & 0 deletions .github/workflows/label-docs-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Label docs-only PRs

on:
pull_request_target:
types: [opened, synchronize, reopened]

permissions:
contents: read
pull-requests: write

jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/labeler.yml
32 changes: 32 additions & 0 deletions .github/workflows/seed-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Seed Review Doc (manual)
permissions:
contents: read

on:
workflow_dispatch:
inputs:
pr:
description: PR number to seed
required: true
type: number

jobs:
seed:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Run seeding script
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python3 tools/review/seed_feedback_from_github.py \
--owner ${GITHUB_REPOSITORY%%/*} --repo ${GITHUB_REPOSITORY##*/} --pr ${{ inputs.pr }} --out review-seed
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: review-seed
path: review-seed/**
Comment thread Fixed
32 changes: 32 additions & 0 deletions .github/workflows/update-features-ledger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Update Features Ledger

on:
push:
branches: [ main ]
paths:
- 'docs/features/Features_Ledger.md'
- 'README.md'
- 'scripts/update_progress.py'

permissions:
contents: write

jobs:
update-ledger:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update progress
run: |
python3 scripts/update_progress.py
- name: Commit changes if any
run: |
git config user.name "git-mind-bot"
git config user.email "gitmind-bot@example.com"
git add README.md docs/features/Features_Ledger.md
if git diff --cached --quiet; then
echo "No progress changes"; exit 0; fi
git commit -m "chore(ledger): auto-update features progress"
git push
Loading
Loading