Skip to content

[Stepping] FRAMEWORK: integrate artifact-only specialist deliverables (fix silent drop) - #835

Merged
xiaofei-zheng merged 6 commits into
mainfrom
feature/leixin/fix-framework-artifacts-deliverable
Jul 10, 2026
Merged

xiaofei-zheng merged 6 commits into
mainfrom
feature/leixin/fix-framework-artifacts-deliverable

Conversation

@zengleixin-amd

@zengleixin-amd zengleixin-amd commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Net contribution vs main (three-dot, i.e. the GitHub PR diff): 7 files, +241 / -24. Two focused fixes in the FRAMEWORK authoring -> integrate_patch path so a specialist deliverable that ships a non-diff tuned artifact (e.g. an autotuned aiter tuned_fmoe CSV) is actually installed instead of being silently discarded.

Observed drop (Qwen3-30B-A3B run): the ROCm/aiter#4130 authoring specialist autotuned the missing cu_num=304 FP8 FMOE rows (11-21% faster MoE, err <=0.1%, install + tuned-kernel selection validated end-to-end) and returned them via artifacts_written, but the deliverable was stamped authored_empty and the CSV was never integrated.

Changes

1. Route artifacts-only deliverables to integrate_patch (94398f51)

Both post-specialist bridges keyed only on patches_written (+ config levers):

  • _maybe_autosubmit_specialist_patches (explore.py) early-returned on empty patches_written, so an artifacts-only deliverable was never surfaced to integrate_patch - even though integrate_patch already installs artifacts_written (backup + gate + REVERT).
  • _record_framework_agent_authoring_empty_outcome (framework.py) then stamped authored_empty, discarding the tuned kernels.

Fix: add a shared routable-signal _resolvable_artifacts_from_done (coordinator.py) keyed on source-file existence, used by BOTH bridges so they agree exactly (no FRAMEWORK livelock): autosubmit now routes artifacts-only deliverables; the empty-outcome bridge skips stamping only when the artifacts are actually routable (else it must still stamp, to avoid re-dispatch livelock).

2. Accept absolute artifact targets inside an allowlisted root (6fb90a1f)

Specialists frequently author artifacts_written.target as the full install path (e.g. /usr/.../aiter/configs/model_configs/x.csv) even though the prompt asks for a framework-relative path. _resolve_artifact_target (integrate_patch.py) rejected any absolute target, so a routed artifact was still dropped as target_unresolved.

Fix: accept an absolute target only when it resolves strictly inside an allowlisted framework root (same _is_within containment as the relative case; .. still rejected). Clarify the specialist prompt (specialist_prompt_builder.py): prefer a relative target, and a non-empty artifacts_written is a FULL result (empty=false).

Tests

  • test_framework_agent_authoring.py: empty-outcome skips for a routable artifact deliverable; still stamps when the artifact source file is missing (livelock guard).
  • test_integrate_patch_artifacts_unit.py: _resolve_artifact_target resolves an absolute-within-allowlist target; rejects absolute-outside-root and ..; relative path unchanged.

Test plan

  • pytest test_framework_agent_authoring.py - 31 passed
  • pytest test_coordinator_async_batch2_unit.py test_coordinator_async_methods_coverage_unit.py test_integrate_patch_artifacts_unit.py - 178 passed
  • pytest test_integrate_patch_coverage_unit.py test_integrate_patch_executor.py test_integrate_patch_helpers_unit.py test_framework_agent_reauthor.py - 139 passed
  • pytest test_specialist_prompt_builder.py test_specialist_prompt_builder_coverage_unit.py - 49 passed
  • Full CI (runs on push)

lzeng added 2 commits July 10, 2026 05:28
…rate_patch

An authoring specialist can deliver a non-diff tuned artifact (e.g. an
autotuned aiter tuned_fmoe CSV) via artifacts_written instead of a source
patch. Both the autosubmit bridge (_maybe_autosubmit_specialist_patches) and
the empty-outcome bridge (_record_framework_agent_authoring_empty_outcome)
keyed only on patches_written (+ config levers), so an artifacts-only
deliverable was never routed to integrate_patch (which already installs
artifacts_written) and was stamped authored_empty — silently discarding the
tuned kernels (observed: ROCm/aiter#4130 cu_num=304 FP8 FMOE rows, 11-21%
faster MoE, dropped).

Add a shared _resolvable_artifacts_from_done signal (source-file existence)
used by both bridges so they agree exactly (no FRAMEWORK livelock): autosubmit
now routes artifacts-only deliverables, and the empty-outcome bridge skips
stamping only when the artifacts are actually routable. Adds regression tests.
…wlisted root

Specialists often author artifacts_written targets as the full install path
(e.g. /usr/.../aiter/configs/model_configs/x.csv) even though the prompt asks
for a framework-relative path. _resolve_artifact_target rejected any absolute
target, so a routed artifact was still dropped as target_unresolved. Accept an
absolute target only when it resolves strictly inside an allowlisted framework
root (same _is_within containment as relative; ".." still rejected). Clarify
the specialist prompt: prefer a relative target, and a non-empty
artifacts_written is a full result (empty=false). Adds regression tests.
@zengleixin-amd
zengleixin-amd requested a review from a team as a code owner July 10, 2026 07:32
lzeng added 4 commits July 10, 2026 11:11
…te artifact targets

