Datasets:
Awkweave realistic expansion and 37-case frozen evaluation
Browse files- .gitattributes +1 -0
- DATASET_LICENSE.txt +11 -0
- LICENSE +202 -0
- README.md +56 -0
- awkweave/__init__.py +3 -0
- awkweave/execution.py +68 -0
- awkweave/prompts.py +12 -0
- data/frozen_test.jsonl +37 -0
- data/train.jsonl +3 -0
- expand_realistic_data.py +269 -0
- frozen_eval_data.py +132 -0
- prepare_v2_data.py +46 -0
- validation.json +123 -0
.gitattributes
CHANGED
|
@@ -58,3 +58,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
data/train.jsonl filter=lfs diff=lfs merge=lfs -text
|
DATASET_LICENSE.txt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Awkweave dataset rows are licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
|
| 2 |
+
|
| 3 |
+
Copyright 2026 Asterbraid.
|
| 4 |
+
|
| 5 |
+
You are free to share and adapt the dataset, including for commercial purposes, provided that you give appropriate credit to Asterbraid, provide a link to the license, and indicate if changes were made. You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
|
| 6 |
+
|
| 7 |
+
The full license and its disclaimer of warranties and limitation of liability are available at:
|
| 8 |
+
https://creativecommons.org/licenses/by/4.0/
|
| 9 |
+
https://creativecommons.org/licenses/by/4.0/legalcode
|
| 10 |
+
|
| 11 |
+
This notice applies to dataset rows, not to the Apache-2.0-licensed code or model weights.
|
LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Apache License
|
| 3 |
+
Version 2.0, January 2004
|
| 4 |
+
http://www.apache.org/licenses/
|
| 5 |
+
|
| 6 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 7 |
+
|
| 8 |
+
1. Definitions.
|
| 9 |
+
|
| 10 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 11 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 12 |
+
|
| 13 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 14 |
+
the copyright owner that is granting the License.
|
| 15 |
+
|
| 16 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 17 |
+
other entities that control, are controlled by, or are under common
|
| 18 |
+
control with that entity. For the purposes of this definition,
|
| 19 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 20 |
+
direction or management of such entity, whether by contract or
|
| 21 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 22 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 23 |
+
|
| 24 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 25 |
+
exercising permissions granted by this License.
|
| 26 |
+
|
| 27 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 28 |
+
including but not limited to software source code, documentation
|
| 29 |
+
source, and configuration files.
|
| 30 |
+
|
| 31 |
+
"Object" form shall mean any form resulting from mechanical
|
| 32 |
+
transformation or translation of a Source form, including but
|
| 33 |
+
not limited to compiled object code, generated documentation,
|
| 34 |
+
and conversions to other media types.
|
| 35 |
+
|
| 36 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 37 |
+
Object form, made available under the License, as indicated by a
|
| 38 |
+
copyright notice that is included in or attached to the work
|
| 39 |
+
(an example is provided in the Appendix below).
|
| 40 |
+
|
| 41 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 42 |
+
form, that is based on (or derived from) the Work and for which the
|
| 43 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 44 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 45 |
+
of this License, Derivative Works shall not include works that remain
|
| 46 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 47 |
+
the Work and Derivative Works thereof.
|
| 48 |
+
|
| 49 |
+
"Contribution" shall mean any work of authorship, including
|
| 50 |
+
the original version of the Work and any modifications or additions
|
| 51 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 52 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 53 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 54 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 55 |
+
means any form of electronic, verbal, or written communication sent
|
| 56 |
+
to the Licensor or its representatives, including but not limited to
|
| 57 |
+
communication on electronic mailing lists, source code control systems,
|
| 58 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 59 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 60 |
+
excluding communication that is conspicuously marked or otherwise
|
| 61 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 62 |
+
|
| 63 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 64 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 65 |
+
subsequently incorporated within the Work.
|
| 66 |
+
|
| 67 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 68 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 69 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 70 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 71 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 72 |
+
Work and such Derivative Works in Source or Object form.
|
| 73 |
+
|
| 74 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 75 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 76 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 77 |
+
(except as stated in this section) patent license to make, have made,
|
| 78 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 79 |
+
where such license applies only to those patent claims licensable
|
| 80 |
+
by such Contributor that are necessarily infringed by their
|
| 81 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 82 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 83 |
+
institute patent litigation against any entity (including a
|
| 84 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 85 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 86 |
+
or contributory patent infringement, then any patent licenses
|
| 87 |
+
granted to You under this License for that Work shall terminate
|
| 88 |
+
as of the date such litigation is filed.
|
| 89 |
+
|
| 90 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 91 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 92 |
+
modifications, and in Source or Object form, provided that You
|
| 93 |
+
meet the following conditions:
|
| 94 |
+
|
| 95 |
+
(a) You must give any other recipients of the Work or
|
| 96 |
+
Derivative Works a copy of this License; and
|
| 97 |
+
|
| 98 |
+
(b) You must cause any modified files to carry prominent notices
|
| 99 |
+
stating that You changed the files; and
|
| 100 |
+
|
| 101 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 102 |
+
that You distribute, all copyright, patent, trademark, and
|
| 103 |
+
attribution notices from the Source form of the Work,
|
| 104 |
+
excluding those notices that do not pertain to any part of
|
| 105 |
+
the Derivative Works; and
|
| 106 |
+
|
| 107 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 108 |
+
distribution, then any Derivative Works that You distribute must
|
| 109 |
+
include a readable copy of the attribution notices contained
|
| 110 |
+
within such NOTICE file, excluding those notices that do not
|
| 111 |
+
pertain to any part of the Derivative Works, in at least one
|
| 112 |
+
of the following places: within a NOTICE text file distributed
|
| 113 |
+
as part of the Derivative Works; within the Source form or
|
| 114 |
+
documentation, if provided along with the Derivative Works; or,
|
| 115 |
+
within a display generated by the Derivative Works, if and
|
| 116 |
+
wherever such third-party notices normally appear. The contents
|
| 117 |
+
of the NOTICE file are for informational purposes only and
|
| 118 |
+
do not modify the License. You may add Your own attribution
|
| 119 |
+
notices within Derivative Works that You distribute, alongside
|
| 120 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 121 |
+
that such additional attribution notices cannot be construed
|
| 122 |
+
as modifying the License.
|
| 123 |
+
|
| 124 |
+
You may add Your own copyright statement to Your modifications and
|
| 125 |
+
may provide additional or different license terms and conditions
|
| 126 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 127 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 128 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 129 |
+
the conditions stated in this License.
|
| 130 |
+
|
| 131 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 132 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 133 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 134 |
+
this License, without any additional terms or conditions.
|
| 135 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 136 |
+
the terms of any separate license agreement you may have executed
|
| 137 |
+
with Licensor regarding such Contributions.
|
| 138 |
+
|
| 139 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 140 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 141 |
+
except as required for reasonable and customary use in describing the
|
| 142 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 143 |
+
|
| 144 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 145 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 146 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 147 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 148 |
+
implied, including, without limitation, any warranties or conditions
|
| 149 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 150 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 151 |
+
appropriateness of using or redistributing the Work and assume any
|
| 152 |
+
risks associated with Your exercise of permissions under this License.
|
| 153 |
+
|
| 154 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 155 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 156 |
+
unless required by applicable law (such as deliberate and grossly
|
| 157 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 158 |
+
liable to You for damages, including any direct, indirect, special,
|
| 159 |
+
incidental, or consequential damages of any character arising as a
|
| 160 |
+
result of this License or out of the use or inability to use the
|
| 161 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 162 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 163 |
+
other commercial damages or losses), even if such Contributor
|
| 164 |
+
has been advised of the possibility of such damages.
|
| 165 |
+
|
| 166 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 167 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 168 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 169 |
+
or other liability obligations and/or rights consistent with this
|
| 170 |
+
License. However, in accepting such obligations, You may act only
|
| 171 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 172 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 173 |
+
defend, and hold each Contributor harmless for any liability
|
| 174 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 175 |
+
of your accepting any such warranty or additional liability.
|
| 176 |
+
|
| 177 |
+
END OF TERMS AND CONDITIONS
|
| 178 |
+
|
| 179 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 180 |
+
|
| 181 |
+
To apply the Apache License to your work, attach the following
|
| 182 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 183 |
+
replaced with your own identifying information. (Don't include
|
| 184 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 185 |
+
comment syntax for the file format. We also recommend that a
|
| 186 |
+
file or class name and description of purpose be included on the
|
| 187 |
+
same "printed page" as the copyright notice for easier
|
| 188 |
+
identification within third-party archives.
|
| 189 |
+
|
| 190 |
+
Copyright [yyyy] [name of copyright owner]
|
| 191 |
+
|
| 192 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 193 |
+
you may not use this file except in compliance with the License.
|
| 194 |
+
You may obtain a copy of the License at
|
| 195 |
+
|
| 196 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 197 |
+
|
| 198 |
+
Unless required by applicable law or agreed to in writing, software
|
| 199 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 200 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 201 |
+
See the License for the specific language governing permissions and
|
| 202 |
+
limitations under the License.
|
README.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
language: en
|
| 4 |
+
pretty_name: Awkweave Realistic Data
|
| 5 |
+
size_categories:
|
| 6 |
+
- 10K<n<100K
|
| 7 |
+
task_categories:
|
| 8 |
+
- text-generation
|
| 9 |
+
tags:
|
| 10 |
+
- awk
|
| 11 |
+
- code-generation
|
| 12 |
+
- text-to-code
|
| 13 |
+
- execution-verified
|
| 14 |
+
configs:
|
| 15 |
+
- config_name: default
|
| 16 |
+
data_files:
|
| 17 |
+
- split: train
|
| 18 |
+
path: data/train.jsonl
|
| 19 |
+
- split: frozen_test
|
| 20 |
+
path: data/frozen_test.jsonl
|
| 21 |
+
---
|
| 22 |
+
|
| 23 |
+
# Awkweave Realistic Data
|
| 24 |
+
|
| 25 |
+
A realistic-format expansion for [Awkweave Data](https://huggingface.co/datasets/asterbraid/awkweave-data), built to reduce template memorization in natural-language-to-`awk` models.
|
| 26 |
+
|
| 27 |
+
## Contents
|
| 28 |
+
|
| 29 |
+
- **40,000 training rows** across 40 task families: Apache-style HTTP logs, header-shuffled sales records, key=value events, colon-delimited account records, and general text transformations.
|
| 30 |
+
- **37 frozen-test rows** covering pipe-delimited network flows, inventory CSV, syslog, group membership, sensor readings, and formatting. These rows were authored separately and never included in training or tuning.
|
| 31 |
+
|
| 32 |
+
Every row contains a request, a bare `awk` program, two different inputs, and actual outputs for both inputs. The frozen split has `split="frozen_test"`; all expansion rows have `split="train"`.
|
| 33 |
+
|
| 34 |
+
## Verification
|
| 35 |
+
|
| 36 |
+
The final package was re-executed with `mawk 1.3.4 20200120`: **80074 executions, 0 errors**. `validation.json` records hashes, counts, and split integrity. Inputs are disjoint between training and frozen test; request/program pairs may describe the same general operation with different records.
|
| 37 |
+
|
| 38 |
+
## Intended use
|
| 39 |
+
|
| 40 |
+
Use this dataset alongside the original Awkweave Data for supervised fine-tuning or execution-based evaluation. The stage-two recipe used for Awkweave mixed these 40,000 rows with 20,000 deterministically selected replay rows from the original training pool. `prepare_v2_data.py` reproduces that mixture.
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
from datasets import load_dataset
|
| 44 |
+
|
| 45 |
+
ds = load_dataset("asterbraid/awkweave-realistic-data")
|
| 46 |
+
print(ds["train"][0])
|
| 47 |
+
print(ds["frozen_test"][0])
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
## Scope and limitations
|
| 51 |
+
|
| 52 |
+
English, POSIX-style `awk`, and single-input text processing. No quoted CSV, external pipelines, or multi-file joins. Synthetic format coverage is not a substitute for broad real-world evaluation. The 37-row frozen set is a small qualitative benchmark, not a statistically comprehensive measurement.
|
| 53 |
+
|
| 54 |
+
## Provenance and license
|
| 55 |
+
|
| 56 |
+
All examples are original synthetic artifacts with no scraped text or personal data. Programs and outputs are execution-verified; natural-language requests are template-generated. Rows are **CC-BY-4.0**; attribute **Asterbraid**. Included code is Apache-2.0.
|
awkweave/__init__.py
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Awkweave: execution-verified natural-language-to-awk tools."""
|
| 2 |
+
|
| 3 |
+
__version__ = "0.1.0"
|
awkweave/execution.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import re
|
| 4 |
+
import resource
|
| 5 |
+
import shutil
|
| 6 |
+
import subprocess
|
| 7 |
+
|
| 8 |
+
MAX_INPUT_BYTES = 1_000_000
|
| 9 |
+
MAX_PROGRAM_CHARS = 8_000
|
| 10 |
+
FORBIDDEN_PATTERN = re.compile(
|
| 11 |
+
r"\b(?:system|getline|ARGV|ARGC|ENVIRON|FILENAME|FNR|nextfile|close)\b",
|
| 12 |
+
re.IGNORECASE,
|
| 13 |
+
)
|
| 14 |
+
OUTPUT_REDIRECT_PATTERN = re.compile(
|
| 15 |
+
r"\bprintf?\b[^;\n}]*(?:>\s*(?:[\"/]|[A-Za-z_$])|(?<!\|)\|(?!\|))",
|
| 16 |
+
re.IGNORECASE,
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class UnsafeProgramError(ValueError):
|
| 21 |
+
pass
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def check_program(program: str) -> str:
|
| 25 |
+
program = program.strip()
|
| 26 |
+
if not program:
|
| 27 |
+
raise UnsafeProgramError("The awk program is empty.")
|
| 28 |
+
if len(program) > MAX_PROGRAM_CHARS:
|
| 29 |
+
raise UnsafeProgramError("The awk program is too long.")
|
| 30 |
+
if "\x00" in program:
|
| 31 |
+
raise UnsafeProgramError("The awk program contains a null byte.")
|
| 32 |
+
match = FORBIDDEN_PATTERN.search(program)
|
| 33 |
+
if match:
|
| 34 |
+
raise UnsafeProgramError(f"File, environment, and process access are not allowed: {match.group()}")
|
| 35 |
+
if OUTPUT_REDIRECT_PATTERN.search(program):
|
| 36 |
+
raise UnsafeProgramError("Output redirection and pipes are not allowed.")
|
| 37 |
+
return program
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
def limit_resources() -> None:
|
| 41 |
+
resource.setrlimit(resource.RLIMIT_CPU, (2, 2))
|
| 42 |
+
resource.setrlimit(resource.RLIMIT_AS, (256_000_000, 256_000_000))
|
| 43 |
+
resource.setrlimit(resource.RLIMIT_FSIZE, (1_000_000, 1_000_000))
|
| 44 |
+
resource.setrlimit(resource.RLIMIT_CORE, (0, 0))
|
| 45 |
+
resource.setrlimit(resource.RLIMIT_NOFILE, (16, 16))
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
def run_awk(program: str, input_text: str, timeout: float = 3.0) -> str:
|
| 49 |
+
program = check_program(program)
|
| 50 |
+
if len(input_text.encode("utf-8")) > MAX_INPUT_BYTES:
|
| 51 |
+
raise ValueError("Input text exceeds the 1 MB limit.")
|
| 52 |
+
executable = shutil.which("awk")
|
| 53 |
+
if executable is None:
|
| 54 |
+
raise RuntimeError("No awk executable is available on PATH.")
|
| 55 |
+
result = subprocess.run(
|
| 56 |
+
[executable, program],
|
| 57 |
+
input=input_text,
|
| 58 |
+
text=True,
|
| 59 |
+
capture_output=True,
|
| 60 |
+
timeout=timeout,
|
| 61 |
+
env={"LC_ALL": "C", "PATH": "/usr/bin:/bin"},
|
| 62 |
+
preexec_fn=limit_resources,
|
| 63 |
+
start_new_session=True,
|
| 64 |
+
check=False,
|
| 65 |
+
)
|
| 66 |
+
if result.returncode != 0:
|
| 67 |
+
raise ValueError(result.stderr.strip() or f"awk exited with status {result.returncode}")
|
| 68 |
+
return result.stdout
|
awkweave/prompts.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
SYSTEM_PROMPT = """You write POSIX awk programs for text-processing requests. Given a request and sample input, return only the awk program, not the awk command or Markdown. Do not read or write files, invoke commands, or explain."""
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
def user_prompt(request: str, input_text: str) -> str:
|
| 5 |
+
return f"Request:\n{request.strip()}\n\nSample input:\n```text\n{input_text.rstrip()}\n```"
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
def messages(request: str, input_text: str) -> list[dict[str, str]]:
|
| 9 |
+
return [
|
| 10 |
+
{"role": "system", "content": SYSTEM_PROMPT},
|
| 11 |
+
{"role": "user", "content": user_prompt(request, input_text)},
|
| 12 |
+
]
|
data/frozen_test.jsonl
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id":"awkweave-frozen-0001","request":"Using pipe delimiters, count TCP flows and print 0 when none exist.","program":"BEGIN{FS=\"|\"}$4==\"TCP\"{n++}END{print n+0}","input_text":"2026-12-01T10:00:00Z|10.0.0.1|10.0.0.2|TCP|12|1400\n2026-12-01T10:00:01Z|10.0.0.3|10.0.0.2|UDP|4|240\n2026-12-01T10:00:02Z|10.0.0.1|10.0.0.4|TCP|8|900\n2026-12-01T10:00:03Z|10.0.0.2|10.0.0.5|ICMP|1|64\n2026-12-01T10:00:04Z|10.0.0.3|10.0.0.1|UDP|7|630\n","expected_output":"2\n","validation_input":"2026-12-01T11:00:00Z|10.1.0.1|10.1.0.2|TCP|5|500\n2026-12-01T11:00:01Z|10.1.0.4|10.1.0.1|TCP|9|1100\n2026-12-01T11:00:02Z|10.1.0.2|10.1.0.4|UDP|3|180\n2026-12-01T11:00:03Z|10.1.0.4|10.1.0.5|TCP|2|250\n","validation_output":"3\n","family":"flow_tcp_count","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 2 |
+
{"id":"awkweave-frozen-0002","request":"Sum bytes in field 6 of these pipe-delimited flows.","program":"BEGIN{FS=\"|\"}{s+=$6}END{print s+0}","input_text":"2026-12-01T10:00:00Z|10.0.0.1|10.0.0.2|TCP|12|1400\n2026-12-01T10:00:01Z|10.0.0.3|10.0.0.2|UDP|4|240\n2026-12-01T10:00:02Z|10.0.0.1|10.0.0.4|TCP|8|900\n2026-12-01T10:00:03Z|10.0.0.2|10.0.0.5|ICMP|1|64\n2026-12-01T10:00:04Z|10.0.0.3|10.0.0.1|UDP|7|630\n","expected_output":"3234\n","validation_input":"2026-12-01T11:00:00Z|10.1.0.1|10.1.0.2|TCP|5|500\n2026-12-01T11:00:01Z|10.1.0.4|10.1.0.1|TCP|9|1100\n2026-12-01T11:00:02Z|10.1.0.2|10.1.0.4|UDP|3|180\n2026-12-01T11:00:03Z|10.1.0.4|10.1.0.5|TCP|2|250\n","validation_output":"2030\n","family":"flow_bytes_total","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 3 |
+
{"id":"awkweave-frozen-0003","request":"For pipe-delimited flows, total bytes per protocol in first-appearance order.","program":"BEGIN{FS=\"|\"}{if(!($4 in sums))order[++n]=$4;sums[$4]+=$6}END{for(i=1;i<=n;i++)print order[i],sums[order[i]]}","input_text":"2026-12-01T10:00:00Z|10.0.0.1|10.0.0.2|TCP|12|1400\n2026-12-01T10:00:01Z|10.0.0.3|10.0.0.2|UDP|4|240\n2026-12-01T10:00:02Z|10.0.0.1|10.0.0.4|TCP|8|900\n2026-12-01T10:00:03Z|10.0.0.2|10.0.0.5|ICMP|1|64\n2026-12-01T10:00:04Z|10.0.0.3|10.0.0.1|UDP|7|630\n","expected_output":"TCP 2300\nUDP 870\nICMP 64\n","validation_input":"2026-12-01T11:00:00Z|10.1.0.1|10.1.0.2|TCP|5|500\n2026-12-01T11:00:01Z|10.1.0.4|10.1.0.1|TCP|9|1100\n2026-12-01T11:00:02Z|10.1.0.2|10.1.0.4|UDP|3|180\n2026-12-01T11:00:03Z|10.1.0.4|10.1.0.5|TCP|2|250\n","validation_output":"TCP 1850\nUDP 180\n","family":"flow_protocol_bytes","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 4 |
+
{"id":"awkweave-frozen-0004","request":"For UDP flows, print average packets to two decimals. Fields are pipe-delimited.","program":"BEGIN{FS=\"|\"}$4==\"UDP\"{s+=$5;n++}END{printf \"%.2f\\n\",s/n}","input_text":"2026-12-01T10:00:00Z|10.0.0.1|10.0.0.2|TCP|12|1400\n2026-12-01T10:00:01Z|10.0.0.3|10.0.0.2|UDP|4|240\n2026-12-01T10:00:02Z|10.0.0.1|10.0.0.4|TCP|8|900\n2026-12-01T10:00:03Z|10.0.0.2|10.0.0.5|ICMP|1|64\n2026-12-01T10:00:04Z|10.0.0.3|10.0.0.1|UDP|7|630\n","expected_output":"5.50\n","validation_input":"2026-12-01T11:00:00Z|10.1.0.1|10.1.0.2|TCP|5|500\n2026-12-01T11:00:01Z|10.1.0.4|10.1.0.1|TCP|9|1100\n2026-12-01T11:00:02Z|10.1.0.2|10.1.0.4|UDP|3|180\n2026-12-01T11:00:03Z|10.1.0.4|10.1.0.5|TCP|2|250\n","validation_output":"3.00\n","family":"flow_udp_average","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 5 |
+
{"id":"awkweave-frozen-0005","request":"Count distinct destination IPs in field 3 of this pipe-delimited data.","program":"BEGIN{FS=\"|\"}{if(!seen[$3]++)n++}END{print n+0}","input_text":"2026-12-01T10:00:00Z|10.0.0.1|10.0.0.2|TCP|12|1400\n2026-12-01T10:00:01Z|10.0.0.3|10.0.0.2|UDP|4|240\n2026-12-01T10:00:02Z|10.0.0.1|10.0.0.4|TCP|8|900\n2026-12-01T10:00:03Z|10.0.0.2|10.0.0.5|ICMP|1|64\n2026-12-01T10:00:04Z|10.0.0.3|10.0.0.1|UDP|7|630\n","expected_output":"4\n","validation_input":"2026-12-01T11:00:00Z|10.1.0.1|10.1.0.2|TCP|5|500\n2026-12-01T11:00:01Z|10.1.0.4|10.1.0.1|TCP|9|1100\n2026-12-01T11:00:02Z|10.1.0.2|10.1.0.4|UDP|3|180\n2026-12-01T11:00:03Z|10.1.0.4|10.1.0.5|TCP|2|250\n","validation_output":"4\n","family":"flow_destination_count","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 6 |
+
{"id":"awkweave-frozen-0006","request":"Print the two complete flows with the most bytes, highest first and stable on ties.","program":"BEGIN{FS=\"|\"}{v[NR]=$6+0;line[NR]=$0}END{for(i=2;i<=NR;i++){x=v[i];s=line[i];j=i-1;while(j>=1&&v[j]<x){v[j+1]=v[j];line[j+1]=line[j];j--}v[j+1]=x;line[j+1]=s}for(i=1;i<=2&&i<=NR;i++)print line[i]}","input_text":"2026-12-01T10:00:00Z|10.0.0.1|10.0.0.2|TCP|12|1400\n2026-12-01T10:00:01Z|10.0.0.3|10.0.0.2|UDP|4|240\n2026-12-01T10:00:02Z|10.0.0.1|10.0.0.4|TCP|8|900\n2026-12-01T10:00:03Z|10.0.0.2|10.0.0.5|ICMP|1|64\n2026-12-01T10:00:04Z|10.0.0.3|10.0.0.1|UDP|7|630\n","expected_output":"2026-12-01T10:00:00Z|10.0.0.1|10.0.0.2|TCP|12|1400\n2026-12-01T10:00:02Z|10.0.0.1|10.0.0.4|TCP|8|900\n","validation_input":"2026-12-01T11:00:00Z|10.1.0.1|10.1.0.2|TCP|5|500\n2026-12-01T11:00:01Z|10.1.0.4|10.1.0.1|TCP|9|1100\n2026-12-01T11:00:02Z|10.1.0.2|10.1.0.4|UDP|3|180\n2026-12-01T11:00:03Z|10.1.0.4|10.1.0.5|TCP|2|250\n","validation_output":"2026-12-01T11:00:01Z|10.1.0.4|10.1.0.1|TCP|9|1100\n2026-12-01T11:00:00Z|10.1.0.1|10.1.0.2|TCP|5|500\n","family":"flow_top_sources","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 7 |
+
{"id":"awkweave-frozen-0007","request":"The CSV has a header. Print sku for products with stock below 5; fields contain no quoted commas.","program":"BEGIN{FS=OFS=\",\"}NR==1{for(i=1;i<=NF;i++)h[$i]=i;next}$h[\"stock\"]<5{print $h[\"sku\"]}","input_text":"sku,category,price,stock\nA1,book,12.50,3\nB2,tool,20.00,0\nC3,book,7.50,8\nD4,tool,15.00,2\nE5,game,30.00,1\n","expected_output":"A1\nB2\nD4\nE5\n","validation_input":"sku,category,price,stock\nF6,game,10.00,4\nG7,book,5.00,0\nH8,tool,25.00,3\nI9,game,8.00,2\n","validation_output":"F6\nG7\nH8\nI9\n","family":"inventory_low_stock","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 8 |
+
{"id":"awkweave-frozen-0008","request":"Read stock by its CSV header and print total units in inventory.","program":"BEGIN{FS=OFS=\",\"}NR==1{for(i=1;i<=NF;i++)h[$i]=i;next}{s+=$h[\"stock\"]}END{print s+0}","input_text":"sku,category,price,stock\nA1,book,12.50,3\nB2,tool,20.00,0\nC3,book,7.50,8\nD4,tool,15.00,2\nE5,game,30.00,1\n","expected_output":"14\n","validation_input":"sku,category,price,stock\nF6,game,10.00,4\nG7,book,5.00,0\nH8,tool,25.00,3\nI9,game,8.00,2\n","validation_output":"9\n","family":"inventory_units","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 9 |
+
{"id":"awkweave-frozen-0009","request":"Using the CSV header, print the mean price over products to two decimals.","program":"BEGIN{FS=OFS=\",\"}NR==1{for(i=1;i<=NF;i++)h[$i]=i;next}{s+=$h[\"price\"];n++}END{printf \"%.2f\\n\",s/n}","input_text":"sku,category,price,stock\nA1,book,12.50,3\nB2,tool,20.00,0\nC3,book,7.50,8\nD4,tool,15.00,2\nE5,game,30.00,1\n","expected_output":"17.00\n","validation_input":"sku,category,price,stock\nF6,game,10.00,4\nG7,book,5.00,0\nH8,tool,25.00,3\nI9,game,8.00,2\n","validation_output":"12.00\n","family":"inventory_average_price","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 10 |
+
{"id":"awkweave-frozen-0010","request":"Count products whose stock field is zero in this simple CSV with a header.","program":"BEGIN{FS=OFS=\",\"}NR==1{for(i=1;i<=NF;i++)h[$i]=i;next}$h[\"stock\"]==0{n++}END{print n+0}","input_text":"sku,category,price,stock\nA1,book,12.50,3\nB2,tool,20.00,0\nC3,book,7.50,8\nD4,tool,15.00,2\nE5,game,30.00,1\n","expected_output":"1\n","validation_input":"sku,category,price,stock\nF6,game,10.00,4\nG7,book,5.00,0\nH8,tool,25.00,3\nI9,game,8.00,2\n","validation_output":"1\n","family":"inventory_out_of_stock","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 11 |
+
{"id":"awkweave-frozen-0011","request":"Print each category and its total inventory value (price times stock) to two decimals, in first-appearance order.","program":"BEGIN{FS=OFS=\",\"}NR==1{for(i=1;i<=NF;i++)h[$i]=i;next}{key=$h[\"category\"];if(!(key in sums))order[++n]=key;sums[key]+=$h[\"price\"]*$h[\"stock\"]}END{for(i=1;i<=n;i++)printf \"%s %.2f\\n\",order[i],sums[order[i]]}","input_text":"sku,category,price,stock\nA1,book,12.50,3\nB2,tool,20.00,0\nC3,book,7.50,8\nD4,tool,15.00,2\nE5,game,30.00,1\n","expected_output":"book 97.50\ntool 30.00\ngame 30.00\n","validation_input":"sku,category,price,stock\nF6,game,10.00,4\nG7,book,5.00,0\nH8,tool,25.00,3\nI9,game,8.00,2\n","validation_output":"game 56.00\nbook 0.00\ntool 75.00\n","family":"inventory_category_value","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 12 |
+
{"id":"awkweave-frozen-0012","request":"Skip the CSV header and print the complete product with the highest price, keeping the earliest on ties.","program":"BEGIN{FS=OFS=\",\"}NR==1{for(i=1;i<=NF;i++)h[$i]=i;next}NR==2{best=$h[\"price\"];record=$0}$h[\"price\"]>best{best=$h[\"price\"];record=$0}END{print record}","input_text":"sku,category,price,stock\nA1,book,12.50,3\nB2,tool,20.00,0\nC3,book,7.50,8\nD4,tool,15.00,2\nE5,game,30.00,1\n","expected_output":"E5,game,30.00,1\n","validation_input":"sku,category,price,stock\nF6,game,10.00,4\nG7,book,5.00,0\nH8,tool,25.00,3\nI9,game,8.00,2\n","validation_output":"H8,tool,25.00,3\n","family":"inventory_highest_price","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 13 |
+
{"id":"awkweave-frozen-0013","request":"Count syslog lines containing the exact word Failed.","program":"$0 ~ /Failed/{n++}END{print n+0}","input_text":"Dec 01 10:00:00 web01 sshd[101]: Failed password for invalid user admin\nDec 01 10:00:01 db01 cron[102]: (root) CMD (backup)\nDec 01 10:00:02 web01 sshd[103]: Accepted publickey for alice\nDec 01 10:00:03 cache01 redis[104]: Error allocating buffer\nDec 01 10:00:04 db01 cron[105]: (root) CMD (cleanup)\n","expected_output":"1\n","validation_input":"Dec 02 11:00:00 api01 sshd[201]: Accepted password for bruno\nDec 02 11:00:01 api01 sshd[202]: Failed password for root\nDec 02 11:00:02 job01 cron[203]: (daemon) CMD (index)\nDec 02 11:00:03 api01 nginx[204]: Error connecting upstream\n","validation_output":"1\n","family":"syslog_failed_count","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 14 |
+
{"id":"awkweave-frozen-0014","request":"Print hostnames (field 4) for records whose process field begins with sshd.","program":"$5 ~ /^sshd/{print $4}","input_text":"Dec 01 10:00:00 web01 sshd[101]: Failed password for invalid user admin\nDec 01 10:00:01 db01 cron[102]: (root) CMD (backup)\nDec 01 10:00:02 web01 sshd[103]: Accepted publickey for alice\nDec 01 10:00:03 cache01 redis[104]: Error allocating buffer\nDec 01 10:00:04 db01 cron[105]: (root) CMD (cleanup)\n","expected_output":"web01\nweb01\n","validation_input":"Dec 02 11:00:00 api01 sshd[201]: Accepted password for bruno\nDec 02 11:00:01 api01 sshd[202]: Failed password for root\nDec 02 11:00:02 job01 cron[203]: (daemon) CMD (index)\nDec 02 11:00:03 api01 nginx[204]: Error connecting upstream\n","validation_output":"api01\napi01\n","family":"syslog_sshd_hosts","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 15 |
+
{"id":"awkweave-frozen-0015","request":"Print complete syslog records containing error in any letter case.","program":"tolower($0) ~ /error/","input_text":"Dec 01 10:00:00 web01 sshd[101]: Failed password for invalid user admin\nDec 01 10:00:01 db01 cron[102]: (root) CMD (backup)\nDec 01 10:00:02 web01 sshd[103]: Accepted publickey for alice\nDec 01 10:00:03 cache01 redis[104]: Error allocating buffer\nDec 01 10:00:04 db01 cron[105]: (root) CMD (cleanup)\n","expected_output":"Dec 01 10:00:03 cache01 redis[104]: Error allocating buffer\n","validation_input":"Dec 02 11:00:00 api01 sshd[201]: Accepted password for bruno\nDec 02 11:00:01 api01 sshd[202]: Failed password for root\nDec 02 11:00:02 job01 cron[203]: (daemon) CMD (index)\nDec 02 11:00:03 api01 nginx[204]: Error connecting upstream\n","validation_output":"Dec 02 11:00:03 api01 nginx[204]: Error connecting upstream\n","family":"syslog_error_casefold","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 16 |
+
{"id":"awkweave-frozen-0016","request":"Extract the process name before [ in field 5 and count records per process in first-appearance order.","program":"{split($5,p,\"[\");if(!(p[1] in counts))order[++n]=p[1];counts[p[1]]++}END{for(i=1;i<=n;i++)print order[i],counts[order[i]]}","input_text":"Dec 01 10:00:00 web01 sshd[101]: Failed password for invalid user admin\nDec 01 10:00:01 db01 cron[102]: (root) CMD (backup)\nDec 01 10:00:02 web01 sshd[103]: Accepted publickey for alice\nDec 01 10:00:03 cache01 redis[104]: Error allocating buffer\nDec 01 10:00:04 db01 cron[105]: (root) CMD (cleanup)\n","expected_output":"sshd 2\ncron 2\nredis 1\n","validation_input":"Dec 02 11:00:00 api01 sshd[201]: Accepted password for bruno\nDec 02 11:00:01 api01 sshd[202]: Failed password for root\nDec 02 11:00:02 job01 cron[203]: (daemon) CMD (index)\nDec 02 11:00:03 api01 nginx[204]: Error connecting upstream\n","validation_output":"sshd 2\ncron 1\nnginx 1\n","family":"syslog_process_counts","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 17 |
+
{"id":"awkweave-frozen-0017","request":"For cron records, print month, day, and time (the first three fields).","program":"$5 ~ /^cron/{print $1,$2,$3}","input_text":"Dec 01 10:00:00 web01 sshd[101]: Failed password for invalid user admin\nDec 01 10:00:01 db01 cron[102]: (root) CMD (backup)\nDec 01 10:00:02 web01 sshd[103]: Accepted publickey for alice\nDec 01 10:00:03 cache01 redis[104]: Error allocating buffer\nDec 01 10:00:04 db01 cron[105]: (root) CMD (cleanup)\n","expected_output":"Dec 01 10:00:01\nDec 01 10:00:04\n","validation_input":"Dec 02 11:00:00 api01 sshd[201]: Accepted password for bruno\nDec 02 11:00:01 api01 sshd[202]: Failed password for root\nDec 02 11:00:02 job01 cron[203]: (daemon) CMD (index)\nDec 02 11:00:03 api01 nginx[204]: Error connecting upstream\n","validation_output":"Dec 02 11:00:02\n","family":"syslog_cron_timestamp","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 18 |
+
{"id":"awkweave-frozen-0018","request":"Count distinct hostnames in field 4 of the syslog input.","program":"{if(!seen[$4]++)n++}END{print n+0}","input_text":"Dec 01 10:00:00 web01 sshd[101]: Failed password for invalid user admin\nDec 01 10:00:01 db01 cron[102]: (root) CMD (backup)\nDec 01 10:00:02 web01 sshd[103]: Accepted publickey for alice\nDec 01 10:00:03 cache01 redis[104]: Error allocating buffer\nDec 01 10:00:04 db01 cron[105]: (root) CMD (cleanup)\n","expected_output":"3\n","validation_input":"Dec 02 11:00:00 api01 sshd[201]: Accepted password for bruno\nDec 02 11:00:01 api01 sshd[202]: Failed password for root\nDec 02 11:00:02 job01 cron[203]: (daemon) CMD (index)\nDec 02 11:00:03 api01 nginx[204]: Error connecting upstream\n","validation_output":"2\n","family":"syslog_unique_hosts","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 19 |
+
{"id":"awkweave-frozen-0019","request":"In colon-delimited group data, print group names containing alice as a comma-separated member of field 4.","program":"BEGIN{FS=\":\"}{split($4,members,\",\");for(i in members)if(members[i]==\"alice\")print $1}","input_text":"wheel:x:10:alice,bruno\ndevelopers:x:1000:alice,chen,dina\naudio:x:29:\nusers:x:100:bruno,eli\n","expected_output":"wheel\ndevelopers\n","validation_input":"admins:x:4:farah\ndevelopers:x:1000:farah,gus\nvideo:x:44:gus,hana,ivan\n","validation_output":"","family":"group_membership","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 20 |
+
{"id":"awkweave-frozen-0020","request":"For each colon-delimited group, print its name and number of members; an empty fourth field means zero.","program":"BEGIN{FS=\":\"}{n=split($4,members,\",\");if($4==\"\")n=0;print $1,n}","input_text":"wheel:x:10:alice,bruno\ndevelopers:x:1000:alice,chen,dina\naudio:x:29:\nusers:x:100:bruno,eli\n","expected_output":"wheel 2\ndevelopers 3\naudio 0\nusers 2\n","validation_input":"admins:x:4:farah\ndevelopers:x:1000:farah,gus\nvideo:x:44:gus,hana,ivan\n","validation_output":"admins 1\ndevelopers 2\nvideo 3\n","family":"group_member_counts","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 21 |
+
{"id":"awkweave-frozen-0021","request":"Print names of colon-delimited groups with numeric GID at least 1000.","program":"BEGIN{FS=\":\"}$3>=1000{print $1}","input_text":"wheel:x:10:alice,bruno\ndevelopers:x:1000:alice,chen,dina\naudio:x:29:\nusers:x:100:bruno,eli\n","expected_output":"developers\n","validation_input":"admins:x:4:farah\ndevelopers:x:1000:farah,gus\nvideo:x:44:gus,hana,ivan\n","validation_output":"developers\n","family":"group_gid_filter","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 22 |
+
{"id":"awkweave-frozen-0022","request":"For each device in column 1, print its average reading from column 3 to two decimals in first-appearance order.","program":"{if(!($1 in sums))order[++n]=$1;sums[$1]+=$3;counts[$1]++}END{for(i=1;i<=n;i++)printf \"%s %.2f\\n\",order[i],sums[order[i]]/counts[order[i]]}","input_text":"s1 temperature 20.5 C\ns2 humidity 45.0 percent\ns1 temperature 22.0 C\ns3 pressure 101.2 kPa\ns2 humidity 47.5 percent\n","expected_output":"s1 21.25\ns2 46.25\ns3 101.20\n","validation_input":"s4 temperature 18.0 C\ns4 temperature 19.5 C\ns5 humidity 52.0 percent\ns6 pressure 100.8 kPa\n","validation_output":"s4 18.75\ns5 52.00\ns6 100.80\n","family":"sensor_device_average","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 23 |
+
{"id":"awkweave-frozen-0023","request":"Print complete readings with value in column 3 greater than 45.","program":"$3>45","input_text":"s1 temperature 20.5 C\ns2 humidity 45.0 percent\ns1 temperature 22.0 C\ns3 pressure 101.2 kPa\ns2 humidity 47.5 percent\n","expected_output":"s3 pressure 101.2 kPa\ns2 humidity 47.5 percent\n","validation_input":"s4 temperature 18.0 C\ns4 temperature 19.5 C\ns5 humidity 52.0 percent\ns6 pressure 100.8 kPa\n","validation_output":"s5 humidity 52.0 percent\ns6 pressure 100.8 kPa\n","family":"sensor_threshold","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 24 |
+
{"id":"awkweave-frozen-0024","request":"For each metric in column 2, print its maximum value from column 3 in first-appearance order.","program":"{if(!($2 in seen)){order[++n]=$2;seen[$2]=1;max[$2]=$3}if($3>max[$2])max[$2]=$3}END{for(i=1;i<=n;i++)print order[i],max[order[i]]}","input_text":"s1 temperature 20.5 C\ns2 humidity 45.0 percent\ns1 temperature 22.0 C\ns3 pressure 101.2 kPa\ns2 humidity 47.5 percent\n","expected_output":"temperature 22.0\nhumidity 47.5\npressure 101.2\n","validation_input":"s4 temperature 18.0 C\ns4 temperature 19.5 C\ns5 humidity 52.0 percent\ns6 pressure 100.8 kPa\n","validation_output":"temperature 19.5\nhumidity 52.0\npressure 100.8\n","family":"sensor_metric_max","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 25 |
+
{"id":"awkweave-frozen-0025","request":"Count distinct device identifiers in column 1.","program":"{if(!seen[$1]++)n++}END{print n+0}","input_text":"s1 temperature 20.5 C\ns2 humidity 45.0 percent\ns1 temperature 22.0 C\ns3 pressure 101.2 kPa\ns2 humidity 47.5 percent\n","expected_output":"3\n","validation_input":"s4 temperature 18.0 C\ns4 temperature 19.5 C\ns5 humidity 52.0 percent\ns6 pressure 100.8 kPa\n","validation_output":"3\n","family":"sensor_device_count","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 26 |
+
{"id":"awkweave-frozen-0026","request":"Print device and value for readings whose unit in column 4 is C.","program":"$4==\"C\"{print $1,$3}","input_text":"s1 temperature 20.5 C\ns2 humidity 45.0 percent\ns1 temperature 22.0 C\ns3 pressure 101.2 kPa\ns2 humidity 47.5 percent\n","expected_output":"s1 20.5\ns1 22.0\n","validation_input":"s4 temperature 18.0 C\ns4 temperature 19.5 C\ns5 humidity 52.0 percent\ns6 pressure 100.8 kPa\n","validation_output":"s4 18.0\ns4 19.5\n","family":"sensor_unit_filter","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 27 |
+
{"id":"awkweave-frozen-0027","request":"Convert tab-separated rows to comma-separated rows while preserving all fields.","program":"BEGIN{FS=\"\\t\";OFS=\",\"}{$1=$1;print}","input_text":"a\t1\tx\nb\t2\ty\n","expected_output":"a,1,x\nb,2,y\n","validation_input":"c\t3\tz\nd\t4\tw\n","validation_output":"c,3,z\nd,4,w\n","family":"tsv_to_csv","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 28 |
+
{"id":"awkweave-frozen-0028","request":"For each record, print column 1 and the running mean of column 3 to two decimals.","program":"{s+=$3;n++;printf \"%s %.2f\\n\",$1,s/n}","input_text":"s1 temperature 20.5 C\ns2 humidity 45.0 percent\ns1 temperature 22.0 C\ns3 pressure 101.2 kPa\ns2 humidity 47.5 percent\n","expected_output":"s1 20.50\ns2 32.75\ns1 29.17\ns3 47.17\ns2 47.24\n","validation_input":"s4 temperature 18.0 C\ns4 temperature 19.5 C\ns5 humidity 52.0 percent\ns6 pressure 100.8 kPa\n","validation_output":"s4 18.00\ns4 18.75\ns5 29.83\ns6 47.58\n","family":"running_average","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 29 |
+
{"id":"awkweave-frozen-0029","request":"Print the median of column 3; for an even number of records use the lower middle value.","program":"{v[NR]=$3+0}END{for(i=2;i<=NR;i++){x=v[i];j=i-1;while(j>=1&&v[j]>x){v[j+1]=v[j];j--}v[j+1]=x}print v[int((NR+1)/2)]}","input_text":"s1 temperature 20.5 C\ns2 humidity 45.0 percent\ns1 temperature 22.0 C\ns3 pressure 101.2 kPa\ns2 humidity 47.5 percent\n","expected_output":"45\n","validation_input":"s4 temperature 18.0 C\ns4 temperature 19.5 C\ns5 humidity 52.0 percent\ns6 pressure 100.8 kPa\n","validation_output":"19.5\n","family":"median_value","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 30 |
+
{"id":"awkweave-frozen-0030","request":"Remove blank lines and lines whose first non-whitespace character is #.","program":"$0 ~ /[^[:space:]]/ && $0 !~ /^[[:space:]]*#/","input_text":"# comment\na 1\n\n # another\nb 2\n","expected_output":"a 1\nb 2\n","validation_input":"c 3\n# note\n\nd 4\n","validation_output":"c 3\nd 4\n","family":"comment_filter","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 31 |
+
{"id":"awkweave-frozen-0031","request":"Count lines whose first non-whitespace character is #, excluding blank lines.","program":"$0 ~ /^[[:space:]]*#/{n++}END{print n+0}","input_text":"# comment\na 1\n\n # another\nb 2\n","expected_output":"2\n","validation_input":"c 3\n# note\n\nd 4\n","validation_output":"1\n","family":"comment_count","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 32 |
+
{"id":"awkweave-frozen-0032","request":"Trim leading and trailing whitespace from each line without altering internal spacing.","program":"{gsub(/^[[:space:]]+|[[:space:]]+$/,\"\",$0);print}","input_text":" a 1 \n\tb 2\t\n","expected_output":"a 1\nb 2\n","validation_input":" c 3 \n d 4 \n","validation_output":"c 3\nd 4\n","family":"trim_lines","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 33 |
+
{"id":"awkweave-frozen-0033","request":"For ISO timestamps in field 1, print year, month, and day separated by hyphens.","program":"BEGIN{OFS=\"-\"}{split($1,date,\"-\");split(date[3],parts,\"T\");print date[1],date[2],parts[1]}","input_text":"2026-12-01T10:00:00Z|10.0.0.1|10.0.0.2|TCP|12|1400\n2026-12-01T10:00:01Z|10.0.0.3|10.0.0.2|UDP|4|240\n2026-12-01T10:00:02Z|10.0.0.1|10.0.0.4|TCP|8|900\n2026-12-01T10:00:03Z|10.0.0.2|10.0.0.5|ICMP|1|64\n2026-12-01T10:00:04Z|10.0.0.3|10.0.0.1|UDP|7|630\n","expected_output":"2026-12-01\n2026-12-01\n2026-12-01\n2026-12-01\n2026-12-01\n","validation_input":"2026-12-01T11:00:00Z|10.1.0.1|10.1.0.2|TCP|5|500\n2026-12-01T11:00:01Z|10.1.0.4|10.1.0.1|TCP|9|1100\n2026-12-01T11:00:02Z|10.1.0.2|10.1.0.4|UDP|3|180\n2026-12-01T11:00:03Z|10.1.0.4|10.1.0.5|TCP|2|250\n","validation_output":"2026-12-01\n2026-12-01\n2026-12-01\n2026-12-01\n","family":"iso_date_parts","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 34 |
+
{"id":"awkweave-frozen-0034","request":"Print complete records sorted by column 3 ascending, preserving input order on ties.","program":"{v[NR]=$3+0;line[NR]=$0}END{for(i=2;i<=NR;i++){x=v[i];s=line[i];j=i-1;while(j>=1&&v[j]>x){v[j+1]=v[j];line[j+1]=line[j];j--}v[j+1]=x;line[j+1]=s}for(i=1;i<=NR;i++)print line[i]}","input_text":"s1 temperature 20.5 C\ns2 humidity 45.0 percent\ns1 temperature 22.0 C\ns3 pressure 101.2 kPa\ns2 humidity 47.5 percent\n","expected_output":"s1 temperature 20.5 C\ns1 temperature 22.0 C\ns2 humidity 45.0 percent\ns2 humidity 47.5 percent\ns3 pressure 101.2 kPa\n","validation_input":"s4 temperature 18.0 C\ns4 temperature 19.5 C\ns5 humidity 52.0 percent\ns6 pressure 100.8 kPa\n","validation_output":"s4 temperature 18.0 C\ns4 temperature 19.5 C\ns5 humidity 52.0 percent\ns6 pressure 100.8 kPa\n","family":"sort_numeric_ascending","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 35 |
+
{"id":"awkweave-frozen-0035","request":"Sum column 3 only for temperature records, printing 0 when no such records exist.","program":"$2==\"temperature\"{s+=$3}END{print s+0}","input_text":"s1 temperature 20.5 C\ns2 humidity 45.0 percent\ns1 temperature 22.0 C\ns3 pressure 101.2 kPa\ns2 humidity 47.5 percent\n","expected_output":"42.5\n","validation_input":"s4 temperature 18.0 C\ns4 temperature 19.5 C\ns5 humidity 52.0 percent\ns6 pressure 100.8 kPa\n","validation_output":"37.5\n","family":"sum_if_metric","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 36 |
+
{"id":"awkweave-frozen-0036","request":"Print only the first complete record for each device in column 1.","program":"!seen[$1]++","input_text":"s1 temperature 20.5 C\ns2 humidity 45.0 percent\ns1 temperature 22.0 C\ns3 pressure 101.2 kPa\ns2 humidity 47.5 percent\n","expected_output":"s1 temperature 20.5 C\ns2 humidity 45.0 percent\ns3 pressure 101.2 kPa\n","validation_input":"s4 temperature 18.0 C\ns4 temperature 19.5 C\ns5 humidity 52.0 percent\ns6 pressure 100.8 kPa\n","validation_output":"s4 temperature 18.0 C\ns5 humidity 52.0 percent\ns6 pressure 100.8 kPa\n","family":"first_record_per_device","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
| 37 |
+
{"id":"awkweave-frozen-0037","request":"Count records per unit in column 4 in first-appearance order.","program":"{if(!($4 in counts))order[++n]=$4;counts[$4]++}END{for(i=1;i<=n;i++)print order[i],counts[order[i]]}","input_text":"s1 temperature 20.5 C\ns2 humidity 45.0 percent\ns1 temperature 22.0 C\ns3 pressure 101.2 kPa\ns2 humidity 47.5 percent\n","expected_output":"C 2\npercent 2\nkPa 1\n","validation_input":"s4 temperature 18.0 C\ns4 temperature 19.5 C\ns5 humidity 52.0 percent\ns6 pressure 100.8 kPa\n","validation_output":"C 2\npercent 1\nkPa 1\n","family":"count_units","difficulty":3,"split":"frozen_test","source":"original-frozen-hand-authored","license":"CC-BY-4.0"}
|
data/train.jsonl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5f11bf1bdf576014c2d24db6372f3300fa7ce64f78515e20a720ce506471aaac
|
| 3 |
+
size 51699447
|
expand_realistic_data.py
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import argparse
|
| 4 |
+
import concurrent.futures
|
| 5 |
+
import json
|
| 6 |
+
import random
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
|
| 9 |
+
from awkweave.execution import run_awk
|
| 10 |
+
from generate_data import Case, NAMES, STATUSES, WORDS, pair, render, rows
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def apache(rng: random.Random) -> list[str]:
|
| 14 |
+
outputs = []
|
| 15 |
+
methods = ["GET", "POST", "PUT", "DELETE"]
|
| 16 |
+
paths = ["/index.html", "/api/orders", "/api/items", "/health", "/missing", "/assets/app.js"]
|
| 17 |
+
for _ in range(2):
|
| 18 |
+
lines = []
|
| 19 |
+
for _ in range(rng.randint(7, 12)):
|
| 20 |
+
ip = f"192.0.2.{rng.randint(1, 254)}"
|
| 21 |
+
method = rng.choice(methods)
|
| 22 |
+
path = rng.choice(paths)
|
| 23 |
+
status = rng.choice([200, 200, 200, 201, 204, 400, 404, 500, 502, 503])
|
| 24 |
+
size = rng.randint(0, 5000)
|
| 25 |
+
lines.append(f'{ip} - - [28/Nov/2026:10:00:00 +0000] "{method} {path} HTTP/1.1" {status} {size}')
|
| 26 |
+
outputs.append("\n".join(lines) + "\n")
|
| 27 |
+
return outputs
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
def with_regions(rng: random.Random, kinds: list[str]) -> list[list[str]]:
|
| 31 |
+
result = rows(rng, kinds)
|
| 32 |
+
if "category" in kinds:
|
| 33 |
+
index = kinds.index("category")
|
| 34 |
+
for row in result:
|
| 35 |
+
row[index] = rng.choice(["east", "west", "north", "south"])
|
| 36 |
+
return result
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
def sales_pair(rng: random.Random) -> tuple[list[str], list[str]]:
|
| 40 |
+
columns = [("order_id", "id"), ("region", "category"), ("amount", "smallint"), ("status", "status"), ("units", "smallint")]
|
| 41 |
+
rng.shuffle(columns)
|
| 42 |
+
headers = [name for name, _ in columns]
|
| 43 |
+
kinds = [kind for _, kind in columns]
|
| 44 |
+
old = STATUSES[:]
|
| 45 |
+
STATUSES[:] = ["paid", "pending", "void", "paid"]
|
| 46 |
+
try:
|
| 47 |
+
inputs = [render(with_regions(rng, kinds), header=headers), render(with_regions(rng, kinds), header=headers)]
|
| 48 |
+
finally:
|
| 49 |
+
STATUSES[:] = old
|
| 50 |
+
return headers, inputs
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
def keyvalues(rng: random.Random) -> list[str]:
|
| 54 |
+
outputs = []
|
| 55 |
+
services = ["web", "db", "api", "worker"]
|
| 56 |
+
levels = ["info", "INFO", "warn", "ERROR", "error", "debug"]
|
| 57 |
+
for _ in range(2):
|
| 58 |
+
lines = []
|
| 59 |
+
for index in range(rng.randint(7, 11)):
|
| 60 |
+
fields = [
|
| 61 |
+
f"level={rng.choice(levels)}", f"service={rng.choice(services)}",
|
| 62 |
+
f"latency={rng.randint(1, 80)}", f"shard={rng.randint(1, 4)}",
|
| 63 |
+
]
|
| 64 |
+
rng.shuffle(fields)
|
| 65 |
+
lines.append(f"2026-11-28T09:{index:02d}:00Z " + " ".join(fields))
|
| 66 |
+
outputs.append("\n".join(lines) + "\n")
|
| 67 |
+
return outputs
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
def passwd(rng: random.Random) -> list[str]:
|
| 71 |
+
outputs = []
|
| 72 |
+
shells = ["/bin/bash", "/bin/zsh", "/bin/sh", "/usr/sbin/nologin"]
|
| 73 |
+
for _ in range(2):
|
| 74 |
+
lines = []
|
| 75 |
+
for index, name in enumerate(rng.sample(NAMES, 8)):
|
| 76 |
+
uid = rng.choice([0, 1, 999, 1000, 1001, 1002, 1003])
|
| 77 |
+
lines.append(f"{name}:x:{uid}:{uid}:{name}:/home/{name}:{rng.choice(shells)}")
|
| 78 |
+
outputs.append("\n".join(lines) + "\n")
|
| 79 |
+
return outputs
|
| 80 |
+
|
| 81 |
+
|
| 82 |
+
def header_program(expression: str) -> str:
|
| 83 |
+
return f'NR==1{{for(i=1;i<=NF;i++)h[$i]=i;next}}{expression}'
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
def make_case(family: str, seed: int) -> Case:
|
| 87 |
+
rng = random.Random(seed)
|
| 88 |
+
if family == "http_status_class":
|
| 89 |
+
low, high, label = rng.choice([(200, 299, "2xx"), (400, 499, "4xx"), (500, 599, "5xx")])
|
| 90 |
+
return Case(f"Count responses in the HTTP {label} status class and print 0 when none exist.", f'$9>={low}&&$9<={high}{{n++}}END{{print n+0}}', apache(rng), family, 2)
|
| 91 |
+
if family == "http_bytes_total":
|
| 92 |
+
return Case("Sum response bytes from the last field and print one total.", '{s+=$NF}END{print s+0}', apache(rng), family, 1)
|
| 93 |
+
if family == "http_method":
|
| 94 |
+
method = rng.choice(["GET", "POST", "PUT", "DELETE"])
|
| 95 |
+
return Case(f"Print complete request records using the {method} method.", f'$6=="\\"{method}"', apache(rng), family, 2)
|
| 96 |
+
if family == "http_path":
|
| 97 |
+
prefix = rng.choice(["/api/", "/assets/"])
|
| 98 |
+
escaped = prefix.replace("/", "\\/")
|
| 99 |
+
return Case(f"Print request paths beginning with {prefix}.", f'$7 ~ /^{escaped}/{{print $7}}', apache(rng), family, 2)
|
| 100 |
+
if family == "http_success_average":
|
| 101 |
+
return Case("For HTTP 200 responses only, print mean response bytes to two decimal places.", '$9==200{s+=$10;n++}END{printf "%.2f\\n",s/n}', apache(rng), family, 2)
|
| 102 |
+
if family == "http_unique_clients":
|
| 103 |
+
return Case("Count distinct client IP addresses in these request logs.", '{if(!seen[$1]++)n++}END{print n+0}', apache(rng), family, 1)
|
| 104 |
+
if family == "http_path_bytes":
|
| 105 |
+
program = '{if(!($7 in sums))order[++n]=$7;sums[$7]+=$10}END{for(i=1;i<=n;i++)print order[i],sums[order[i]]}'
|
| 106 |
+
return Case("Sum response bytes per request path in first-appearance order.", program, apache(rng), family, 2)
|
| 107 |
+
if family == "http_error_rate":
|
| 108 |
+
return Case("Print the percentage of 5xx responses to one decimal place, including the percent sign.", '$9>=500{n++}END{printf "%.1f%%\\n",100*n/NR}', apache(rng), family, 2)
|
| 109 |
+
if family == "http_largest":
|
| 110 |
+
program = '{if(NR==1||$NF>largest){largest=$NF;record=$0}}END{print record}'
|
| 111 |
+
return Case("Print the complete response with the largest byte count; keep the earliest on ties.", program, apache(rng), family, 2)
|
| 112 |
+
if family == "http_path_counts":
|
| 113 |
+
program = '{if(!($7 in counts))order[++n]=$7;counts[$7]++}END{for(i=1;i<=n;i++)print order[i],counts[order[i]]}'
|
| 114 |
+
return Case("Count requests per URL path and print groups in order of first appearance.", program, apache(rng), family, 2)
|
| 115 |
+
|
| 116 |
+
if family == "header_average":
|
| 117 |
+
headers, inputs = sales_pair(rng)
|
| 118 |
+
expression = '{s+=$h["amount"];n++}END{printf "%.2f\\n",s/n}'
|
| 119 |
+
return Case("Use the amount header and print the mean amount over data rows to two decimals.", header_program(expression), inputs, family, 2)
|
| 120 |
+
if family == "header_sum_filter":
|
| 121 |
+
headers, inputs = sales_pair(rng)
|
| 122 |
+
expression = '$h["status"]=="paid"{s+=$h["amount"]}END{print s+0}'
|
| 123 |
+
return Case("Find columns by name and print the total amount for paid records only.", header_program(expression), inputs, family, 2)
|
| 124 |
+
if family == "header_group_average":
|
| 125 |
+
headers, inputs = sales_pair(rng)
|
| 126 |
+
expression = '{key=$h["region"];if(!(key in sums))order[++n]=key;sums[key]+=$h["amount"];counts[key]++}END{for(i=1;i<=n;i++)printf "%s %.2f\\n",order[i],sums[order[i]]/counts[order[i]]}'
|
| 127 |
+
return Case("Print each region and its average amount to two decimals in first-appearance order.", header_program(expression), inputs, family, 3)
|
| 128 |
+
if family == "header_group_units":
|
| 129 |
+
headers, inputs = sales_pair(rng)
|
| 130 |
+
expression = '{key=$h["region"];if(!(key in sums))order[++n]=key;sums[key]+=$h["units"]}END{for(i=1;i<=n;i++)print order[i],sums[order[i]]}'
|
| 131 |
+
return Case("Use the headers to total units by region, preserving first-appearance order.", header_program(expression), inputs, family, 2)
|
| 132 |
+
if family == "header_top_two":
|
| 133 |
+
headers, inputs = sales_pair(rng)
|
| 134 |
+
expression = '{n++;v[n]=$h["amount"]+0;line[n]=$0}END{for(i=2;i<=n;i++){x=v[i];s=line[i];j=i-1;while(j>=1&&v[j]<x){v[j+1]=v[j];line[j+1]=line[j];j--}v[j+1]=x;line[j+1]=s}for(i=1;i<=2&&i<=n;i++)print line[i]}'
|
| 135 |
+
return Case("Print the two complete data records with the highest amounts, descending and stable on ties.", header_program(expression), inputs, family, 3)
|
| 136 |
+
if family == "header_percentage":
|
| 137 |
+
headers, inputs = sales_pair(rng)
|
| 138 |
+
expression = '{n++;id[n]=$h["order_id"];v[n]=$h["amount"];total+=$h["amount"]}END{for(i=1;i<=n;i++)printf "%s %.2f%%\\n",id[i],100*v[i]/total}'
|
| 139 |
+
return Case("For each data row, print order_id and amount as a percentage of the grand total with two decimals.", header_program(expression), inputs, family, 3)
|
| 140 |
+
if family == "header_min_amount":
|
| 141 |
+
headers, inputs = sales_pair(rng)
|
| 142 |
+
expression = 'NR==2{min=$h["amount"]} $h["amount"]<min{min=$h["amount"]}END{print min}'
|
| 143 |
+
return Case("Read amount by header name and print its minimum over data rows.", header_program(expression), inputs, family, 2)
|
| 144 |
+
|
| 145 |
+
if family == "kv_service_errors":
|
| 146 |
+
program = '{service="";level="";for(i=1;i<=NF;i++){split($i,p,"=");if(p[1]=="service")service=p[2];if(p[1]=="level")level=tolower(p[2])}if(level=="error")print service}'
|
| 147 |
+
return Case("Extract service for records whose level is error, ignoring level letter case.", program, keyvalues(rng), family, 3)
|
| 148 |
+
if family == "kv_latency_threshold":
|
| 149 |
+
threshold = rng.randint(20, 50)
|
| 150 |
+
program = f'{{for(i=1;i<=NF;i++){{split($i,p,"=");if(p[1]=="latency"&&p[2]+0>{threshold})print $1}}}}'
|
| 151 |
+
return Case(f"Print timestamps for records with latency greater than {threshold}.", program, keyvalues(rng), family, 2)
|
| 152 |
+
if family == "kv_service_latency":
|
| 153 |
+
program = '{service="";latency=0;for(i=1;i<=NF;i++){split($i,p,"=");if(p[1]=="service")service=p[2];if(p[1]=="latency")latency=p[2]}if(!(service in sums))order[++n]=service;sums[service]+=latency}END{for(i=1;i<=n;i++)print order[i],sums[order[i]]}'
|
| 154 |
+
return Case("Total latency by service in first-appearance order, reading key=value fields.", program, keyvalues(rng), family, 3)
|
| 155 |
+
if family == "kv_level_counts":
|
| 156 |
+
program = '{level="";for(i=1;i<=NF;i++){split($i,p,"=");if(p[1]=="level")level=tolower(p[2])}if(!(level in counts))order[++n]=level;counts[level]++}END{for(i=1;i<=n;i++)print order[i],counts[order[i]]}'
|
| 157 |
+
return Case("Count records per level in first-appearance order, normalizing level names to lowercase.", program, keyvalues(rng), family, 3)
|
| 158 |
+
if family == "kv_service_average":
|
| 159 |
+
program = '{service="";latency=0;for(i=1;i<=NF;i++){split($i,p,"=");if(p[1]=="service")service=p[2];if(p[1]=="latency")latency=p[2]}if(!(service in sums))order[++n]=service;sums[service]+=latency;counts[service]++}END{for(i=1;i<=n;i++)printf "%s %.1f\\n",order[i],sums[order[i]]/counts[order[i]]}'
|
| 160 |
+
return Case("Print average latency per service to one decimal in first-appearance order.", program, keyvalues(rng), family, 3)
|
| 161 |
+
|
| 162 |
+
if family == "passwd_shell":
|
| 163 |
+
shell = rng.choice(["/bin/bash", "/bin/zsh", "/bin/sh"])
|
| 164 |
+
return Case(f"In this colon-delimited account data, print usernames using {shell}.", f'BEGIN{{FS=":"}}$7=="{shell}"{{print $1}}', passwd(rng), family, 1)
|
| 165 |
+
if family == "passwd_uid":
|
| 166 |
+
return Case("Using colon separators, print username and UID for UID values from 1000 through 1002 inclusive.", 'BEGIN{FS=":";OFS=":"}$3>=1000&&$3<=1002{print $1,$3}', passwd(rng), family, 2)
|
| 167 |
+
if family == "passwd_shell_counts":
|
| 168 |
+
program = 'BEGIN{FS=":"}{if(!($7 in counts))order[++n]=$7;counts[$7]++}END{for(i=1;i<=n;i++)print order[i],counts[order[i]]}'
|
| 169 |
+
return Case("Count accounts per login shell in first-appearance order for colon-delimited records.", program, passwd(rng), family, 2)
|
| 170 |
+
if family == "passwd_no_login":
|
| 171 |
+
return Case("Print account names that cannot log in because their shell ends in nologin.", 'BEGIN{FS=":"}$7 ~ /nologin$/{print $1}', passwd(rng), family, 1)
|
| 172 |
+
|
| 173 |
+
if family == "running_delta":
|
| 174 |
+
program = '{change=$2-previous;if(NR==1)change=0;print $1,change;previous=$2}'
|
| 175 |
+
return Case("For each record, print column 1 and the change in column 2 from the previous row, starting with 0.", program, pair(rng, ["category", "smallint", "word"]), family, 2)
|
| 176 |
+
if family == "clamp_values":
|
| 177 |
+
return Case("Clamp column 2 to the inclusive interval 8 through 18 while preserving every other field.", '{if($2<8)$2=8;else if($2>18)$2=18;print}', pair(rng, ["category", "smallint", "word"]), family, 2)
|
| 178 |
+
if family == "group_maximum":
|
| 179 |
+
program = '{if(!($1 in seen)){order[++n]=$1;seen[$1]=1;max[$1]=$2}if($2>max[$1])max[$1]=$2}END{for(i=1;i<=n;i++)print order[i],max[order[i]]}'
|
| 180 |
+
return Case("Print each column-1 group with its maximum column-2 value in first-appearance order.", program, pair(rng, ["category", "smallint", "word"]), family, 2)
|
| 181 |
+
if family == "first_last_group":
|
| 182 |
+
program = '{if(!($1 in first)){first[$1]=$2;order[++n]=$1}last[$1]=$2}END{for(i=1;i<=n;i++)print order[i],first[order[i]],last[order[i]]}'
|
| 183 |
+
return Case("For each column-1 group, print its first and last column-2 values in first-appearance order.", program, pair(rng, ["category", "smallint", "word"]), family, 2)
|
| 184 |
+
if family == "consecutive_dedup":
|
| 185 |
+
return Case("Suppress consecutive rows with the same column-1 group, printing one complete row per run.", '$1!=previous{print}{previous=$1}', pair(rng, ["category", "smallint", "word"]), family, 2)
|
| 186 |
+
if family == "absolute_difference":
|
| 187 |
+
return Case("Print column 1 and the absolute difference between columns 2 and 3 for every record.", '{d=$2-$3;if(d<0)d=-d;print $1,d}', pair(rng, ["category", "smallint", "smallint"]), family, 1)
|
| 188 |
+
if family == "positive_ratio":
|
| 189 |
+
return Case("Print column 1 and column 3 divided by column 2 as a percentage with one decimal; skip zero denominators.", '$2!=0{printf "%s %.1f%%\\n",$1,100*$3/$2}', pair(rng, ["category", "smallint", "smallint"]), family, 2)
|
| 190 |
+
if family == "sorted_unique":
|
| 191 |
+
program = '{seen[$1]=1}END{for(word in seen){value[++n]=word}for(i=2;i<=n;i++){x=value[i];j=i-1;while(j>=1&&value[j]>x){value[j+1]=value[j];j--}value[j+1]=x}for(i=1;i<=n;i++)print value[i]}'
|
| 192 |
+
return Case("Print distinct column-1 values once each in ascending lexical order.", program, pair(rng, ["category", "smallint", "word"]), family, 3)
|
| 193 |
+
if family == "blank_filter":
|
| 194 |
+
inputs = pair(rng, ["word", "int"])
|
| 195 |
+
inputs = [text.replace("\n", "\n\n", 2) + " \n" for text in inputs]
|
| 196 |
+
return Case("Remove blank and whitespace-only lines without changing other records.", '$0 ~ /[^[:space:]]/', inputs, family, 1)
|
| 197 |
+
if family == "blank_count":
|
| 198 |
+
inputs = pair(rng, ["word", "int"])
|
| 199 |
+
inputs = [text.replace("\n", "\n\n", 2) + " \n" for text in inputs]
|
| 200 |
+
return Case("Count blank or whitespace-only input lines.", '$0 !~ /[^[:space:]]/{n++}END{print n+0}', inputs, family, 1)
|
| 201 |
+
if family == "line_numbers":
|
| 202 |
+
inputs = pair(rng, ["word", "int"])
|
| 203 |
+
inputs = [text.replace("\n", "\n\n", 1) for text in inputs]
|
| 204 |
+
return Case("Prefix every non-empty line with its original line number, a colon, and a space.", '$0 ~ /[^[:space:]]/{print NR ": " $0}', inputs, family, 1)
|
| 205 |
+
if family == "character_count":
|
| 206 |
+
return Case("Print the total number of characters in the input, excluding newlines.", '{n+=length($0)}END{print n+0}', pair(rng, ["word", "int", "status"]), family, 1)
|
| 207 |
+
if family == "comma_to_tab":
|
| 208 |
+
return Case("Convert simple comma-separated input to tab-separated output without reordering fields.", 'BEGIN{FS=",";OFS="\\t"}{$1=$1;print}', pair(rng, ["name", "int", "word"], ","), family, 1)
|
| 209 |
+
if family == "fixed_width":
|
| 210 |
+
return Case("Right-align column 1 in a width of 8 and append column 2 immediately after the padding.", '{printf "%8s%s\\n",$1,$2}', pair(rng, ["category", "smallint", "word"]), family, 2)
|
| 211 |
+
raise ValueError(family)
|
| 212 |
+
|
| 213 |
+
|
| 214 |
+
FAMILIES = [
|
| 215 |
+
"http_status_class", "http_bytes_total", "http_method", "http_path", "http_success_average",
|
| 216 |
+
"http_unique_clients", "http_path_bytes", "http_error_rate", "http_largest", "http_path_counts",
|
| 217 |
+
"header_average", "header_sum_filter", "header_group_average", "header_group_units",
|
| 218 |
+
"header_top_two", "header_percentage", "header_min_amount", "kv_service_errors",
|
| 219 |
+
"kv_latency_threshold", "kv_service_latency", "kv_level_counts", "kv_service_average",
|
| 220 |
+
"passwd_shell", "passwd_uid", "passwd_shell_counts", "passwd_no_login", "running_delta",
|
| 221 |
+
"clamp_values", "group_maximum", "first_last_group", "consecutive_dedup", "absolute_difference",
|
| 222 |
+
"positive_ratio", "sorted_unique", "blank_filter", "blank_count", "line_numbers",
|
| 223 |
+
"character_count", "comma_to_tab", "fixed_width",
|
| 224 |
+
]
|
| 225 |
+
|
| 226 |
+
|
| 227 |
+
def generate_row(index: int, seed: int) -> dict:
|
| 228 |
+
family = FAMILIES[index % len(FAMILIES)]
|
| 229 |
+
for attempt in range(100):
|
| 230 |
+
case = make_case(family, seed + index * 1009 + attempt * 1_000_003)
|
| 231 |
+
try:
|
| 232 |
+
outputs = [run_awk(case.program, text) for text in case.inputs]
|
| 233 |
+
except ValueError:
|
| 234 |
+
continue
|
| 235 |
+
if not outputs[0].strip():
|
| 236 |
+
continue
|
| 237 |
+
return {
|
| 238 |
+
"id": f"awkweave-real-{index:07d}", "request": case.request, "program": case.program,
|
| 239 |
+
"input_text": case.inputs[0], "expected_output": outputs[0],
|
| 240 |
+
"validation_input": case.inputs[1], "validation_output": outputs[1],
|
| 241 |
+
"family": case.family, "difficulty": case.difficulty, "split": "train",
|
| 242 |
+
"source": "realistic-grammar", "license": "CC-BY-4.0",
|
| 243 |
+
}
|
| 244 |
+
raise RuntimeError(f"Could not generate {family} at {index}")
|
| 245 |
+
|
| 246 |
+
|
| 247 |
+
def main() -> None:
|
| 248 |
+
parser = argparse.ArgumentParser()
|
| 249 |
+
parser.add_argument("--count", type=int, default=40_000)
|
| 250 |
+
parser.add_argument("--seed", type=int, default=20261129)
|
| 251 |
+
parser.add_argument("--workers", type=int, default=8)
|
| 252 |
+
parser.add_argument("--output", type=Path, default=Path("awkweave-realistic.jsonl"))
|
| 253 |
+
args = parser.parse_args()
|
| 254 |
+
with args.output.open("w", encoding="utf-8") as handle:
|
| 255 |
+
with concurrent.futures.ProcessPoolExecutor(max_workers=args.workers) as executor:
|
| 256 |
+
futures = {executor.submit(generate_row, index, args.seed): index for index in range(args.count)}
|
| 257 |
+
completed = 0
|
| 258 |
+
for future in concurrent.futures.as_completed(futures):
|
| 259 |
+
row = future.result()
|
| 260 |
+
handle.write(json.dumps(row, ensure_ascii=False, separators=(",", ":")) + "\n")
|
| 261 |
+
completed += 1
|
| 262 |
+
if completed % 1000 == 0:
|
| 263 |
+
handle.flush()
|
| 264 |
+
print(f"generated {completed}/{args.count}", flush=True)
|
| 265 |
+
print(f"wrote {args.count} rows to {args.output}")
|
| 266 |
+
|
| 267 |
+
|
| 268 |
+
if __name__ == "__main__":
|
| 269 |
+
main()
|
frozen_eval_data.py
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import json
|
| 4 |
+
from pathlib import Path
|
| 5 |
+
|
| 6 |
+
from awkweave.execution import run_awk
|
| 7 |
+
|
| 8 |
+
FLOWS_1 = """2026-12-01T10:00:00Z|10.0.0.1|10.0.0.2|TCP|12|1400
|
| 9 |
+
2026-12-01T10:00:01Z|10.0.0.3|10.0.0.2|UDP|4|240
|
| 10 |
+
2026-12-01T10:00:02Z|10.0.0.1|10.0.0.4|TCP|8|900
|
| 11 |
+
2026-12-01T10:00:03Z|10.0.0.2|10.0.0.5|ICMP|1|64
|
| 12 |
+
2026-12-01T10:00:04Z|10.0.0.3|10.0.0.1|UDP|7|630
|
| 13 |
+
"""
|
| 14 |
+
FLOWS_2 = """2026-12-01T11:00:00Z|10.1.0.1|10.1.0.2|TCP|5|500
|
| 15 |
+
2026-12-01T11:00:01Z|10.1.0.4|10.1.0.1|TCP|9|1100
|
| 16 |
+
2026-12-01T11:00:02Z|10.1.0.2|10.1.0.4|UDP|3|180
|
| 17 |
+
2026-12-01T11:00:03Z|10.1.0.4|10.1.0.5|TCP|2|250
|
| 18 |
+
"""
|
| 19 |
+
INVENTORY_1 = """sku,category,price,stock
|
| 20 |
+
A1,book,12.50,3
|
| 21 |
+
B2,tool,20.00,0
|
| 22 |
+
C3,book,7.50,8
|
| 23 |
+
D4,tool,15.00,2
|
| 24 |
+
E5,game,30.00,1
|
| 25 |
+
"""
|
| 26 |
+
INVENTORY_2 = """sku,category,price,stock
|
| 27 |
+
F6,game,10.00,4
|
| 28 |
+
G7,book,5.00,0
|
| 29 |
+
H8,tool,25.00,3
|
| 30 |
+
I9,game,8.00,2
|
| 31 |
+
"""
|
| 32 |
+
SYSLOG_1 = """Dec 01 10:00:00 web01 sshd[101]: Failed password for invalid user admin
|
| 33 |
+
Dec 01 10:00:01 db01 cron[102]: (root) CMD (backup)
|
| 34 |
+
Dec 01 10:00:02 web01 sshd[103]: Accepted publickey for alice
|
| 35 |
+
Dec 01 10:00:03 cache01 redis[104]: Error allocating buffer
|
| 36 |
+
Dec 01 10:00:04 db01 cron[105]: (root) CMD (cleanup)
|
| 37 |
+
"""
|
| 38 |
+
SYSLOG_2 = """Dec 02 11:00:00 api01 sshd[201]: Accepted password for bruno
|
| 39 |
+
Dec 02 11:00:01 api01 sshd[202]: Failed password for root
|
| 40 |
+
Dec 02 11:00:02 job01 cron[203]: (daemon) CMD (index)
|
| 41 |
+
Dec 02 11:00:03 api01 nginx[204]: Error connecting upstream
|
| 42 |
+
"""
|
| 43 |
+
GROUPS_1 = """wheel:x:10:alice,bruno
|
| 44 |
+
developers:x:1000:alice,chen,dina
|
| 45 |
+
audio:x:29:
|
| 46 |
+
users:x:100:bruno,eli
|
| 47 |
+
"""
|
| 48 |
+
GROUPS_2 = """admins:x:4:farah
|
| 49 |
+
developers:x:1000:farah,gus
|
| 50 |
+
video:x:44:gus,hana,ivan
|
| 51 |
+
"""
|
| 52 |
+
SENSORS_1 = """s1 temperature 20.5 C
|
| 53 |
+
s2 humidity 45.0 percent
|
| 54 |
+
s1 temperature 22.0 C
|
| 55 |
+
s3 pressure 101.2 kPa
|
| 56 |
+
s2 humidity 47.5 percent
|
| 57 |
+
"""
|
| 58 |
+
SENSORS_2 = """s4 temperature 18.0 C
|
| 59 |
+
s4 temperature 19.5 C
|
| 60 |
+
s5 humidity 52.0 percent
|
| 61 |
+
s6 pressure 100.8 kPa
|
| 62 |
+
"""
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
def main() -> None:
|
| 66 |
+
cases = []
|
| 67 |
+
|
| 68 |
+
def add(family, request, program, input_text, validation_input, difficulty=3):
|
| 69 |
+
expected = run_awk(program, input_text)
|
| 70 |
+
validation_expected = run_awk(program, validation_input)
|
| 71 |
+
if not expected.strip():
|
| 72 |
+
raise ValueError(family)
|
| 73 |
+
cases.append({
|
| 74 |
+
"id": f"awkweave-frozen-{len(cases) + 1:04d}", "request": request, "program": program,
|
| 75 |
+
"input_text": input_text, "expected_output": expected,
|
| 76 |
+
"validation_input": validation_input, "validation_output": validation_expected,
|
| 77 |
+
"family": family, "difficulty": difficulty, "split": "frozen_test",
|
| 78 |
+
"source": "original-frozen-hand-authored", "license": "CC-BY-4.0",
|
| 79 |
+
})
|
| 80 |
+
|
| 81 |
+
add("flow_tcp_count", "Using pipe delimiters, count TCP flows and print 0 when none exist.", 'BEGIN{FS="|"}$4=="TCP"{n++}END{print n+0}', FLOWS_1, FLOWS_2)
|
| 82 |
+
add("flow_bytes_total", "Sum bytes in field 6 of these pipe-delimited flows.", 'BEGIN{FS="|"}{s+=$6}END{print s+0}', FLOWS_1, FLOWS_2)
|
| 83 |
+
add("flow_protocol_bytes", "For pipe-delimited flows, total bytes per protocol in first-appearance order.", 'BEGIN{FS="|"}{if(!($4 in sums))order[++n]=$4;sums[$4]+=$6}END{for(i=1;i<=n;i++)print order[i],sums[order[i]]}', FLOWS_1, FLOWS_2)
|
| 84 |
+
add("flow_udp_average", "For UDP flows, print average packets to two decimals. Fields are pipe-delimited.", 'BEGIN{FS="|"}$4=="UDP"{s+=$5;n++}END{printf "%.2f\\n",s/n}', FLOWS_1, FLOWS_2)
|
| 85 |
+
add("flow_destination_count", "Count distinct destination IPs in field 3 of this pipe-delimited data.", 'BEGIN{FS="|"}{if(!seen[$3]++)n++}END{print n+0}', FLOWS_1, FLOWS_2)
|
| 86 |
+
add("flow_top_sources", "Print the two complete flows with the most bytes, highest first and stable on ties.", 'BEGIN{FS="|"}{v[NR]=$6+0;line[NR]=$0}END{for(i=2;i<=NR;i++){x=v[i];s=line[i];j=i-1;while(j>=1&&v[j]<x){v[j+1]=v[j];line[j+1]=line[j];j--}v[j+1]=x;line[j+1]=s}for(i=1;i<=2&&i<=NR;i++)print line[i]}', FLOWS_1, FLOWS_2)
|
| 87 |
+
|
| 88 |
+
add("inventory_low_stock", "The CSV has a header. Print sku for products with stock below 5; fields contain no quoted commas.", 'BEGIN{FS=OFS=","}NR==1{for(i=1;i<=NF;i++)h[$i]=i;next}$h["stock"]<5{print $h["sku"]}', INVENTORY_1, INVENTORY_2)
|
| 89 |
+
add("inventory_units", "Read stock by its CSV header and print total units in inventory.", 'BEGIN{FS=OFS=","}NR==1{for(i=1;i<=NF;i++)h[$i]=i;next}{s+=$h["stock"]}END{print s+0}', INVENTORY_1, INVENTORY_2)
|
| 90 |
+
add("inventory_average_price", "Using the CSV header, print the mean price over products to two decimals.", 'BEGIN{FS=OFS=","}NR==1{for(i=1;i<=NF;i++)h[$i]=i;next}{s+=$h["price"];n++}END{printf "%.2f\\n",s/n}', INVENTORY_1, INVENTORY_2)
|
| 91 |
+
add("inventory_out_of_stock", "Count products whose stock field is zero in this simple CSV with a header.", 'BEGIN{FS=OFS=","}NR==1{for(i=1;i<=NF;i++)h[$i]=i;next}$h["stock"]==0{n++}END{print n+0}', INVENTORY_1, INVENTORY_2)
|
| 92 |
+
add("inventory_category_value", "Print each category and its total inventory value (price times stock) to two decimals, in first-appearance order.", 'BEGIN{FS=OFS=","}NR==1{for(i=1;i<=NF;i++)h[$i]=i;next}{key=$h["category"];if(!(key in sums))order[++n]=key;sums[key]+=$h["price"]*$h["stock"]}END{for(i=1;i<=n;i++)printf "%s %.2f\\n",order[i],sums[order[i]]}', INVENTORY_1, INVENTORY_2)
|
| 93 |
+
add("inventory_highest_price", "Skip the CSV header and print the complete product with the highest price, keeping the earliest on ties.", 'BEGIN{FS=OFS=","}NR==1{for(i=1;i<=NF;i++)h[$i]=i;next}NR==2{best=$h["price"];record=$0}$h["price"]>best{best=$h["price"];record=$0}END{print record}', INVENTORY_1, INVENTORY_2)
|
| 94 |
+
|
| 95 |
+
add("syslog_failed_count", "Count syslog lines containing the exact word Failed.", '$0 ~ /Failed/{n++}END{print n+0}', SYSLOG_1, SYSLOG_2)
|
| 96 |
+
add("syslog_sshd_hosts", "Print hostnames (field 4) for records whose process field begins with sshd.", '$5 ~ /^sshd/{print $4}', SYSLOG_1, SYSLOG_2)
|
| 97 |
+
add("syslog_error_casefold", "Print complete syslog records containing error in any letter case.", 'tolower($0) ~ /error/', SYSLOG_1, SYSLOG_2)
|
| 98 |
+
add("syslog_process_counts", "Extract the process name before [ in field 5 and count records per process in first-appearance order.", '{split($5,p,"[");if(!(p[1] in counts))order[++n]=p[1];counts[p[1]]++}END{for(i=1;i<=n;i++)print order[i],counts[order[i]]}', SYSLOG_1, SYSLOG_2)
|
| 99 |
+
add("syslog_cron_timestamp", "For cron records, print month, day, and time (the first three fields).", '$5 ~ /^cron/{print $1,$2,$3}', SYSLOG_1, SYSLOG_2)
|
| 100 |
+
add("syslog_unique_hosts", "Count distinct hostnames in field 4 of the syslog input.", '{if(!seen[$4]++)n++}END{print n+0}', SYSLOG_1, SYSLOG_2)
|
| 101 |
+
|
| 102 |
+
add("group_membership", "In colon-delimited group data, print group names containing alice as a comma-separated member of field 4.", 'BEGIN{FS=":"}{split($4,members,",");for(i in members)if(members[i]=="alice")print $1}', GROUPS_1, GROUPS_2)
|
| 103 |
+
add("group_member_counts", "For each colon-delimited group, print its name and number of members; an empty fourth field means zero.", 'BEGIN{FS=":"}{n=split($4,members,",");if($4=="")n=0;print $1,n}', GROUPS_1, GROUPS_2)
|
| 104 |
+
add("group_gid_filter", "Print names of colon-delimited groups with numeric GID at least 1000.", 'BEGIN{FS=":"}$3>=1000{print $1}', GROUPS_1, GROUPS_2)
|
| 105 |
+
|
| 106 |
+
add("sensor_device_average", "For each device in column 1, print its average reading from column 3 to two decimals in first-appearance order.", '{if(!($1 in sums))order[++n]=$1;sums[$1]+=$3;counts[$1]++}END{for(i=1;i<=n;i++)printf "%s %.2f\\n",order[i],sums[order[i]]/counts[order[i]]}', SENSORS_1, SENSORS_2)
|
| 107 |
+
add("sensor_threshold", "Print complete readings with value in column 3 greater than 45.", '$3>45', SENSORS_1, SENSORS_2)
|
| 108 |
+
add("sensor_metric_max", "For each metric in column 2, print its maximum value from column 3 in first-appearance order.", '{if(!($2 in seen)){order[++n]=$2;seen[$2]=1;max[$2]=$3}if($3>max[$2])max[$2]=$3}END{for(i=1;i<=n;i++)print order[i],max[order[i]]}', SENSORS_1, SENSORS_2)
|
| 109 |
+
add("sensor_device_count", "Count distinct device identifiers in column 1.", '{if(!seen[$1]++)n++}END{print n+0}', SENSORS_1, SENSORS_2)
|
| 110 |
+
add("sensor_unit_filter", "Print device and value for readings whose unit in column 4 is C.", '$4=="C"{print $1,$3}', SENSORS_1, SENSORS_2)
|
| 111 |
+
|
| 112 |
+
add("tsv_to_csv", "Convert tab-separated rows to comma-separated rows while preserving all fields.", 'BEGIN{FS="\\t";OFS=","}{$1=$1;print}', "a\t1\tx\nb\t2\ty\n", "c\t3\tz\nd\t4\tw\n")
|
| 113 |
+
add("running_average", "For each record, print column 1 and the running mean of column 3 to two decimals.", '{s+=$3;n++;printf "%s %.2f\\n",$1,s/n}', SENSORS_1, SENSORS_2)
|
| 114 |
+
add("median_value", "Print the median of column 3; for an even number of records use the lower middle value.", '{v[NR]=$3+0}END{for(i=2;i<=NR;i++){x=v[i];j=i-1;while(j>=1&&v[j]>x){v[j+1]=v[j];j--}v[j+1]=x}print v[int((NR+1)/2)]}', SENSORS_1, SENSORS_2)
|
| 115 |
+
add("comment_filter", "Remove blank lines and lines whose first non-whitespace character is #.", '$0 ~ /[^[:space:]]/ && $0 !~ /^[[:space:]]*#/', "# comment\na 1\n\n # another\nb 2\n", "c 3\n# note\n\nd 4\n")
|
| 116 |
+
add("comment_count", "Count lines whose first non-whitespace character is #, excluding blank lines.", '$0 ~ /^[[:space:]]*#/{n++}END{print n+0}', "# comment\na 1\n\n # another\nb 2\n", "c 3\n# note\n\nd 4\n")
|
| 117 |
+
add("trim_lines", "Trim leading and trailing whitespace from each line without altering internal spacing.", '{gsub(/^[[:space:]]+|[[:space:]]+$/,"",$0);print}', " a 1 \n\tb 2\t\n", " c 3 \n d 4 \n")
|
| 118 |
+
add("iso_date_parts", "For ISO timestamps in field 1, print year, month, and day separated by hyphens.", 'BEGIN{OFS="-"}{split($1,date,"-");split(date[3],parts,"T");print date[1],date[2],parts[1]}', FLOWS_1, FLOWS_2)
|
| 119 |
+
add("sort_numeric_ascending", "Print complete records sorted by column 3 ascending, preserving input order on ties.", '{v[NR]=$3+0;line[NR]=$0}END{for(i=2;i<=NR;i++){x=v[i];s=line[i];j=i-1;while(j>=1&&v[j]>x){v[j+1]=v[j];line[j+1]=line[j];j--}v[j+1]=x;line[j+1]=s}for(i=1;i<=NR;i++)print line[i]}', SENSORS_1, SENSORS_2)
|
| 120 |
+
add("sum_if_metric", "Sum column 3 only for temperature records, printing 0 when no such records exist.", '$2=="temperature"{s+=$3}END{print s+0}', SENSORS_1, SENSORS_2)
|
| 121 |
+
add("first_record_per_device", "Print only the first complete record for each device in column 1.", '!seen[$1]++', SENSORS_1, SENSORS_2)
|
| 122 |
+
add("count_units", "Count records per unit in column 4 in first-appearance order.", '{if(!($4 in counts))order[++n]=$4;counts[$4]++}END{for(i=1;i<=n;i++)print order[i],counts[order[i]]}', SENSORS_1, SENSORS_2)
|
| 123 |
+
|
| 124 |
+
output = Path("frozen-eval.jsonl")
|
| 125 |
+
with output.open("w", encoding="utf-8") as handle:
|
| 126 |
+
for case in cases:
|
| 127 |
+
handle.write(json.dumps(case, ensure_ascii=False, separators=(",", ":")) + "\n")
|
| 128 |
+
print(f"wrote {len(cases)} frozen cases to {output}")
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
if __name__ == "__main__":
|
| 132 |
+
main()
|
prepare_v2_data.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import argparse
|
| 4 |
+
import json
|
| 5 |
+
import random
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def main() -> None:
|
| 10 |
+
parser = argparse.ArgumentParser()
|
| 11 |
+
parser.add_argument("--original", type=Path, default=Path("awkweave-release.jsonl"))
|
| 12 |
+
parser.add_argument("--realistic", type=Path, default=Path("awkweave-realistic.jsonl"))
|
| 13 |
+
parser.add_argument("--frozen", type=Path, default=Path("frozen-eval.jsonl"))
|
| 14 |
+
parser.add_argument("--replay", type=int, default=20_000)
|
| 15 |
+
parser.add_argument("--training-output", type=Path, default=Path("awkweave-v2-training.jsonl"))
|
| 16 |
+
parser.add_argument("--release-output", type=Path, default=Path("awkweave-realistic-release.jsonl"))
|
| 17 |
+
parser.add_argument("--seed", type=int, default=42)
|
| 18 |
+
args = parser.parse_args()
|
| 19 |
+
|
| 20 |
+
original = [json.loads(line) for line in args.original.open(encoding="utf-8")]
|
| 21 |
+
train = [row for row in original if row["split"] == "train"]
|
| 22 |
+
random.Random(args.seed).shuffle(train)
|
| 23 |
+
replay = train[: args.replay]
|
| 24 |
+
realistic = [json.loads(line) for line in args.realistic.open(encoding="utf-8")]
|
| 25 |
+
frozen = [json.loads(line) for line in args.frozen.open(encoding="utf-8")]
|
| 26 |
+
if any(row["split"] != "train" for row in realistic):
|
| 27 |
+
raise ValueError("Realistic input contains a non-train row")
|
| 28 |
+
if any(row["split"] != "frozen_test" for row in frozen):
|
| 29 |
+
raise ValueError("Unexpected frozen split")
|
| 30 |
+
|
| 31 |
+
combined = realistic + replay
|
| 32 |
+
ids = [row["id"] for row in combined + frozen]
|
| 33 |
+
if len(ids) != len(set(ids)):
|
| 34 |
+
raise ValueError("Duplicate IDs")
|
| 35 |
+
random.Random(args.seed + 1).shuffle(combined)
|
| 36 |
+
with args.training_output.open("w", encoding="utf-8") as handle:
|
| 37 |
+
for row in combined:
|
| 38 |
+
handle.write(json.dumps(row, ensure_ascii=False, separators=(",", ":")) + "\n")
|
| 39 |
+
with args.release_output.open("w", encoding="utf-8") as handle:
|
| 40 |
+
for row in realistic + frozen:
|
| 41 |
+
handle.write(json.dumps(row, ensure_ascii=False, separators=(",", ":")) + "\n")
|
| 42 |
+
print(f"Wrote {len(combined)} stage-two training rows and {len(realistic) + len(frozen)} realistic release rows")
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
if __name__ == "__main__":
|
| 46 |
+
main()
|
validation.json
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"data": "awkweave-realistic-release.jsonl",
|
| 3 |
+
"sha256": "a7631ad7c88cb670ead84b8ef5635846e2db1be2cd96495144a9ff5ebb8be656",
|
| 4 |
+
"rows": 40037,
|
| 5 |
+
"executions": 80074,
|
| 6 |
+
"awk_version": "mawk 1.3.4 20200120",
|
| 7 |
+
"errors": [],
|
| 8 |
+
"splits": {
|
| 9 |
+
"train": 40000,
|
| 10 |
+
"frozen_test": 37
|
| 11 |
+
},
|
| 12 |
+
"sources": {
|
| 13 |
+
"realistic-grammar": 40000,
|
| 14 |
+
"original-frozen-hand-authored": 37
|
| 15 |
+
},
|
| 16 |
+
"families": {
|
| 17 |
+
"header_sum_filter": 1000,
|
| 18 |
+
"first_last_group": 1000,
|
| 19 |
+
"line_numbers": 1000,
|
| 20 |
+
"header_average": 1000,
|
| 21 |
+
"http_unique_clients": 1000,
|
| 22 |
+
"http_status_class": 1000,
|
| 23 |
+
"group_maximum": 1000,
|
| 24 |
+
"blank_count": 1000,
|
| 25 |
+
"http_path_counts": 1000,
|
| 26 |
+
"http_success_average": 1000,
|
| 27 |
+
"fixed_width": 1000,
|
| 28 |
+
"absolute_difference": 1000,
|
| 29 |
+
"blank_filter": 1000,
|
| 30 |
+
"http_largest": 1000,
|
| 31 |
+
"http_path": 1000,
|
| 32 |
+
"comma_to_tab": 1000,
|
| 33 |
+
"passwd_no_login": 1000,
|
| 34 |
+
"sorted_unique": 1000,
|
| 35 |
+
"http_error_rate": 1000,
|
| 36 |
+
"http_method": 1000,
|
| 37 |
+
"character_count": 1000,
|
| 38 |
+
"running_delta": 1000,
|
| 39 |
+
"positive_ratio": 1000,
|
| 40 |
+
"http_path_bytes": 1000,
|
| 41 |
+
"http_bytes_total": 1000,
|
| 42 |
+
"clamp_values": 1000,
|
| 43 |
+
"consecutive_dedup": 1000,
|
| 44 |
+
"passwd_shell_counts": 1000,
|
| 45 |
+
"passwd_uid": 1000,
|
| 46 |
+
"passwd_shell": 1000,
|
| 47 |
+
"kv_service_average": 1000,
|
| 48 |
+
"kv_level_counts": 1000,
|
| 49 |
+
"kv_service_latency": 1000,
|
| 50 |
+
"kv_latency_threshold": 1000,
|
| 51 |
+
"kv_service_errors": 1000,
|
| 52 |
+
"header_min_amount": 1000,
|
| 53 |
+
"header_percentage": 1000,
|
| 54 |
+
"header_top_two": 1000,
|
| 55 |
+
"header_group_units": 1000,
|
| 56 |
+
"header_group_average": 1000,
|
| 57 |
+
"flow_tcp_count": 1,
|
| 58 |
+
"flow_bytes_total": 1,
|
| 59 |
+
"flow_protocol_bytes": 1,
|
| 60 |
+
"flow_udp_average": 1,
|
| 61 |
+
"flow_destination_count": 1,
|
| 62 |
+
"flow_top_sources": 1,
|
| 63 |
+
"inventory_low_stock": 1,
|
| 64 |
+
"inventory_units": 1,
|
| 65 |
+
"inventory_average_price": 1,
|
| 66 |
+
"inventory_out_of_stock": 1,
|
| 67 |
+
"inventory_category_value": 1,
|
| 68 |
+
"inventory_highest_price": 1,
|
| 69 |
+
"syslog_failed_count": 1,
|
| 70 |
+
"syslog_sshd_hosts": 1,
|
| 71 |
+
"syslog_error_casefold": 1,
|
| 72 |
+
"syslog_process_counts": 1,
|
| 73 |
+
"syslog_cron_timestamp": 1,
|
| 74 |
+
"syslog_unique_hosts": 1,
|
| 75 |
+
"group_membership": 1,
|
| 76 |
+
"group_member_counts": 1,
|
| 77 |
+
"group_gid_filter": 1,
|
| 78 |
+
"sensor_device_average": 1,
|
| 79 |
+
"sensor_threshold": 1,
|
| 80 |
+
"sensor_metric_max": 1,
|
| 81 |
+
"sensor_device_count": 1,
|
| 82 |
+
"sensor_unit_filter": 1,
|
| 83 |
+
"tsv_to_csv": 1,
|
| 84 |
+
"running_average": 1,
|
| 85 |
+
"median_value": 1,
|
| 86 |
+
"comment_filter": 1,
|
| 87 |
+
"comment_count": 1,
|
| 88 |
+
"trim_lines": 1,
|
| 89 |
+
"iso_date_parts": 1,
|
| 90 |
+
"sort_numeric_ascending": 1,
|
| 91 |
+
"sum_if_metric": 1,
|
| 92 |
+
"first_record_per_device": 1,
|
| 93 |
+
"count_units": 1
|
| 94 |
+
},
|
| 95 |
+
"unique_requests": 115,
|
| 96 |
+
"unique_programs": 114,
|
| 97 |
+
"split_integrity": {
|
| 98 |
+
"train-validation": {
|
| 99 |
+
"input_overlap": 0,
|
| 100 |
+
"request_program_overlap": 0
|
| 101 |
+
},
|
| 102 |
+
"train-test": {
|
| 103 |
+
"input_overlap": 0,
|
| 104 |
+
"request_program_overlap": 0
|
| 105 |
+
},
|
| 106 |
+
"validation-test": {
|
| 107 |
+
"input_overlap": 0,
|
| 108 |
+
"request_program_overlap": 0
|
| 109 |
+
},
|
| 110 |
+
"train-challenge": {
|
| 111 |
+
"input_overlap": 0,
|
| 112 |
+
"request_program_overlap": 0
|
| 113 |
+
},
|
| 114 |
+
"validation-challenge": {
|
| 115 |
+
"input_overlap": 0,
|
| 116 |
+
"request_program_overlap": 0
|
| 117 |
+
},
|
| 118 |
+
"test-challenge": {
|
| 119 |
+
"input_overlap": 0,
|
| 120 |
+
"request_program_overlap": 0
|
| 121 |
+
}
|
| 122 |
+
}
|
| 123 |
+
}
|