feat(harness): resolve declarative resources from URL-referenced bases - #2690
Conversation
PR Summary by QodoResolve URL-base declarative resources during harness composition Description
Diagram
High-Level Assessment
Files changed (4)
|
Site previewPreview: https://1569ae12-site.fullsend-ai.workers.dev Commit: |
|
🤖 Finished Review · ✅ Success · Started 12:51 PM UTC · Completed 1:05 PM UTC |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Code Review by Qodo
1. Skill type breaks lock
|
|
Looks good to me Previous runReviewFindingsMedium
Previous run (2)ReviewFindingsMedium
Labels: PR modifies harness base composition in internal/harness/ with a new feature for declarative resource resolution. |
805a901 to
226bc94
Compare
|
🤖 Finished Review · ✅ Success · Started 1:23 PM UTC · Completed 1:38 PM UTC |
Signed-off-by: Greg Allen <gallen@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Greg Allen <gallen@redhat.com>
226bc94 to
287b105
Compare
|
🤖 Finished Review · ✅ Success · Started 1:46 PM UTC · Completed 1:58 PM UTC |
|
🤖 Finished Retro · ✅ Success · Started 2:32 PM UTC · Completed 2:37 PM UTC |
ralphbean
left a comment
There was a problem hiding this comment.
I think this needs a change before we can merge. See inline comments.
| // Skills are directories containing at minimum a SKILL.md file. The file is | ||
| // fetched from <baseURLDir>/<skillPath>/SKILL.md, cached as a directory via | ||
| // CachePutDir, and the local tree directory path is returned. | ||
| func fetchBaseSkill(ctx context.Context, field, baseURLDir, skillPath string, allowlist []string, opts ComposeOpts) (Dependency, string, error) { |
There was a problem hiding this comment.
[important] fetchBaseSkill only fetches SKILL.md, which means skills with companion files (sub-agents, scripts, meta-prompts) silently lose those files when inherited through a URL base.
For context, the scaffold's skills/pr-review/ has 9 files:
skills/pr-review/
SKILL.md
meta-prompt.md
sub-agents/
challenger.md
correctness.md
cross-repo-contracts.md
docs-currency.md
intent-coherence.md
security.md
style-conventions.md
Today this works because the dispatch workflow layers the scaffold into the workspace (the "Prepare workspace" step in reusable-review.yml copies the full directory tree). But if someone points a URL base at a harness referencing multi-file skills without that scaffold layering, the skill appears to resolve but the agent won't have the companion files at runtime.
The function comment says "skills with companion files must use forge-format URLs resolved by ResolveHarness instead" — but nothing warns the user when this limitation kicks in. Could we either fetch companion files (maybe by convention, or via a manifest), or at minimum emit a warning when a skill directory is cached with only SKILL.md?
| // Should have exactly one dependency: the URL base. | ||
| require.Len(t, entry.Dependencies, 1) | ||
| // Dependencies: base + agent resource + skill resource | ||
| require.Len(t, entry.Dependencies, 3) |
There was a problem hiding this comment.
[minor] (non-blocking) The count went from 1 to 3 but only deps[0] is asserted on. The compose_test.go tests check Field and Type for each new dep — would it make sense to do the same here so the integration test verifies the right deps, not just the right count?
| } | ||
| // Serve default content for declarative resource paths so | ||
| // resolveBaseResources succeeds in tests focused on scripts. | ||
| if strings.HasPrefix(r.URL.Path, "/agents/") || |
There was a problem hiding this comment.
[minor] (non-blocking) This catch-all serves # test resource for any /agents/, /policies/, or */SKILL.md path. If resolveBaseResources ever constructs a wrong URL (e.g., garbled prefix), script-focused tests would still pass because the server happily serves content for any matching prefix. The dedicated resource tests use precise setups, so it's not a problem today — just something to keep an eye on.
Retro: PR #2690 — resolve declarative resources from URL-referenced basesTimeline: Human PR by ggallen adding Review quality gap: The fullsend review agent identified "incomplete resource resolution" as a medium finding — noting tree hashes would differ — but failed to trace the Existing coverage considered: Issues #1525 (cross-file analysis), #1453 (escalate medium correctness findings), #1476 (request changes for correctness bugs), and #1444 (external tool catches what fullsend misses) are related but none specifically address enum-variant exhaustiveness checking. One proposal filed below. Proposals filed
|
Address PR fullsend-ai#2690 review feedback: fetchBaseSkill only fetches SKILL.md, silently losing companion files (sub-agents, scripts, meta-prompts). Emit a warning on the Dependency so CLI surfaces it during lock/run. Also strengthen lock_test.go assertions to verify all 3 deps (base, agent, skill) instead of only deps[0]. Signed-off-by: Greg Allen <gallen@redhat.com> Signed-off-by: Claude Opus 4.6 <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Address PR fullsend-ai#2690 review feedback: fetchBaseSkill only fetches SKILL.md, silently losing companion files (sub-agents, scripts, meta-prompts). Emit a warning on the Dependency so CLI surfaces it during lock/run. Also strengthen lock_test.go assertions to verify all 3 deps (base, agent, skill) instead of only deps[0]. Signed-off-by: Greg Allen <gallen@redhat.com> Signed-off-by: Claude Opus 4.6 <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Greg Allen <gallen@redhat.com>
Address PR fullsend-ai#2690 review feedback: fetchBaseSkill only fetches SKILL.md, silently losing companion files (sub-agents, scripts, meta-prompts). Emit a warning on the Dependency so CLI surfaces it during lock/run. Also strengthen lock_test.go assertions to verify all 3 deps (base, agent, skill) instead of only deps[0]. Signed-off-by: Greg Allen <gallen@redhat.com> Signed-off-by: Claude Opus 4.6 <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Greg Allen <gallen@redhat.com>
Summary
base:, declarative resources (agent, policy, skills) that are relative paths in the base now get fetched and cached locally during compositionresolveBaseScripts(PR-2525); declarative resources were left as relative paths, which would failValidateFilesExistbecause the files live in the remote repo, not locallyChanges
fetchBaseScript→fetchBaseFilewithdepType/executableparams to avoid code duplicationvalidateBaseScriptPath→validateBaseRelPath(shared validation)auditScriptFetch→auditBaseFetchwith configurable fetch typeresolveBaseResources()to fetch agent, policy, and skills from URL basesCachePutDirto create cached directory trees containingSKILL.mdTest plan
internal/harnesstests pass with updated assertionsinternal/clitests pass (lock_test.go, run_test.go)internal/...test suite passesresolveBaseResources: 96.3%)🤖 Generated with Claude Code