Follow-up to the absolute-target support: _resolve_artifact_target now returns
(absolute_target, framework_relative_target) and _resolve_artifact_specs
persists the relative form as _ArtifactSpec.rel_target. Previously an absolute
target kept the raw absolute string in rel_target, so the KEEP source snapshot
(snapshot_source_layer treats rel_target as framework-relative) failed to
capture the installed artifact - the KEEP would not survive resume / GEAK
handoff / current_best relaunch. Adds a regression test asserting the
framework-relative rel_target for an absolute target.
Follow-up from the PR #835 review of the artifact-only deliverable routing:

- Tighten the shared routable-signal (_resolvable_artifacts_from_done) to
  accept an ABSOLUTE artifact source only when it resolves inside the
  specialist sandbox (worktree/workspace), matching integrate_patch's
  _resolve_artifact_specs. Prevents autosubmit from burning a round routing a
  deliverable integrate_patch would reject as source_outside_workspace.
- Document the intentional trade-off that this pure signal validates source
  only and leaves target/allowlist containment to integrate_patch (terminal
  no_patches row, no livelock).
- Record artifacts_written install targets in the autosubmit observation so an
  artifact-only route (empty patches_written) is not silently blank.
- Refresh the stale FRAMEWORK empty-outcome comment (autosubmit now routes on
  patches OR config levers OR tuned artifacts) and the _ArtifactSpec.rel_target
  docstring (now normalized framework-relative, used as the KEEP snapshot key).
