Commit 7d76ee8
* chore: add go-git dependency for repo sync
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(audit): add git.sync.* actions
* feat(repo/sync): add Driver interface
* feat(repo/sync): add NoopDriver
* feat(repo/sync): add YAML file discovery
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(repo): add Store.UpdateSyncState
Adds UpdateSyncState(ctx, id, sha, syncErr) to the repo Store so the
sync engine (Task 7) can record the SHA, timestamp, and error summary
into git_repos.last_sync_* after each attempt. Empty syncErr is stored
as NULL, clearing any previous failure on a successful sync.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(repo/sync): add sync engine orchestrator
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(repo/sync): add GoGitDriver
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(repo/sync): add startup reconciliation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(repo/sync): add Poller background loop
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(cli): add mantle repos sync
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(server): reconcile git_sync repos and launch poller at startup
On `mantle serve`, after the lifecycle context is established: reconcile
all git_sync.repos entries from config into the DB (fatal on mismatch),
then launch a Poller with GoGitDriver rooted at <storage.path>/git (or
a tmp fallback). The poller goroutine exits cleanly when ctx is cancelled.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: document mantle repos sync and the sync lifecycle
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: address pre-push reviewer feedback for git sync engine
- Clarify mantle repos Long now that sync ships
- Split ActionGitSyncValidationFailed (parse) from ActionGitSyncApplyFailed (save)
- Wire secret resolver into GoGitDriver.Auth for poller and CLI
- Add NewAuthResolver helper with HTTPS token support
- Document Poller single-snapshot behavior
- Expand --from-dir help and auto_apply:false status hint
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(sync): skip non-regular files in Discover to resolve G122
filepath.WalkDir can encounter symlinks; reading via the symlink path
is TOCTOU-prone (CWE-367, gosec G122). Checking d.Type().IsRegular()
before os.ReadFile skips symlinks, device files, and other non-regular
entries, which are not valid workflow YAML anyway.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* ci: retrigger
* fix(test): correct reposCtx call site after rebase
* fix(sync): use os.Root for YAML discovery to resolve G122 and Govulncheck
Gosec G122 (CWE-367) fires on os.ReadFile(path) inside filepath.WalkDir
because the string path is race-prone (symlink TOCTOU). The fix opens the
target directory via os.OpenRoot (Go 1.24+) which uses openat-style
syscalls, then reads each file relative to that root — eliminating the
TOCTOU window without changing the traversal logic.
Also adds 10 go-git transitive dependency vulnerabilities to the
govulncheck exclusion list. govulncheck confirms the call chains are not
reachable from application code ("your code doesn't appear to call").
Track upstream at github.com/go-git/go-git and remove exclusions when
go-git ships fixed dependency versions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Michael McNees <mmcnees@Michaels-MacBook-Pro.local>
1 parent ae7254f commit 7d76ee8
25 files changed
Lines changed: 1603 additions & 71 deletions
File tree
- .github/workflows
- packages/engine
- internal
- audit
- cli
- repo
- sync
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
82 | | - | |
| 88 | + | |
| 89 | + | |
83 | 90 | | |
84 | 91 | | |
85 | 92 | | |
86 | | - | |
| 93 | + | |
87 | 94 | | |
88 | 95 | | |
89 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| |||
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
117 | | - | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
45 | | - | |
46 | 48 | | |
47 | | - | |
48 | | - | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| 75 | + | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
78 | | - | |
79 | 81 | | |
80 | 82 | | |
| 83 | + | |
81 | 84 | | |
82 | 85 | | |
| 86 | + | |
| 87 | + | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | 92 | | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
100 | | - | |
| 102 | + | |
| 103 | + | |
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
105 | | - | |
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
| |||
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
| 121 | + | |
119 | 122 | | |
120 | 123 | | |
121 | 124 | | |
| |||
124 | 127 | | |
125 | 128 | | |
126 | 129 | | |
| 130 | + | |
127 | 131 | | |
128 | 132 | | |
129 | 133 | | |
| 134 | + | |
130 | 135 | | |
131 | 136 | | |
132 | 137 | | |
133 | 138 | | |
134 | 139 | | |
135 | | - | |
136 | 140 | | |
137 | 141 | | |
| 142 | + | |
138 | 143 | | |
139 | 144 | | |
140 | 145 | | |
| |||
147 | 152 | | |
148 | 153 | | |
149 | 154 | | |
150 | | - | |
151 | 155 | | |
152 | 156 | | |
153 | 157 | | |
154 | | - | |
155 | 158 | | |
156 | | - | |
157 | 159 | | |
158 | 160 | | |
159 | 161 | | |
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
163 | | - | |
| 165 | + | |
164 | 166 | | |
0 commit comments