|
62 | 62 | which one Python picks depends on `sys.path`, so the identity stays |
63 | 63 | unresolved. |
64 | 64 |
|
| 65 | + Provenance is resolved, never assumed. `Agent`/`LlmAgent`/`App` are read |
| 66 | + through the binding that reaches them, so a constructor imported under an |
| 67 | + alias counts and one shadowed by a local `def`/`class` does not — matching |
| 68 | + a terminal spelling let a decoy `def Agent(...)` supply a fabricated |
| 69 | + identity while the real aliased root went unseen. Every binding form is |
| 70 | + modelled, not just assignments: `del`, `class`, `except … as`, `case`, and |
| 71 | + a `global`/`nonlocal` store routed to the scope it actually rebinds all |
| 72 | + retire the agent a name used to hold, and a file carrying |
| 73 | + `from x import *` can prove nothing about any of its names. Lookups into |
| 74 | + an enclosing or module scope no longer compare writes against the nested |
| 75 | + reference's line number: a function body does not execute where it is |
| 76 | + written, so a module-level rebinding *below* a nested reference still |
| 77 | + happens before the call, and only a single unconditional binding there is |
| 78 | + provable. An `App(root_agent=Agent(…))` built inside a branch is |
| 79 | + unresolved rather than whichever arm came first, and `tests.py` / `test.py` |
| 80 | + now count as test code like every other conventional test module. |
| 81 | + |
65 | 82 | Origin now dominates the score rather than competing with it. The |
66 | 83 | documented contract is that product code outranks test code, but additive |
67 | 84 | scoring let a test fixture that builds an `App(root_agent=…)` outrank a |
|
86 | 103 | invisible to `init`, so walking it anyway let the script name an agent |
87 | 104 | `init` would never write; a symlink escaping the workspace both |
88 | 105 | contributed a name and leaked its outside absolute path into the output. |
| 106 | + Two further detector fixes: a contained symlink keeps its *logical* path, |
| 107 | + because resolving `agent.py -> source.txt` renamed the entry, dropped the |
| 108 | + `.py` suffix, and reported zero Python files where the CLI reported an |
| 109 | + agent project — the go/no-go verdict, not just the ranking. And the |
| 110 | + non-Git fallback walk now has a documented ceiling that *raises* rather |
| 111 | + than truncating, so a downloaded tree of unrelated assets cannot consume |
| 112 | + unbounded time and memory before detection sees a single source file. |
| 113 | + |
| 114 | + `DetectResult(agent_name_candidates=[NameCandidate(...)])` keeps working. |
| 115 | + `NameCandidate` is a public export and was the declared element type |
| 116 | + before ranking existed; narrowing the annotation turned working calls into |
| 117 | + a `ValidationError`, and a legacy dict parsed but silently landed on |
| 118 | + `selectable: false`, changing which name `init` writes. Both are now |
| 119 | + upgraded at the model boundary using the rule that decided selection |
| 120 | + before this change, so old callers keep the behaviour they had. |
| 121 | + |
89 | 122 | Its file bound also moved from the whole inventory onto Python parses, so |
90 | 123 | an asset-heavy repository can no longer exhaust the budget before the walk |
91 | 124 | reaches any source. Git's output is read incrementally against that bound |
|
0 commit comments