- Tests: artifact-only autosubmit creates an integrate_patch proposal
  (aiter#4130 direct path); absolute source outside sandbox is not routed.
Review follow-up to ab8ed86: the earlier tightening added sandbox
containment only for ABSOLUTE artifact sources. A RELATIVE source that
escaped via `..` (e.g. `../../x.csv`) still passed the shared
routable-signal because `(base / source).is_file()` follows `..` on
disk, while integrate_patch's _resolve_artifact_specs rejects it as
source_outside_workspace — so autosubmit still burned a round routing a
deliverable that was guaranteed to fail (and empty-outcome skip-stamped it).

- Unify _resolvable_artifacts_from_done: every source (relative OR absolute)
  is routable only when it resolves to a real file that stays INSIDE a
  resolve_base, matching integrate_patch's containment for both cases.
- Docstring: source containment now covers relative `..` escapes; soften the
  "agree exactly" claim to document the pre-existing payload-view caveat
  (autosubmit reads outer specialist_done, empty-outcome reads the unwrapped
  payload) that the patches_written / config-lever routing already relies on.
- Tests: relative-`..`-escape source is not routed by autosubmit; the
  FRAMEWORK empty-outcome bridge stamps a terminal row for an out-of-sandbox
  source (parity coverage, not just absolute).
Minor review cleanup on the artifact routing signal (no behavior change):
- Resolve the sandbox bases once outside the per-entry loop instead of per
  entry, and add a NOTE documenting that scanning ALL bases (vs
  integrate_patch's first-existing-base) is fail-safe: never stricter than
  integrate_patch's accept, so an installable artifact is never dropped.
- Add a regression test that a relative `../file` source which climbs out of
  the worktree but lands inside the workspace stays routable (guards the
  not-too-strict direction).
@xiaofei-zheng
xiaofei-zheng merged commit 71d6c06 into main Jul 10, 2026
10 checks passed
@xiaofei-zheng
xiaofei-zheng deleted the feature/leixin/fix-framework-artifacts-deliverable branch July 10, 2026 13:00
xiaofei-zheng pushed a commit that referenced this pull request Jul 11, 2026
… (fix silent drop) (#835)

* fix(framework): route artifacts-only specialist deliverables to integrate_patch

An authoring specialist can deliver a non-diff tuned artifact (e.g. an
autotuned aiter tuned_fmoe CSV) via artifacts_written instead of a source
patch. Both the autosubmit bridge (_maybe_autosubmit_specialist_patches) and
the empty-outcome bridge (_record_framework_agent_authoring_empty_outcome)
keyed only on patches_written (+ config levers), so an artifacts-only
deliverable was never routed to integrate_patch (which already installs
artifacts_written) and was stamped authored_empty — silently discarding the
tuned kernels (observed: ROCm/aiter#4130 cu_num=304 FP8 FMOE rows, 11-21%
faster MoE, dropped).

Add a shared _resolvable_artifacts_from_done signal (source-file existence)
used by both bridges so they agree exactly (no FRAMEWORK livelock): autosubmit
now routes artifacts-only deliverables, and the empty-outcome bridge skips
stamping only when the artifacts are actually routable. Adds regression tests.

* fix(integrate_patch): accept absolute artifact targets inside an allowlisted root

Specialists often author artifacts_written targets as the full install path
(e.g. /usr/.../aiter/configs/model_configs/x.csv) even though the prompt asks
for a framework-relative path. _resolve_artifact_target rejected any absolute
target, so a routed artifact was still dropped as target_unresolved. Accept an
absolute target only when it resolves strictly inside an allowlisted framework
root (same _is_within containment as relative; ".." still rejected). Clarify
the specialist prompt: prefer a relative target, and a non-empty
artifacts_written is a full result (empty=false). Adds regression tests.

* fix(integrate_patch): record framework-relative rel_target for absolute artifact targets

Follow-up to the absolute-target support: _resolve_artifact_target now returns
(absolute_target, framework_relative_target) and _resolve_artifact_specs
persists the relative form as _ArtifactSpec.rel_target. Previously an absolute
target kept the raw absolute string in rel_target, so the KEEP source snapshot
(snapshot_source_layer treats rel_target as framework-relative) failed to
capture the installed artifact - the KEEP would not survive resume / GEAK
handoff / current_best relaunch. Adds a regression test asserting the
framework-relative rel_target for an absolute target.

* fix(framework): harden artifact-only routing signal + refresh stale docs

Follow-up from the PR #835 review of the artifact-only deliverable routing:

- Tighten the shared routable-signal (_resolvable_artifacts_from_done) to
  accept an ABSOLUTE artifact source only when it resolves inside the
  specialist sandbox (worktree/workspace), matching integrate_patch's
  _resolve_artifact_specs. Prevents autosubmit from burning a round routing a
  deliverable integrate_patch would reject as source_outside_workspace.
- Document the intentional trade-off that this pure signal validates source
  only and leaves target/allowlist containment to integrate_patch (terminal
  no_patches row, no livelock).
- Record artifacts_written install targets in the autosubmit observation so an
  artifact-only route (empty patches_written) is not silently blank.
- Refresh the stale FRAMEWORK empty-outcome comment (autosubmit now routes on
  patches OR config levers OR tuned artifacts) and the _ArtifactSpec.rel_target
  docstring (now normalized framework-relative, used as the KEEP snapshot key).
- Tests: artifact-only autosubmit creates an integrate_patch proposal
  (aiter#4130 direct path); absolute source outside sandbox is not routed.

* fix(framework): full source-sandbox parity for artifact routing signal

Review follow-up to c27301f8: the earlier tightening added sandbox
containment only for ABSOLUTE artifact sources. A RELATIVE source that
escaped via `..` (e.g. `../../x.csv`) still passed the shared
routable-signal because `(base / source).is_file()` follows `..` on
disk, while integrate_patch's _resolve_artifact_specs rejects it as
source_outside_workspace — so autosubmit still burned a round routing a
deliverable that was guaranteed to fail (and empty-outcome skip-stamped it).

- Unify _resolvable_artifacts_from_done: every source (relative OR absolute)
  is routable only when it resolves to a real file that stays INSIDE a
  resolve_base, matching integrate_patch's containment for both cases.
- Docstring: source containment now covers relative `..` escapes; soften the
  "agree exactly" claim to document the pre-existing payload-view caveat
  (autosubmit reads outer specialist_done, empty-outcome reads the unwrapped
  payload) that the patches_written / config-lever routing already relies on.
- Tests: relative-`..`-escape source is not routed by autosubmit; the
  FRAMEWORK empty-outcome bridge stamps a terminal row for an out-of-sandbox
  source (parity coverage, not just absolute).

* refactor(framework): hoist artifact sandbox-base resolution + guard test

Minor review cleanup on the artifact routing signal (no behavior change):
- Resolve the sandbox bases once outside the per-entry loop instead of per
  entry, and add a NOTE documenting that scanning ALL bases (vs
  integrate_patch's first-existing-base) is fail-safe: never stricter than
  integrate_patch's accept, so an installable artifact is never dropped.
- Add a regression test that a relative `../file` source which climbs out of
  the worktree but lands inside the workspace stays routable (guards the
  not-too-strict direction).

---------

Co-authored-by: lzeng <[email protected]>
xiaofei-zheng pushed a commit that referenced this pull request Jul 17, 2026
… (fix silent drop) (#835)

* fix(framework): route artifacts-only specialist deliverables to integrate_patch

An authoring specialist can deliver a non-diff tuned artifact (e.g. an
autotuned aiter tuned_fmoe CSV) via artifacts_written instead of a source
patch. Both the autosubmit bridge (_maybe_autosubmit_specialist_patches) and
the empty-outcome bridge (_record_framework_agent_authoring_empty_outcome)
keyed only on patches_written (+ config levers), so an artifacts-only
deliverable was never routed to integrate_patch (which already installs
artifacts_written) and was stamped authored_empty — silently discarding the
tuned kernels (observed: ROCm/aiter#4130 cu_num=304 FP8 FMOE rows, 11-21%
faster MoE, dropped).

Add a shared _resolvable_artifacts_from_done signal (source-file existence)
used by both bridges so they agree exactly (no FRAMEWORK livelock): autosubmit
now routes artifacts-only deliverables, and the empty-outcome bridge skips
stamping only when the artifacts are actually routable. Adds regression tests.

* fix(integrate_patch): accept absolute artifact targets inside an allowlisted root

Specialists often author artifacts_written targets as the full install path
(e.g. /usr/.../aiter/configs/model_configs/x.csv) even though the prompt asks
for a framework-relative path. _resolve_artifact_target rejected any absolute
target, so a routed artifact was still dropped as target_unresolved. Accept an
absolute target only when it resolves strictly inside an allowlisted framework
root (same _is_within containment as relative; ".." still rejected). Clarify
the specialist prompt: prefer a relative target, and a non-empty
artifacts_written is a full result (empty=false). Adds regression tests.

* fix(integrate_patch): record framework-relative rel_target for absolute artifact targets

Follow-up to the absolute-target support: _resolve_artifact_target now returns
(absolute_target, framework_relative_target) and _resolve_artifact_specs
persists the relative form as _ArtifactSpec.rel_target. Previously an absolute
target kept the raw absolute string in rel_target, so the KEEP source snapshot
(snapshot_source_layer treats rel_target as framework-relative) failed to
capture the installed artifact - the KEEP would not survive resume / GEAK
handoff / current_best relaunch. Adds a regression test asserting the
framework-relative rel_target for an absolute target.

* fix(framework): harden artifact-only routing signal + refresh stale docs

Follow-up from the PR #835 review of the artifact-only deliverable routing:

- Tighten the shared routable-signal (_resolvable_artifacts_from_done) to
  accept an ABSOLUTE artifact source only when it resolves inside the
  specialist sandbox (worktree/workspace), matching integrate_patch's
  _resolve_artifact_specs. Prevents autosubmit from burning a round routing a
  deliverable integrate_patch would reject as source_outside_workspace.
- Document the intentional trade-off that this pure signal validates source
  only and leaves target/allowlist containment to integrate_patch (terminal
  no_patches row, no livelock).
- Record artifacts_written install targets in the autosubmit observation so an
  artifact-only route (empty patches_written) is not silently blank.
- Refresh the stale FRAMEWORK empty-outcome comment (autosubmit now routes on
  patches OR config levers OR tuned artifacts) and the _ArtifactSpec.rel_target
  docstring (now normalized framework-relative, used as the KEEP snapshot key).
- Tests: artifact-only autosubmit creates an integrate_patch proposal
  (aiter#4130 direct path); absolute source outside sandbox is not routed.

* fix(framework): full source-sandbox parity for artifact routing signal

Review follow-up to c27301f8: the earlier tightening added sandbox
containment only for ABSOLUTE artifact sources. A RELATIVE source that
escaped via `..` (e.g. `../../x.csv`) still passed the shared
routable-signal because `(base / source).is_file()` follows `..` on
disk, while integrate_patch's _resolve_artifact_specs rejects it as
source_outside_workspace — so autosubmit still burned a round routing a
deliverable that was guaranteed to fail (and empty-outcome skip-stamped it).

- Unify _resolvable_artifacts_from_done: every source (relative OR absolute)
  is routable only when it resolves to a real file that stays INSIDE a
  resolve_base, matching integrate_patch's containment for both cases.
- Docstring: source containment now covers relative `..` escapes; soften the
  "agree exactly" claim to document the pre-existing payload-view caveat
  (autosubmit reads outer specialist_done, empty-outcome reads the unwrapped
  payload) that the patches_written / config-lever routing already relies on.
- Tests: relative-`..`-escape source is not routed by autosubmit; the
  FRAMEWORK empty-outcome bridge stamps a terminal row for an out-of-sandbox
  source (parity coverage, not just absolute).

* refactor(framework): hoist artifact sandbox-base resolution + guard test

Minor review cleanup on the artifact routing signal (no behavior change):
- Resolve the sandbox bases once outside the per-entry loop instead of per
  entry, and add a NOTE documenting that scanning ALL bases (vs
  integrate_patch's first-existing-base) is fail-safe: never stricter than
  integrate_patch's accept, so an installable artifact is never dropped.
- Add a regression test that a relative `../file` source which climbs out of
  the worktree but lands inside the workspace stays routable (guards the
  not-too-strict direction).

---------

Co-authored-by: lzeng <[email protected]>
xiaofei-zheng pushed a commit that referenced this pull request Jul 17, 2026
… (fix silent drop) (#835)

* fix(framework): route artifacts-only specialist deliverables to integrate_patch

An authoring specialist can deliver a non-diff tuned artifact (e.g. an
autotuned aiter tuned_fmoe CSV) via artifacts_written instead of a source
patch. Both the autosubmit bridge (_maybe_autosubmit_specialist_patches) and
the empty-outcome bridge (_record_framework_agent_authoring_empty_outcome)
keyed only on patches_written (+ config levers), so an artifacts-only
deliverable was never routed to integrate_patch (which already installs
artifacts_written) and was stamped authored_empty — silently discarding the
tuned kernels (observed: ROCm/aiter#4130 cu_num=304 FP8 FMOE rows, 11-21%
faster MoE, dropped).

Add a shared _resolvable_artifacts_from_done signal (source-file existence)
used by both bridges so they agree exactly (no FRAMEWORK livelock): autosubmit
now routes artifacts-only deliverables, and the empty-outcome bridge skips
stamping only when the artifacts are actually routable. Adds regression tests.

* fix(integrate_patch): accept absolute artifact targets inside an allowlisted root

Specialists often author artifacts_written targets as the full install path
(e.g. /usr/.../aiter/configs/model_configs/x.csv) even though the prompt asks
for a framework-relative path. _resolve_artifact_target rejected any absolute
target, so a routed artifact was still dropped as target_unresolved. Accept an
absolute target only when it resolves strictly inside an allowlisted framework
root (same _is_within containment as relative; ".." still rejected). Clarify
the specialist prompt: prefer a relative target, and a non-empty
artifacts_written is a full result (empty=false). Adds regression tests.

* fix(integrate_patch): record framework-relative rel_target for absolute artifact targets

Follow-up to the absolute-target support: _resolve_artifact_target now returns
(absolute_target, framework_relative_target) and _resolve_artifact_specs
persists the relative form as _ArtifactSpec.rel_target. Previously an absolute
target kept the raw absolute string in rel_target, so the KEEP source snapshot
(snapshot_source_layer treats rel_target as framework-relative) failed to
capture the installed artifact - the KEEP would not survive resume / GEAK
handoff / current_best relaunch. Adds a regression test asserting the
framework-relative rel_target for an absolute target.

* fix(framework): harden artifact-only routing signal + refresh stale docs

Follow-up from the PR #835 review of the artifact-only deliverable routing:

- Tighten the shared routable-signal (_resolvable_artifacts_from_done) to
  accept an ABSOLUTE artifact source only when it resolves inside the
  specialist sandbox (worktree/workspace), matching integrate_patch's
  _resolve_artifact_specs. Prevents autosubmit from burning a round routing a
  deliverable integrate_patch would reject as source_outside_workspace.
- Document the intentional trade-off that this pure signal validates source
  only and leaves target/allowlist containment to integrate_patch (terminal
  no_patches row, no livelock).
- Record artifacts_written install targets in the autosubmit observation so an
  artifact-only route (empty patches_written) is not silently blank.
- Refresh the stale FRAMEWORK empty-outcome comment (autosubmit now routes on
  patches OR config levers OR tuned artifacts) and the _ArtifactSpec.rel_target
  docstring (now normalized framework-relative, used as the KEEP snapshot key).
- Tests: artifact-only autosubmit creates an integrate_patch proposal
  (aiter#4130 direct path); absolute source outside sandbox is not routed.

* fix(framework): full source-sandbox parity for artifact routing signal

Review follow-up to c27301f8: the earlier tightening added sandbox
containment only for ABSOLUTE artifact sources. A RELATIVE source that
escaped via `..` (e.g. `../../x.csv`) still passed the shared
routable-signal because `(base / source).is_file()` follows `..` on
disk, while integrate_patch's _resolve_artifact_specs rejects it as
source_outside_workspace — so autosubmit still burned a round routing a
deliverable that was guaranteed to fail (and empty-outcome skip-stamped it).

- Unify _resolvable_artifacts_from_done: every source (relative OR absolute)
  is routable only when it resolves to a real file that stays INSIDE a
  resolve_base, matching integrate_patch's containment for both cases.
- Docstring: source containment now covers relative `..` escapes; soften the
  "agree exactly" claim to document the pre-existing payload-view caveat
  (autosubmit reads outer specialist_done, empty-outcome reads the unwrapped
  payload) that the patches_written / config-lever routing already relies on.
- Tests: relative-`..`-escape source is not routed by autosubmit; the
  FRAMEWORK empty-outcome bridge stamps a terminal row for an out-of-sandbox
  source (parity coverage, not just absolute).

* refactor(framework): hoist artifact sandbox-base resolution + guard test

Minor review cleanup on the artifact routing signal (no behavior change):
- Resolve the sandbox bases once outside the per-entry loop instead of per
  entry, and add a NOTE documenting that scanning ALL bases (vs
  integrate_patch's first-existing-base) is fail-safe: never stricter than
  integrate_patch's accept, so an installable artifact is never dropped.
- Add a regression test that a relative `../file` source which climbs out of
  the worktree but lands inside the workspace stays routable (guards the
  not-too-strict direction).

---------

Co-authored-by: lzeng <[email protected]>
xiaofei-zheng pushed a commit that referenced this pull request Jul 17, 2026
… (fix silent drop) (#835)

* fix(framework): route artifacts-only specialist deliverables to integrate_patch

An authoring specialist can deliver a non-diff tuned artifact (e.g. an
autotuned aiter tuned_fmoe CSV) via artifacts_written instead of a source
patch. Both the autosubmit bridge (_maybe_autosubmit_specialist_patches) and
the empty-outcome bridge (_record_framework_agent_authoring_empty_outcome)
keyed only on patches_written (+ config levers), so an artifacts-only
deliverable was never routed to integrate_patch (which already installs
artifacts_written) and was stamped authored_empty — silently discarding the
tuned kernels (observed: ROCm/aiter#4130 cu_num=304 FP8 FMOE rows, 11-21%
faster MoE, dropped).

Add a shared _resolvable_artifacts_from_done signal (source-file existence)
used by both bridges so they agree exactly (no FRAMEWORK livelock): autosubmit
now routes artifacts-only deliverables, and the empty-outcome bridge skips
stamping only when the artifacts are actually routable. Adds regression tests.

* fix(integrate_patch): accept absolute artifact targets inside an allowlisted root

Specialists often author artifacts_written targets as the full install path
(e.g. /usr/.../aiter/configs/model_configs/x.csv) even though the prompt asks
for a framework-relative path. _resolve_artifact_target rejected any absolute
target, so a routed artifact was still dropped as target_unresolved. Accept an
absolute target only when it resolves strictly inside an allowlisted framework
root (same _is_within containment as relative; ".." still rejected). Clarify
the specialist prompt: prefer a relative target, and a non-empty
artifacts_written is a full result (empty=false). Adds regression tests.

* fix(integrate_patch): record framework-relative rel_target for absolute artifact targets

Follow-up to the absolute-target support: _resolve_artifact_target now returns
(absolute_target, framework_relative_target) and _resolve_artifact_specs
persists the relative form as _ArtifactSpec.rel_target. Previously an absolute
target kept the raw absolute string in rel_target, so the KEEP source snapshot
(snapshot_source_layer treats rel_target as framework-relative) failed to
capture the installed artifact - the KEEP would not survive resume / GEAK
handoff / current_best relaunch. Adds a regression test asserting the
framework-relative rel_target for an absolute target.

* fix(framework): harden artifact-only routing signal + refresh stale docs

Follow-up from the PR #835 review of the artifact-only deliverable routing:

- Tighten the shared routable-signal (_resolvable_artifacts_from_done) to
  accept an ABSOLUTE artifact source only when it resolves inside the
  specialist sandbox (worktree/workspace), matching integrate_patch's
  _resolve_artifact_specs. Prevents autosubmit from burning a round routing a
  deliverable integrate_patch would reject as source_outside_workspace.
- Document the intentional trade-off that this pure signal validates source
  only and leaves target/allowlist containment to integrate_patch (terminal
  no_patches row, no livelock).
- Record artifacts_written install targets in the autosubmit observation so an
  artifact-only route (empty patches_written) is not silently blank.
- Refresh the stale FRAMEWORK empty-outcome comment (autosubmit now routes on
  patches OR config levers OR tuned artifacts) and the _ArtifactSpec.rel_target
  docstring (now normalized framework-relative, used as the KEEP snapshot key).
- Tests: artifact-only autosubmit creates an integrate_patch proposal
  (aiter#4130 direct path); absolute source outside sandbox is not routed.

* fix(framework): full source-sandbox parity for artifact routing signal

Review follow-up to c27301f8: the earlier tightening added sandbox
containment only for ABSOLUTE artifact sources. A RELATIVE source that
escaped via `..` (e.g. `../../x.csv`) still passed the shared
routable-signal because `(base / source).is_file()` follows `..` on
disk, while integrate_patch's _resolve_artifact_specs rejects it as
source_outside_workspace — so autosubmit still burned a round routing a
deliverable that was guaranteed to fail (and empty-outcome skip-stamped it).

- Unify _resolvable_artifacts_from_done: every source (relative OR absolute)
  is routable only when it resolves to a real file that stays INSIDE a
  resolve_base, matching integrate_patch's containment for both cases.
- Docstring: source containment now covers relative `..` escapes; soften the
  "agree exactly" claim to document the pre-existing payload-view caveat
  (autosubmit reads outer specialist_done, empty-outcome reads the unwrapped
  payload) that the patches_written / config-lever routing already relies on.
- Tests: relative-`..`-escape source is not routed by autosubmit; the
  FRAMEWORK empty-outcome bridge stamps a terminal row for an out-of-sandbox
  source (parity coverage, not just absolute).

* refactor(framework): hoist artifact sandbox-base resolution + guard test

Minor review cleanup on the artifact routing signal (no behavior change):
- Resolve the sandbox bases once outside the per-entry loop instead of per
  entry, and add a NOTE documenting that scanning ALL bases (vs
  integrate_patch's first-existing-base) is fail-safe: never stricter than
  integrate_patch's accept, so an installable artifact is never dropped.
- Add a regression test that a relative `../file` source which climbs out of
  the worktree but lands inside the workspace stays routable (guards the
  not-too-strict direction).

---------

Co-authored-by: lzeng <[email protected]>
xiaofei-zheng pushed a commit that referenced this pull request Jul 19, 2026
… (fix silent drop) (#835)

* fix(framework): route artifacts-only specialist deliverables to integrate_patch

An authoring specialist can deliver a non-diff tuned artifact (e.g. an
autotuned aiter tuned_fmoe CSV) via artifacts_written instead of a source
patch. Both the autosubmit bridge (_maybe_autosubmit_specialist_patches) and
the empty-outcome bridge (_record_framework_agent_authoring_empty_outcome)
keyed only on patches_written (+ config levers), so an artifacts-only
deliverable was never routed to integrate_patch (which already installs
artifacts_written) and was stamped authored_empty — silently discarding the
tuned kernels (observed: ROCm/aiter#4130 cu_num=304 FP8 FMOE rows, 11-21%
faster MoE, dropped).

Add a shared _resolvable_artifacts_from_done signal (source-file existence)
used by both bridges so they agree exactly (no FRAMEWORK livelock): autosubmit
now routes artifacts-only deliverables, and the empty-outcome bridge skips
stamping only when the artifacts are actually routable. Adds regression tests.

* fix(integrate_patch): accept absolute artifact targets inside an allowlisted root

Specialists often author artifacts_written targets as the full install path
(e.g. /usr/.../aiter/configs/model_configs/x.csv) even though the prompt asks
for a framework-relative path. _resolve_artifact_target rejected any absolute
target, so a routed artifact was still dropped as target_unresolved. Accept an
absolute target only when it resolves strictly inside an allowlisted framework
root (same _is_within containment as relative; ".." still rejected). Clarify
the specialist prompt: prefer a relative target, and a non-empty
artifacts_written is a full result (empty=false). Adds regression tests.

* fix(integrate_patch): record framework-relative rel_target for absolute artifact targets

Follow-up to the absolute-target support: _resolve_artifact_target now returns
(absolute_target, framework_relative_target) and _resolve_artifact_specs
persists the relative form as _ArtifactSpec.rel_target. Previously an absolute
target kept the raw absolute string in rel_target, so the KEEP source snapshot
(snapshot_source_layer treats rel_target as framework-relative) failed to
capture the installed artifact - the KEEP would not survive resume / GEAK
handoff / current_best relaunch. Adds a regression test asserting the
framework-relative rel_target for an absolute target.

* fix(framework): harden artifact-only routing signal + refresh stale docs

Follow-up from the PR #835 review of the artifact-only deliverable routing:

- Tighten the shared routable-signal (_resolvable_artifacts_from_done) to
  accept an ABSOLUTE artifact source only when it resolves inside the
  specialist sandbox (worktree/workspace), matching integrate_patch's
  _resolve_artifact_specs. Prevents autosubmit from burning a round routing a
  deliverable integrate_patch would reject as source_outside_workspace.
- Document the intentional trade-off that this pure signal validates source
  only and leaves target/allowlist containment to integrate_patch (terminal
  no_patches row, no livelock).
- Record artifacts_written install targets in the autosubmit observation so an
  artifact-only route (empty patches_written) is not silently blank.
- Refresh the stale FRAMEWORK empty-outcome comment (autosubmit now routes on
  patches OR config levers OR tuned artifacts) and the _ArtifactSpec.rel_target
  docstring (now normalized framework-relative, used as the KEEP snapshot key).
- Tests: artifact-only autosubmit creates an integrate_patch proposal
  (aiter#4130 direct path); absolute source outside sandbox is not routed.

* fix(framework): full source-sandbox parity for artifact routing signal

Review follow-up to c27301f8: the earlier tightening added sandbox
containment only for ABSOLUTE artifact sources. A RELATIVE source that
escaped via `..` (e.g. `../../x.csv`) still passed the shared
routable-signal because `(base / source).is_file()` follows `..` on
disk, while integrate_patch's _resolve_artifact_specs rejects it as
source_outside_workspace — so autosubmit still burned a round routing a
deliverable that was guaranteed to fail (and empty-outcome skip-stamped it).

- Unify _resolvable_artifacts_from_done: every source (relative OR absolute)
  is routable only when it resolves to a real file that stays INSIDE a
  resolve_base, matching integrate_patch's containment for both cases.
- Docstring: source containment now covers relative `..` escapes; soften the
  "agree exactly" claim to document the pre-existing payload-view caveat
  (autosubmit reads outer specialist_done, empty-outcome reads the unwrapped
  payload) that the patches_written / config-lever routing already relies on.
- Tests: relative-`..`-escape source is not routed by autosubmit; the
  FRAMEWORK empty-outcome bridge stamps a terminal row for an out-of-sandbox
  source (parity coverage, not just absolute).

* refactor(framework): hoist artifact sandbox-base resolution + guard test

Minor review cleanup on the artifact routing signal (no behavior change):
- Resolve the sandbox bases once outside the per-entry loop instead of per
  entry, and add a NOTE documenting that scanning ALL bases (vs
  integrate_patch's first-existing-base) is fail-safe: never stricter than
  integrate_patch's accept, so an installable artifact is never dropped.
- Add a regression test that a relative `../file` source which climbs out of
  the worktree but lands inside the workspace stays routable (guards the
  not-too-strict direction).

---------

Co-authored-by: lzeng <[email protected]>
xiaofei-zheng pushed a commit that referenced this pull request Jul 19, 2026
… (fix silent drop) (#835)

* fix(framework): route artifacts-only specialist deliverables to integrate_patch

An authoring specialist can deliver a non-diff tuned artifact (e.g. an
autotuned aiter tuned_fmoe CSV) via artifacts_written instead of a source
patch. Both the autosubmit bridge (_maybe_autosubmit_specialist_patches) and
the empty-outcome bridge (_record_framework_agent_authoring_empty_outcome)
keyed only on patches_written (+ config levers), so an artifacts-only
deliverable was never routed to integrate_patch (which already installs
artifacts_written) and was stamped authored_empty — silently discarding the
tuned kernels (observed: ROCm/aiter#4130 cu_num=304 FP8 FMOE rows, 11-21%
faster MoE, dropped).

Add a shared _resolvable_artifacts_from_done signal (source-file existence)
used by both bridges so they agree exactly (no FRAMEWORK livelock): autosubmit
now routes artifacts-only deliverables, and the empty-outcome bridge skips
stamping only when the artifacts are actually routable. Adds regression tests.

* fix(integrate_patch): accept absolute artifact targets inside an allowlisted root

Specialists often author artifacts_written targets as the full install path
(e.g. /usr/.../aiter/configs/model_configs/x.csv) even though the prompt asks
for a framework-relative path. _resolve_artifact_target rejected any absolute
target, so a routed artifact was still dropped as target_unresolved. Accept an
absolute target only when it resolves strictly inside an allowlisted framework
root (same _is_within containment as relative; ".." still rejected). Clarify
the specialist prompt: prefer a relative target, and a non-empty
artifacts_written is a full result (empty=false). Adds regression tests.

* fix(integrate_patch): record framework-relative rel_target for absolute artifact targets

Follow-up to the absolute-target support: _resolve_artifact_target now returns
(absolute_target, framework_relative_target) and _resolve_artifact_specs
persists the relative form as _ArtifactSpec.rel_target. Previously an absolute
target kept the raw absolute string in rel_target, so the KEEP source snapshot
(snapshot_source_layer treats rel_target as framework-relative) failed to
capture the installed artifact - the KEEP would not survive resume / GEAK
handoff / current_best relaunch. Adds a regression test asserting the
framework-relative rel_target for an absolute target.

* fix(framework): harden artifact-only routing signal + refresh stale docs

Follow-up from the PR #835 review of the artifact-only deliverable routing:

- Tighten the shared routable-signal (_resolvable_artifacts_from_done) to
  accept an ABSOLUTE artifact source only when it resolves inside the
  specialist sandbox (worktree/workspace), matching integrate_patch's
  _resolve_artifact_specs. Prevents autosubmit from burning a round routing a
  deliverable integrate_patch would reject as source_outside_workspace.
- Document the intentional trade-off that this pure signal validates source
  only and leaves target/allowlist containment to integrate_patch (terminal
  no_patches row, no livelock).
- Record artifacts_written install targets in the autosubmit observation so an
  artifact-only route (empty patches_written) is not silently blank.
- Refresh the stale FRAMEWORK empty-outcome comment (autosubmit now routes on
  patches OR config levers OR tuned artifacts) and the _ArtifactSpec.rel_target
  docstring (now normalized framework-relative, used as the KEEP snapshot key).
- Tests: artifact-only autosubmit creates an integrate_patch proposal
  (aiter#4130 direct path); absolute source outside sandbox is not routed.

* fix(framework): full source-sandbox parity for artifact routing signal

Review follow-up to c27301f8: the earlier tightening added sandbox
containment only for ABSOLUTE artifact sources. A RELATIVE source that
escaped via `..` (e.g. `../../x.csv`) still passed the shared
routable-signal because `(base / source).is_file()` follows `..` on
disk, while integrate_patch's _resolve_artifact_specs rejects it as
source_outside_workspace — so autosubmit still burned a round routing a
deliverable that was guaranteed to fail (and empty-outcome skip-stamped it).

- Unify _resolvable_artifacts_from_done: every source (relative OR absolute)
  is routable only when it resolves to a real file that stays INSIDE a
  resolve_base, matching integrate_patch's containment for both cases.
- Docstring: source containment now covers relative `..` escapes; soften the
  "agree exactly" claim to document the pre-existing payload-view caveat
  (autosubmit reads outer specialist_done, empty-outcome reads the unwrapped
  payload) that the patches_written / config-lever routing already relies on.
- Tests: relative-`..`-escape source is not routed by autosubmit; the
  FRAMEWORK empty-outcome bridge stamps a terminal row for an out-of-sandbox
  source (parity coverage, not just absolute).

* refactor(framework): hoist artifact sandbox-base resolution + guard test

Minor review cleanup on the artifact routing signal (no behavior change):
- Resolve the sandbox bases once outside the per-entry loop instead of per
  entry, and add a NOTE documenting that scanning ALL bases (vs
  integrate_patch's first-existing-base) is fail-safe: never stricter than
  integrate_patch's accept, so an installable artifact is never dropped.
- Add a regression test that a relative `../file` source which climbs out of
  the worktree but lands inside the workspace stays routable (guards the
  not-too-strict direction).

---------

Co-authored-by: lzeng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants