HN 표시: 안정적인 AST 노드 ID가 있는 Draxl, 에이전트 네이티브 소스 코드
hackernews
|
|
🔬 연구
#ast
#draxl
#review
#소스코드
#에이전트
#코드 편집
원문 출처: hackernews · Genesis Park에서 요약 및 분석
요약
에이전트 시대에 대응하기 위해 설계된 새로운 소스 코드 포맷 ‘Draxl’이 공개되었습니다. 이 프로젝트는 코드의 구조 노드에 안정적인 ID를 직접 삽입하여, 도구들이 줄 단위가 아닌 의미적 구문을 대상으로 정밀하게 편집할 수 있게 합니다. 이 방식은 동시 편집이 빈번해질 미래 환경에서 병합 충돌을 줄이고 시맨틱 리플레이의 신뢰성을 높이는 것을 목표로 합니다. 개발자는 향후 수백만 개의 에이전트가 코드를 수정하는 세상에서 이 모델이 유용할지 피드백을 요청했습니다.
본문
Draxl is an agent-native source language for deterministic, high-volume concurrent code editing. It makes syntax identity, ordering, and attachment explicit in the source itself, so tools can apply semantic operators over stable nodes instead of patching text spans. This repository contains the first Draxl language profile, which targets Rust through .rs.dx files and deterministic lowering to Rust. Under the hood, Draxl is AST-native: the source carries the structure, identity, and attachment data that replay, merge, audit, and lowering workflows need. agent edits | v semantic ops over stable ids | v validated Draxl | v canonical .rs.dx | v Rust The .rs.dx extension is intentional. .dx names the Draxl layer and .rs names the current language profile. That keeps the profile-specific surface distinct from the higher-level source model and leaves room for future profiles such as .go.dx , .ts.dx , and .py.dx . Draxl is more than a merge-friendly source format. Stable node IDs, ranks, anchors, and structured annotations create room for higher-level program control that ordinary text files do not represent cleanly. - Node-level ownership and policy. Functions, types, fields, match arms, and statements can carry explicit owners, required reviewers, stability levels, or security policy tags. Those rules stay attached to the syntax they govern instead of living at file scope or drifting with line edits and refactors. - Durable review, provenance, and audit state. Approvals, benchmark results, security findings, and agent provenance can attach to specific nodes and survive surrounding changes that preserve identity. Tools can then invalidate evidence precisely when the underlying semantic target changes. - Machine-readable contracts and capability summaries. Nodes can carry structured annotations for effects, resource access, unsafe boundaries, API guarantees, or other higher-level constraints. That gives agents and tooling a durable substrate for reasoning that is stronger than comments and cheaper than re-deriving intent from raw source. @m1 mod demo { @d1 /// Add one to x. @f1[a] fn add_one(@p1[a] x: @t1 i64) -> @t2 i64 { @c1 // Cache the intermediate value. @s1[a] let @p2 y = @e1 (@e2 x + @l1 1); @s2[b] @e3 y } } The same file lowers deterministically to ordinary Rust: mod demo { /// Add one to x. fn add_one(x: i64) -> i64 { // Cache the intermediate value. let y = (x + 1); y } } The metadata prefix stays compact: @id[rank]->anchor @id gives the next supported node a stable identity[rank] orders siblings inside ranked slots->anchor attaches detached docs or comments to an existing sibling id Doc and line comments attach implicitly to the next semantic sibling when an explicit anchor is absent. Draxl is a bet on a near-future software workflow. As inference gets cheaper, code generation becomes abundant and integration becomes the bottleneck. Repositories will need to absorb far more agent-produced edits, many more concurrent branches and PRs, and long-lived forks maintained for specific users, products, and deployments. Line-based source and text diffs are a poor fit for that environment. Byte ranges create false conflicts, rebase churn, and weak replayability because syntax identity is positional and tooling has to reconstruct structure from surrounding text. Draxl makes syntax identity explicit in the source itself. Tools can patch, replay, merge, and audit code semantically by addressing stable node IDs and ranked slots instead of guessing intent from lines and spans. - stable node ids let tools target syntax directly instead of guessing by line and column - ranks make ordered inserts explicit, so concurrent edits do not depend on textual history - anchors make detached docs and comments attach deterministically across replay and merge - canonical printing keeps human-readable source and machine output stable - the current Rust profile preserves compatibility with the existing Rust toolchain through deterministic lowering | Concern | Text diffs | Draxl | |---|---|---| | Edit target | byte ranges, lines, spans | stable node ids | | Ordered insert | textual position | ranked slot under a parent | | Comment/doc attachment | proximity heuristics | explicit anchors | | Replay and audit | surrounding text | semantic ops over node ids | | Branches and forks | repeated rebase repair | semantic replay by identity | | Merge conflicts | overlapping text | overlapping semantic regions | Draxl distinguishes between hard conflicts, validation/build failures, and semantic conflicts. For the layering model and current terminology, see docs/merge/conflicts.md and docs/merge/semantic-conflicts.md. Draxl treats semantic patch operators as first-class infrastructure for agent-native editing, not as a convenience wrapper around text replacement. A text diff says "these bytes changed here." A Draxl patch says "replace node @e2 ", "insert into @f1.body[ah] ", or "attach @d2 to @f1 ." That is a better execution format for replay, mer
Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.
공유