feat: make include an expression returning the declared package value#484
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the cleanest run of the brownfield-graph fuseraft-cli config to date.
scs@fedora ~/github/kiwi-lang/kiwi $ fuseraft run -c .fuseraft/config/orchestration.yaml -f /tmp/fuseraft-task-1779337089802-s4lx4hxvv2.txt .|'; .|'; || || || || '||' '|| ||` ('''' .|''|, '||''| '''|. '||' ''||'' || || || `'') ||..|| || .|''|| || || .||. `|..'|. `...' `|... .||. `|..||. .||. `|..' Multi-Agent Orchestration · Powered by Microsoft Agent Framework Working directory → /home/scs/github/kiwi-lang/kiwi Brownfield Graph Pipeline ╭───────────────┬─────────────────────────────┬────────────────────────────────╮ │ Agent │ Model │ Plugins │ ├───────────────┼─────────────────────────────┼────────────────────────────────┤ │ Archaeologist │ grok-4-1-fast │ FileSystem, Search, SubAgent, │ │ │ │ Handoff │ │ Planner │ grok-4-1-fast-reasoning │ FileSystem, Search, SubAgent, │ │ │ │ Handoff │ │ Developer │ grok-4-1-fast │ FileSystem, Shell, Git, │ │ │ │ Changes, Handoff │ │ Reviewer │ grok-4-1-fast-reasoning │ FileSystem, Shell, Changes, │ │ │ │ Handoff │ │ Approved │ grok-4-1-fast-non-reasoning │ none │ ╰───────────────┴─────────────────────────────┴────────────────────────────────╯ Selection: graph Termination: composite/2 rules, max=0 ┏━Task━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ See AGENTS.md to learn how to work on kiwi. ┃ ┃ ┃ ┃ Implement this new syntax: ┃ ┃ ┃ ┃ **app.kiwi**: ┃ ┃ ```kiwi ┃ ┃ x = include 'mylib/libfoo' ┃ ┃ x.foofunc() # prints: funky foo! ┃ ┃ ``` ┃ ┃ ┃ ┃ **mylib/libfoo.kiwi**: ┃ ┃ ```kiwi ┃ ┃ package foo ┃ ┃ fn foofunc() ┃ ┃ println "funky foo!" ┃ ┃ end ┃ ┃ end ┃ ┃ ``` ┃ ┃ ┃ ┃ The include statement should also be an expression that we can assign to a ┃ ┃ variable (`x` in our example above). Calling `x.foofunc()` calls the package ┃ ┃ `foo`'s `foofunc` function. ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ╭─Archaeologist turn 1 29.2s in:39,727 out:472──────────────────────────────╮ │ (7 tool calls — run with --tools to see details) │ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭─Planner turn 2 34.8s in:45,299 out:359────────────────────────────────────╮ │ (4 tool calls — run with --tools to see details) │ ╰──────────────────────────────────────────────────────────────────────────────╯ ⚠ Developer used 494,342 input tokens this turn (warning threshold: 300,000). Reduce file reads and shell output to avoid a budget blowup.ssion returning the ╭─Developer turn 3 120.5s in:494,342 out:1,777──────────────────────────────╮ │ (30 tool calls — run with --tools to see details) │ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭─Reviewer turn 4 42.3s in:68,224 out:527───────────────────────────────────╮ │ { "review": [ {"criterion": "include expr compiles without new opcode │ │ or reuses Include to leave Package on stack", "verdict": "PASS", "evidence": │ │ "Compiler.cs:1763-1764 reuses Emit(Opcode.Include); KiwiVM.cs:1701-1702 │ │ calls IncludeFile then Push(pkg)"}, {"criterion": "x = include │ │ 'mylib/libfoo' succeeds and x.foofunc() invokes the fn from package foo", │ │ "verdict": "PASS", "evidence": "Developer run of tmp/app.kiwi produced │ │ 'funky foo!' output"}, {"criterion": "existing require/import/include │ │ semantics unchanged for non-assignment uses", "verdict": "PASS", "evidence": │ │ "tests/test.kiwi packages test + all 82 tests passed"}, {"criterion": │ │ "full test suite passes after rebuild", "verdict": "PASS", "evidence": │ │ "./build.sh OK; ./bin/kiwi tests/test.kiwi: 82/82 PASSED"}, │ │ {"criterion": "no files outside files_to_change modified", "verdict": │ │ "PASS", "evidence": "changes_read_latest shows only │ │ src/VM/{Compiler,KiwiVM}.cs + IncludeNode.cs + briefs"} ] } APPROVED │ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭─Approved turn 5 1.2s in:24,346 out:3──────────────────────────────────────╮ │ Task complete. │ ╰──────────────────────────────────────────────────────────────────────────────╯ Context viz → .fuseraft/logs/ctx_viz_12226d6a.html ─────────────────────────────── Session Summary ──────────────────────────────── Agent Turns Input tokens Output tokens ──────────────────────────────────────────────────────── Archaeologist 1 39,727 472 Planner 1 45,299 359 Developer 1 494,342 1,777 Reviewer 1 68,224 527 Approved 1 24,346 3 Total 5 671,938 3,138 ✓ Completed in 3.8 min Policy compliance: 100.0% 0 error budget remaining