flutter-diff-steps-v1
收藏资源简介:
Flutter Codegen: Diff Steps是一个专注于Flutter/Dart框架下小部件构建过程的合成数据集。其核心设计理念是捕捉代码开发的迭代性,通过记录从初始状态到完成小部件的每一步增量编辑,来模拟真实的编程流程。该数据集旨在训练和评估语言模型进行基于差异(diff)的代码编辑,即模型学习预测并应用下一个代码修改动作(以搜索/替换块的形式表示),而不是一次性重新生成整个文件。这使得模型能够执行多轮次的、类似智能体的代码编辑任务。数据集结构围绕“构建序列”组织。每个数据行代表序列中的一个步骤,通过sequence_id字段将属于同一完整构建轨迹的所有步骤关联起来,并按step_index排序。关键字段包括:描述整体任务的goal;表示当前步骤编辑内容的人类可读描述forward_action及其类型标签forward_action_type;对应的逆向操作backward_action;编辑前后的完整代码forward_code和backward_code;以及以搜索/替换块列表形式精确表达代码变更的changes字段。其他字段如id, source_example_id, total_steps, 边界标志和元数据等提供了完整的上下文信息。该数据集适用于训练序列到序列模型,输入为任务目标、当前代码状态以及已执行动作的历史,输出为下一步的动作描述和具体的代码差异,从而驱动一个逐步完善的代码生成与编辑循环。数据集总规模约为133,685个步骤行,源自大约13,591个独立的构建序列。
Flutter Codegen: Diff Steps is a synthetic dataset focused on the widget construction process in the Flutter/Dart framework. Its core design philosophy is to capture the iterative nature of code development by recording each incremental edit from the initial state to the completed widget, simulating real-world programming workflows. The dataset aims to train and evaluate language models for diff-based code editing, where the model learns to predict and apply the next code modification action (represented as search/replace blocks) instead of regenerating the entire file at once. This enables models to perform multi-round, agent-like code editing tasks. The dataset is structured around construction sequences. Each data row represents a step in a sequence, with all steps belonging to the same complete construction trajectory linked via the sequence_id field and sorted by step_index. Key fields include: goal describing the overall task; forward_action, a human-readable description of the current steps edit, along with its type label forward_action_type; the corresponding backward_action; the full code before and after editing, forward_code and backward_code; and the changes field that precisely expresses code modifications as a list of search/replace blocks. Additional fields such as id, source_example_id, total_steps, boundary flags, and metadata provide comprehensive context. The dataset is suitable for training sequence-to-sequence models, where the input includes the task goal, current code state, and history of executed actions, and the output is the next action description and specific code diff, driving a step-by-step code generation and editing cycle. The total dataset size is approximately 133,685 step rows, derived from about 13,591 independent construction sequences.
数据集概述
Flutter Codegen: Diff Steps 是一个合成数据集,专注于 Flutter/Dart 组件的逐步构建过程。每条数据记录代表一个增量编辑步骤,即在给定目标、当前代码和历史步骤的情况下,预测下一个动作(简短描述)及对应的代码变更(搜索/替换差异块)。
该数据集专为训练和评估小型语言模型在迭代、基于差异的代码编辑任务上的表现而设计,与每次重新生成整个文件的方式不同。它作为 flutter-full-examples-v1 的配套数据集,后者将相同类型的任务压缩为单次目标到完整代码的示例,用于直接比较两种训练方法。
数据结构
每条记录代表构建序列中的一个步骤。共享相同 sequence_id 的记录构成一个从空文件/起始文件到完成组件的完整构建轨迹,按 step_index 排序。
字段说明
| 字段 | 描述 |
|---|---|
id |
此步骤记录的唯一标识。 |
source_example_id |
原始完整示例的标识,此序列由该示例派生/挽救而来。 |
sequence_id |
属于同一构建轨迹的所有步骤的分组标识。 |
step_index |
步骤在序列中的位置(从0开始索引)。 |
total_steps |
此序列中的总步骤数。 |
is_first_step / is_last_step |
标记序列边界的布尔标志。 |
goal |
整体任务描述,同一序列中的每个步骤均相同。 |
forward_action / forward_action_type |
此步骤执行的编辑的可读描述及简短类型标签。 |
backward_action / backward_action_type |
前向动作的逆操作,描述如何撤销此步骤。 |
forward_code / backward_code |
此步骤编辑后/编辑前的完整文件内容。 |
changes |
以差异形式表示编辑的 {search, replace} 块列表。 |
reached_initial |
此序列的后向链是否达到空文件/初始文件。 |
created_at / updated_at |
时间戳。 |
预期用途
此数据集用于训练模型,使其能够以 目标 + 当前代码 + 历史操作 作为输入,输出 下一个操作 + 差异,然后应用差异并重复执行,直到序列发出完成信号——这是一种代理式的、多轮代码编辑循环,而非一次性生成。
数据集规模
总行数约 133,685 条,涵盖约 13,591 个唯一序列。





