Skip to content

cross-backend-porting-EXPERIMENTAL - #3

Open
Enforcer03 wants to merge 1 commit into
ahe-explorefrom
ahe-explore-porting-backend
Open

cross-backend-porting-EXPERIMENTAL#3
Enforcer03 wants to merge 1 commit into
ahe-explorefrom
ahe-explore-porting-backend

Conversation

@Enforcer03

@Enforcer03 Enforcer03 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Summary by cubic

Adds cross-backend porting between nexau and mini-swe-agent with an honest coverage audit and report; introduces hdp.engine.port (audit() and port()) plus a port CLI/subcommand.

  • New Features

    • hdp.engine.port: audit(doc, dest_target) enumerates coverage gaps; port(source → dest) runs lift → audit → generate, writes hdp_port_coverage.json, and refuses on blocking issues unless allow_partial.
    • Coverage model: CapabilityIssue and CoverageReport with severities blocking, silent_drop, collision.
    • Adapter support:
      • nexau: flags blocking policy/non-external verifier, unresolvable tool bindings, and destination collisions.
      • mini-swe-agent: flags blocking policy/non-external verifier, unresolvable tool bindings, and system_rules ids with no manifest slot as silent_drop.
    • CLI: python -m hdp.engine.port ... and hdp.engine.run port; config via hdp.port block (see configs/hdp/port-example.yaml). Scope is nexaumini-swe-agent (openharness excluded).
    • Tests: added $0 e2e and adapter coverage tests ensuring honest reporting and refusal behavior.
  • Refactors

    • Adapters expose capability_issues(doc); base.FrameworkAdapter provides a no-op default.
    • _reject_unsupported routes through capability_issues but preserves behavior: policy/verifier remain NotImplementedError; unresolvable tool bindings still raise ValueError during generate().
    • STATUS.md updated with Phase 6 port readiness.

Written for commit 491055f. Summary will update on new commits.

Review in cubic

…u ↔ mini-swe-agent)

Add hdp.engine.port: a pre-flight coverage audit() and a port() operation
chaining lift → audit → generate, refusing to generate on a blocking gap and
always writing an honest coverage report (hdp_port_coverage.json) beside the
ported harness.

- port/{coverage.py,__init__.py,__main__.py}: CapabilityIssue/CoverageReport,
  audit(), port(), PortResult, PortCoverageError, CLI. Scope: nexau ↔
  mini-swe-agent (openharness intentionally excluded via the _SUPPORTED gate).
- adapters/base.py: no-op capability_issues() default.
- adapters/nexau.py + mini_swe_agent.py: capability_issues() detecting blocking
  (policy/verifier + unresolvable-in-dest tool binding), collision (nexau
  system_rules/same-scope memory), silent_drop (mini-swe unrecognized
  system_rules id); _reject_unsupported routed through it, raising only
  policy/verifier so the existing ValueError-on-binding path is byte-identical.
- run.py:  subcommand + cmd_port; configs/hdp/port-example.yaml.
- tests: test_port.py + test_port_coverage.py (12 -zsh tests, no LLM/E2B).

Corrects two brief premises verified against the code: openharness raises (not
silently drops) on unrecognized system_rules ids, and no adapter can resolve
another's tool binding (every real-seed cross-port is binding-blocked) — the
latter surfaced as a blocking capability issue rather than a raw ValueError.

)

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 11 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="hdp/engine/run.py">

<violation number="1" location="hdp/engine/run.py:154">
P2: Config-driven port runs can unexpectedly allow partial generation when `allow_partial` is supplied via `${ENV}` as `false`, because `bool('false')` evaluates to `True`. Consider parsing string booleans explicitly before passing this into `port_harness`, so blocking coverage gaps still refuse by default.</violation>
</file>

<file name="hdp/engine/port/coverage.py">

<violation number="1" location="hdp/engine/port/coverage.py:28">
P2: The `severity` field on `CapabilityIssue` is typed as `str` but documented and universally used as one of three exact values (`"blocking"`, `"silent_drop"`, `"collision"`). The project already uses `Literal` for this pattern (`ChangeKind = Literal["added", "removed", "modified"]` in `differ.py`). Using `Literal["blocking", "silent_drop", "collision"]` would catch typos at type-check time and keep the codebase consistent.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread hdp/engine/run.py
harness_path = port_cfg.get("harness", hdp_cfg.get("harness", "agents/code_agent_simple"))
source_target = port_cfg.get("source_target", "nexau")
dest_target = port_cfg.get("dest_target", "mini-swe-agent")
allow_partial = bool(port_cfg.get("allow_partial", False))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Config-driven port runs can unexpectedly allow partial generation when allow_partial is supplied via ${ENV} as false, because bool('false') evaluates to True. Consider parsing string booleans explicitly before passing this into port_harness, so blocking coverage gaps still refuse by default.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At hdp/engine/run.py, line 154:

<comment>Config-driven port runs can unexpectedly allow partial generation when `allow_partial` is supplied via `${ENV}` as `false`, because `bool('false')` evaluates to `True`. Consider parsing string booleans explicitly before passing this into `port_harness`, so blocking coverage gaps still refuse by default.</comment>

<file context>
@@ -140,6 +140,42 @@ def cmd_gen(cfg: dict) -> int:
+    harness_path = port_cfg.get("harness", hdp_cfg.get("harness", "agents/code_agent_simple"))
+    source_target = port_cfg.get("source_target", "nexau")
+    dest_target = port_cfg.get("dest_target", "mini-swe-agent")
+    allow_partial = bool(port_cfg.get("allow_partial", False))
+    arm = (cfg.get("run") or {}).get("arm", "treatment")
+    seed = int((cfg.get("run") or {}).get("seed", 0))
</file context>
Suggested change
allow_partial = bool(port_cfg.get("allow_partial", False))
raw_allow_partial = port_cfg.get("allow_partial", False)
allow_partial = (raw_allow_partial.strip().lower() in {"1", "true", "yes", "on"}
if isinstance(raw_allow_partial, str) else bool(raw_allow_partial))

component_id: str
layer: str
type: str
severity: str # "blocking" | "silent_drop" | "collision"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The severity field on CapabilityIssue is typed as str but documented and universally used as one of three exact values ("blocking", "silent_drop", "collision"). The project already uses Literal for this pattern (ChangeKind = Literal["added", "removed", "modified"] in differ.py). Using Literal["blocking", "silent_drop", "collision"] would catch typos at type-check time and keep the codebase consistent.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At hdp/engine/port/coverage.py, line 28:

<comment>The `severity` field on `CapabilityIssue` is typed as `str` but documented and universally used as one of three exact values (`"blocking"`, `"silent_drop"`, `"collision"`). The project already uses `Literal` for this pattern (`ChangeKind = Literal["added", "removed", "modified"]` in `differ.py`). Using `Literal["blocking", "silent_drop", "collision"]` would catch typos at type-check time and keep the codebase consistent.</comment>

<file context>
@@ -0,0 +1,45 @@
+    component_id: str
+    layer: str
+    type: str
+    severity: str   # "blocking" | "silent_drop" | "collision"
+    reason: str
+
</file context>

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.

1 participant