fix(#3640): directory-level fetching for pre/post scripts - #5688
Conversation
|
🤖 Finished Review · ✅ Success · Started 6:54 PM UTC · Completed 7:11 PM UTC |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Looks good to me Previous runReviewFindingsHigh
Low
Next steps:
Previous run (2)ReviewFindingsMedium
Low
Labels: PR modifies internal/harness/compose.go — harness compose subsystem Previous run (3)ReviewFindingsMedium
Low
Labels: PR modifies internal/harness/compose.go — harness compose subsystem |
f624b3e to
c4c1f83
Compare
Site previewPreview: https://2d650df2-site.fullsend-ai.workers.dev Commit: |
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 8:11 PM UTC · Completed 8:25 PM UTC |
c4c1f83 to
2b928f3
Compare
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 8:38 PM UTC · Completed 8:57 PM UTC |
2b928f3 to
6a92ff4
Compare
|
/fs-review |
Signed-off-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Greg Allen <gallen@redhat.com>
6a92ff4 to
b963c6e
Compare
|
/fs-review |
|
🤖 Finished Review · ✅ Success · Started 1:15 AM UTC · Completed 1:30 AM UTC |
Superseded by updated review
rh-hemartin
left a comment
There was a problem hiding this comment.
LGTM but I think there is overlap with script composition over at fullsend-ai/agents, we need a followup issue to decide which are we going with.
Follow-up items (for retro bot)This PR fixes the immediate breakage by adding directory-level fetching for pre/post scripts that have companion files (e.g., Python scripts invoked via subprocess). There are longer-term approaches that should replace or complement this:
|
|
🤖 Finished Retro · ✅ Success · Started 1:23 PM UTC · Completed 1:46 PM UTC |
Retro: PR #5688 — directory-level fetching for pre/post scriptsOverall assessment: This workflow went well. The review agent delivered high-quality findings (100% true positive rate across 3 review passes), and the code agent produced a working 787-line implementation with comprehensive tests on its second attempt. All identified gaps are already tracked in existing open issues. No new proposals are warranted. Timeline
Review qualityStrengths: Zero false positives. All 5 actionable findings were real bugs that ggallen confirmed and fixed. The multi-pass review was essential — the HIGH-severity lock.go consumer gap was only caught on the second pass after the initial compose.go issues were resolved. Gap: The first review missed the lock.go consumer-completeness issue despite lock.go being in the diff. This required an additional fix-review cycle. Autonomy readinessThe review agent performed exceptionally on tactical correctness: every finding was real, well-calibrated in severity, and included actionable suggested fixes. Human review added strategic value that the agent structurally cannot provide — rh-hemartin's cross-repo architectural observation about overlap with Evidence for existing issues (no new proposals needed)
|
Post-scripts run via childScriptEnv(h.RunnerEnv, traceparent) which merges os.Environ() with RunnerEnv but does not include FULLSEND_OUTPUT_SCHEMA from h.ValidationLoop.Schema. After PR #5688 introduced directory-level script caching, the schemas/ directory is no longer co-located with scripts/ in the cache, so process-fix-result.py's relative-path fallback broke. Extract the schema injection into a postScriptEnv helper (matching the existing validationEnv pattern) so the conditional is testable without duplicating production logic. exec.Cmd uses last-value-wins semantics, so the appended entry correctly overrides any stale process env value. Closes #5722 Signed-off-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Greg Allen <gallen@redhat.com>
Post-scripts run via childScriptEnv(h.RunnerEnv, traceparent) which merges os.Environ() with RunnerEnv but does not include FULLSEND_OUTPUT_SCHEMA from h.ValidationLoop.Schema. After PR #5688 introduced directory-level script caching, the schemas/ directory is no longer co-located with scripts/ in the cache, so process-fix-result.py's relative-path fallback broke. Extract the schema injection into a postScriptEnv helper (matching the existing validationEnv pattern) so the conditional is testable without duplicating production logic. exec.Cmd uses last-value-wins semantics, so the appended entry correctly overrides any stale process env value. Closes #5722 Signed-off-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Greg Allen <gallen@redhat.com>
Summary
Extend
resolveBaseScriptsincompose.goto support directory-level fetching for pre/post scripts, analogous to howfetchBaseSkillhandles skills with companion files. This prevents the recurring companion-file breakage pattern (#2705, #3182, #3069/PR #3393) where scripts that reference sibling files viaBASH_SOURCE-relative paths fail becausefetchBaseFileisolates each script in its own content-addressed cache entry.Related Issue
Fixes #3640
Changes
fetchBaseScriptOrDirfunction that wraps script fetching with directory-level fetch logic when the URL is parseable byforge.ParseRawContentURL(i.e.,raw.githubusercontent.comURLs)fetchBaseScriptDirTreefunction (analogous tofetchBaseSkillDir) that usesTreeFetcher(git sparse checkout) to fetch the full script directory, caches it withCachePutDir, and makes all files executablescriptdir:<dirURL>so sibling scripts in the same directory share a single tree fetch — the second script hits the cache populated by the firstfetchBaseFilefor non-raw.githubusercontent.com URLs and scripts without a directory component (backward compatible)resolveBaseScriptsto callfetchBaseScriptOrDirinstead offetchBaseFilefor all script fields (pre_script, post_script, validation_loop.script, forge scripts)Testing
TestFetchBaseScriptOrDir_DirectoryFetch— verifies companion files are co-locatedTestFetchBaseScriptOrDir_SiblingCacheHit— verifies cache sharing between sibling scriptsTestFetchBaseScriptOrDir_FallbackToSingleFile— verifies fallback for non-raw URLsTestFetchBaseScriptOrDir_NoDirComponent— verifies scripts without directory componentsTestFetchBaseScriptOrDir_CompanionExecutable— verifies all files are made executablemake lint— pre-commit could not run due to sandbox network restrictions (git fetch origin --tags returned 403); post-script runs authoritative checkChecklist
!for breaking changes)Closes #3640
Post-script verification
agent/3640-dir-fetch-scripts-v2)b4fd4ae8b290e94e2a8c22918621146e28e92182..HEAD)