Harness: G6 ignores unknown standard superclass; dependency order for seed/reference; max_tokens 80k
- abaplint does not know CX_STATIC_CHECK: exception hierarchies failed G6 (G0022, G0005) - generator orders seed and reference objects by name references (G0022 attempt 1) - max_tokens from pilot distribution (accepted calls 4k-76k) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,8 @@ from .runner import Runner
|
||||
|
||||
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
ABAPLINT = os.path.join(ROOT, "node_modules", ".bin", "abaplint")
|
||||
MAX_OUT_TOKENS = 100000
|
||||
# pilot: accepted final calls used 4k-76k output tokens (p90 57k); one runaway call used 393k
|
||||
MAX_OUT_TOKENS = 80000
|
||||
ABAPLINT_VERSIONS = {"v702", "v740sp05", "v750", "v758"}
|
||||
EXAMPLE_FOR = {"CLAS": "T01", "INTF": "T01", "FUNC": "T13", "PROG": "T14", "DDLS": "T15", "TABL": "T15"}
|
||||
CATEGORIES = {
|
||||
@@ -256,9 +257,33 @@ def check_bundle(b):
|
||||
return errs
|
||||
|
||||
|
||||
def dependency_order(objs, files):
|
||||
"""Stable order in which every object comes after the objects that its sources name
|
||||
(for example exception classes before the class that raises them). A cycle keeps the given order."""
|
||||
def text(o):
|
||||
return " ".join(files.get(o.get(k), "") for k in ("file", "testclasses_file")).upper()
|
||||
names = [o.get("name", "").upper() for o in objs]
|
||||
needs = []
|
||||
for o in objs:
|
||||
src, own = text(o), o.get("name", "").upper()
|
||||
dep = {n for n in names if n != own and re.search(rf"(?<![\w{{}}]){re.escape(n)}(?!\w)", src)}
|
||||
if o.get("functionGroup"):
|
||||
dep.add(o["functionGroup"].upper())
|
||||
needs.append(dep & set(names))
|
||||
out, done = [], set()
|
||||
while len(out) < len(objs):
|
||||
ready = [i for i, o in enumerate(objs) if i not in done and needs[i] <= {names[j] for j in done}]
|
||||
i = ready[0] if ready else min(set(range(len(objs))) - done)
|
||||
done.add(i)
|
||||
out.append(objs[i])
|
||||
return out
|
||||
|
||||
|
||||
def write_bundle(b, task_dir, task_id):
|
||||
os.makedirs(task_dir, exist_ok=True)
|
||||
b["task"]["id"] = task_id
|
||||
for k in ("seed", "reference"):
|
||||
b["task"][k] = dependency_order(b["task"].get(k, []), b["files"])
|
||||
json.dump(b["task"], open(os.path.join(task_dir, "task.json"), "w"), indent=2)
|
||||
for rel, content in b["files"].items():
|
||||
path = os.path.join(task_dir, rel)
|
||||
|
||||
Reference in New Issue
Block a user