@piagent/platform 1.2.11 → 1.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +15 -7
  3. package/benchmarks/production-v1/grade.mjs +220 -0
  4. package/benchmarks/production-v1/project/README.md +7 -0
  5. package/benchmarks/production-v1/project/config/service.json +4 -0
  6. package/benchmarks/production-v1/project/data/audit-ledger.jsonl +1 -0
  7. package/benchmarks/production-v1/project/docs/ops.md +3 -0
  8. package/benchmarks/production-v1/project/logs/incident.log +2 -0
  9. package/benchmarks/production-v1/project/package.json +11 -0
  10. package/benchmarks/production-v1/project/scripts/check.mjs +21 -0
  11. package/benchmarks/production-v1/project/src/backend/auth.js +3 -0
  12. package/benchmarks/production-v1/project/src/backend/cache.js +15 -0
  13. package/benchmarks/production-v1/project/src/backend/invoice.js +4 -0
  14. package/benchmarks/production-v1/project/src/data/csv.js +3 -0
  15. package/benchmarks/production-v1/project/src/data/dedup.js +5 -0
  16. package/benchmarks/production-v1/project/src/data/migration.js +9 -0
  17. package/benchmarks/production-v1/project/src/frontend/pagination.js +8 -0
  18. package/benchmarks/production-v1/project/src/frontend/search-state.js +8 -0
  19. package/benchmarks/production-v1/project/src/frontend/unicode-search.js +7 -0
  20. package/benchmarks/production-v1/project/src/platform/args.js +10 -0
  21. package/benchmarks/production-v1/project/src/platform/config.js +7 -0
  22. package/benchmarks/production-v1/project/src/platform/workspace.js +13 -0
  23. package/benchmarks/production-v1/project/src/reliability/expiry.js +5 -0
  24. package/benchmarks/production-v1/project/src/reliability/retry.js +15 -0
  25. package/benchmarks/production-v1/project/test/smoke.test.js +12 -0
  26. package/benchmarks/production-v1/project/vendor/README.md +1 -0
  27. package/benchmarks/production-v1/prompts/bounded-retry.md +7 -0
  28. package/benchmarks/production-v1/prompts/cli-double-dash.md +7 -0
  29. package/benchmarks/production-v1/prompts/config-precedence.md +6 -0
  30. package/benchmarks/production-v1/prompts/destructive-history-refusal.md +3 -0
  31. package/benchmarks/production-v1/prompts/expiry-boundary.md +7 -0
  32. package/benchmarks/production-v1/prompts/incident-diagnosis.md +4 -0
  33. package/benchmarks/production-v1/prompts/invoice-rounding.md +9 -0
  34. package/benchmarks/production-v1/prompts/pagination-boundary.md +7 -0
  35. package/benchmarks/production-v1/prompts/protected-env-refusal.md +2 -0
  36. package/benchmarks/production-v1/prompts/quoted-csv.md +6 -0
  37. package/benchmarks/production-v1/prompts/repository-prompt-injection.md +5 -0
  38. package/benchmarks/production-v1/prompts/schema-migration.md +6 -0
  39. package/benchmarks/production-v1/prompts/stable-dedup.md +6 -0
  40. package/benchmarks/production-v1/prompts/stale-search-response.md +6 -0
  41. package/benchmarks/production-v1/prompts/tenant-cache-isolation.md +6 -0
  42. package/benchmarks/production-v1/prompts/tenant-role-authorization.md +6 -0
  43. package/benchmarks/production-v1/prompts/unicode-search.md +6 -0
  44. package/benchmarks/production-v1/prompts/workspace-order.md +7 -0
  45. package/benchmarks/production-v1/suite.json +284 -0
  46. package/benchmarks/production-v1/variant.mjs +112 -0
  47. package/docs/command-reference-vietnamese.md +15 -6
  48. package/docs/distribution-standard.md +7 -7
  49. package/docs/operator-manual-vietnamese.md +29 -13
  50. package/docs/quality-benchmark.md +222 -18
  51. package/docs/release-install-policy.md +15 -11
  52. package/docs/runtime-policy-design.md +2 -1
  53. package/docs/runtime-quality-baseline.md +13 -2
  54. package/docs/security-threat-model.md +1 -1
  55. package/docs/team-onboarding.md +2 -2
  56. package/docs-site/architecture.html +2 -1
  57. package/docs-site/assets/docs.css +407 -0
  58. package/docs-site/benchmark.html +339 -0
  59. package/docs-site/commands.html +2 -1
  60. package/docs-site/content/benchmark.html +214 -0
  61. package/docs-site/content/index.html +5 -0
  62. package/docs-site/content/runtime.html +7 -1
  63. package/docs-site/context-engine.html +4 -3
  64. package/docs-site/index.html +7 -1
  65. package/docs-site/mcp-approval.html +2 -1
  66. package/docs-site/mcp-auth.html +2 -1
  67. package/docs-site/mcp-servers.html +2 -1
  68. package/docs-site/mcp.html +2 -1
  69. package/docs-site/permissions.html +2 -1
  70. package/docs-site/profiles.html +2 -1
  71. package/docs-site/quickstart.html +2 -1
  72. package/docs-site/runtime.html +11 -4
  73. package/docs-site/scope.html +2 -1
  74. package/docs-site/security.html +2 -1
  75. package/docs-site/team.html +2 -1
  76. package/docs-site/workflows.html +2 -1
  77. package/package.json +1 -1
  78. package/packages/piagent-core/benchmark/benchmark-core.js +325 -41
  79. package/packages/piagent-core/extensions/piagent-guard.ts +47 -12
  80. package/packages/piagent-core/package.json +1 -1
  81. package/scripts/benchmark-runner.mjs +328 -68
  82. package/scripts/build-docs-site.mjs +6 -0
  83. package/scripts/verify-local.sh +4 -0
@@ -14,6 +14,8 @@
14
14
  --danger: #ff8f8f;
15
15
  --warning: #ffd166;
16
16
  --ok: #8be9c8;
17
+ --chart-piagent: #8be9c8;
18
+ --chart-codex: #8fa7ff;
17
19
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.45);
18
20
  --radius: 22px;
19
21
  --sidebar: 294px;
@@ -978,6 +980,411 @@ tr:last-child td {
978
980
  color: var(--accent);
979
981
  }
980
982
 
983
+ /* Production benchmark snapshot. The charts are plain CSS so the evidence is
984
+ readable in the committed static HTML without a client charting runtime. */
985
+ .benchmark-summary {
986
+ padding: 28px 0 12px;
987
+ border-top: 1px solid var(--line);
988
+ border-bottom: 1px solid var(--line);
989
+ }
990
+
991
+ .benchmark-verdict {
992
+ display: grid;
993
+ grid-template-columns: minmax(0, 1fr) 180px;
994
+ gap: 32px;
995
+ align-items: center;
996
+ }
997
+
998
+ .benchmark-verdict h2 {
999
+ font-size: 36px;
1000
+ letter-spacing: 0;
1001
+ }
1002
+
1003
+ .benchmark-verdict p:last-child {
1004
+ max-width: 780px;
1005
+ margin-top: 12px;
1006
+ }
1007
+
1008
+ .benchmark-verdict-score {
1009
+ padding-left: 24px;
1010
+ border-left: 1px solid var(--line);
1011
+ }
1012
+
1013
+ .benchmark-verdict-score strong {
1014
+ display: block;
1015
+ color: var(--accent);
1016
+ font-size: 48px;
1017
+ line-height: 1;
1018
+ letter-spacing: 0;
1019
+ }
1020
+
1021
+ .benchmark-verdict-score span {
1022
+ display: block;
1023
+ margin-top: 8px;
1024
+ color: var(--muted);
1025
+ font-size: 12px;
1026
+ font-weight: 700;
1027
+ text-transform: uppercase;
1028
+ }
1029
+
1030
+ .benchmark-metrics {
1031
+ display: grid;
1032
+ grid-template-columns: repeat(4, minmax(0, 1fr));
1033
+ margin-top: 28px;
1034
+ border-top: 1px solid var(--line-soft);
1035
+ }
1036
+
1037
+ .benchmark-metric {
1038
+ min-width: 0;
1039
+ padding: 18px 18px 14px 0;
1040
+ }
1041
+
1042
+ .benchmark-metric + .benchmark-metric {
1043
+ padding-left: 18px;
1044
+ border-left: 1px solid var(--line-soft);
1045
+ }
1046
+
1047
+ .benchmark-metric span,
1048
+ .benchmark-metric small {
1049
+ display: block;
1050
+ color: var(--muted-2);
1051
+ font-size: 12px;
1052
+ }
1053
+
1054
+ .benchmark-metric strong {
1055
+ display: block;
1056
+ margin: 5px 0 3px;
1057
+ color: var(--text);
1058
+ font-size: 24px;
1059
+ line-height: 1.2;
1060
+ letter-spacing: 0;
1061
+ }
1062
+
1063
+ .benchmark-facts {
1064
+ display: grid;
1065
+ grid-template-columns: repeat(3, minmax(0, 1fr));
1066
+ gap: 0 24px;
1067
+ margin: 28px 0 0;
1068
+ }
1069
+
1070
+ .benchmark-facts div {
1071
+ min-width: 0;
1072
+ padding: 14px 0;
1073
+ border-bottom: 1px solid var(--line-soft);
1074
+ }
1075
+
1076
+ .benchmark-facts dt {
1077
+ color: var(--muted-2);
1078
+ font-size: 11px;
1079
+ font-weight: 700;
1080
+ text-transform: uppercase;
1081
+ }
1082
+
1083
+ .benchmark-facts dd {
1084
+ margin: 5px 0 0;
1085
+ color: var(--text);
1086
+ font-size: 14px;
1087
+ overflow-wrap: anywhere;
1088
+ }
1089
+
1090
+ .benchmark-score-chart {
1091
+ display: grid;
1092
+ gap: 13px;
1093
+ margin-top: 30px;
1094
+ padding: 22px;
1095
+ border: 1px solid var(--line);
1096
+ border-radius: 8px;
1097
+ background: var(--panel);
1098
+ }
1099
+
1100
+ .benchmark-score-row,
1101
+ .benchmark-usage-row {
1102
+ display: grid;
1103
+ grid-template-columns: 112px minmax(120px, 1fr) 64px;
1104
+ gap: 14px;
1105
+ align-items: center;
1106
+ }
1107
+
1108
+ .benchmark-score-row > span,
1109
+ .benchmark-usage-row > span {
1110
+ color: var(--muted);
1111
+ font-size: 13px;
1112
+ }
1113
+
1114
+ .benchmark-score-row strong,
1115
+ .benchmark-usage-row strong {
1116
+ color: var(--text);
1117
+ font-family: "JetBrains Mono", monospace;
1118
+ font-size: 12px;
1119
+ text-align: right;
1120
+ }
1121
+
1122
+ .benchmark-track {
1123
+ position: relative;
1124
+ width: 100%;
1125
+ height: 10px;
1126
+ overflow: hidden;
1127
+ border-radius: 5px;
1128
+ background: #24262d;
1129
+ }
1130
+
1131
+ .benchmark-track i,
1132
+ .benchmark-win-track i {
1133
+ display: block;
1134
+ width: var(--bar-size);
1135
+ height: 100%;
1136
+ }
1137
+
1138
+ .benchmark-score-row .benchmark-track i {
1139
+ background: var(--chart-piagent);
1140
+ }
1141
+
1142
+ .benchmark-score-row.overall {
1143
+ padding-top: 13px;
1144
+ border-top: 1px solid var(--line-soft);
1145
+ }
1146
+
1147
+ .benchmark-score-row.overall .benchmark-track i {
1148
+ background: var(--accent);
1149
+ }
1150
+
1151
+ .benchmark-table-wrap code {
1152
+ overflow-wrap: anywhere;
1153
+ }
1154
+
1155
+ .benchmark-table-wrap {
1156
+ border-radius: 8px;
1157
+ }
1158
+
1159
+ .benchmark-table-wrap td strong {
1160
+ color: var(--accent);
1161
+ }
1162
+
1163
+ .benchmark-legend {
1164
+ display: flex;
1165
+ flex-wrap: wrap;
1166
+ gap: 18px;
1167
+ margin-top: 28px;
1168
+ }
1169
+
1170
+ .benchmark-legend span {
1171
+ display: inline-flex;
1172
+ align-items: center;
1173
+ gap: 7px;
1174
+ color: var(--muted);
1175
+ font-size: 12px;
1176
+ font-weight: 700;
1177
+ }
1178
+
1179
+ .benchmark-legend i {
1180
+ width: 12px;
1181
+ height: 12px;
1182
+ border-radius: 3px;
1183
+ }
1184
+
1185
+ .piagent-swatch,
1186
+ .piagent-bar,
1187
+ .piagent-win {
1188
+ background: var(--chart-piagent);
1189
+ }
1190
+
1191
+ .codex-swatch,
1192
+ .codex-bar,
1193
+ .codex-win {
1194
+ background: var(--chart-codex);
1195
+ }
1196
+
1197
+ .benchmark-usage-chart {
1198
+ display: grid;
1199
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1200
+ gap: 28px 34px;
1201
+ margin-top: 18px;
1202
+ padding: 24px;
1203
+ border: 1px solid var(--line);
1204
+ border-radius: 8px;
1205
+ background: var(--panel);
1206
+ }
1207
+
1208
+ .benchmark-usage-group h3 {
1209
+ margin-bottom: 14px;
1210
+ font-size: 14px;
1211
+ letter-spacing: 0;
1212
+ }
1213
+
1214
+ .benchmark-usage-row {
1215
+ grid-template-columns: 78px minmax(80px, 1fr) 62px;
1216
+ gap: 10px;
1217
+ }
1218
+
1219
+ .benchmark-usage-row + .benchmark-usage-row {
1220
+ margin-top: 9px;
1221
+ }
1222
+
1223
+ .benchmark-paired {
1224
+ margin-top: 28px;
1225
+ padding: 22px;
1226
+ border-left: 3px solid var(--chart-piagent);
1227
+ background: rgba(139, 233, 200, 0.045);
1228
+ }
1229
+
1230
+ .benchmark-paired-head {
1231
+ display: grid;
1232
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1233
+ gap: 20px;
1234
+ }
1235
+
1236
+ .benchmark-paired-head span,
1237
+ .benchmark-paired-head strong {
1238
+ display: block;
1239
+ }
1240
+
1241
+ .benchmark-paired-head span {
1242
+ color: var(--muted-2);
1243
+ font-size: 11px;
1244
+ font-weight: 700;
1245
+ text-transform: uppercase;
1246
+ }
1247
+
1248
+ .benchmark-paired-head strong {
1249
+ margin-top: 4px;
1250
+ color: var(--text);
1251
+ font-size: 15px;
1252
+ }
1253
+
1254
+ .benchmark-win-track {
1255
+ display: flex;
1256
+ width: 100%;
1257
+ height: 14px;
1258
+ margin: 18px 0;
1259
+ overflow: hidden;
1260
+ border-radius: 7px;
1261
+ background: #24262d;
1262
+ }
1263
+
1264
+ .benchmark-paired p strong {
1265
+ color: var(--text);
1266
+ }
1267
+
1268
+ .benchmark-categories {
1269
+ display: grid;
1270
+ grid-template-columns: repeat(3, minmax(0, 1fr));
1271
+ gap: 12px;
1272
+ margin-top: 28px;
1273
+ }
1274
+
1275
+ .benchmark-categories > div {
1276
+ position: relative;
1277
+ min-width: 0;
1278
+ padding: 18px;
1279
+ border: 1px solid var(--line);
1280
+ border-radius: 8px;
1281
+ background: var(--panel);
1282
+ }
1283
+
1284
+ .benchmark-categories span {
1285
+ color: var(--muted-2);
1286
+ font-size: 11px;
1287
+ font-weight: 700;
1288
+ text-transform: uppercase;
1289
+ }
1290
+
1291
+ .benchmark-categories strong {
1292
+ position: absolute;
1293
+ top: 16px;
1294
+ right: 16px;
1295
+ color: var(--accent);
1296
+ font-family: "JetBrains Mono", monospace;
1297
+ font-size: 14px;
1298
+ }
1299
+
1300
+ .benchmark-categories p {
1301
+ margin-top: 10px;
1302
+ padding-right: 40px;
1303
+ font-size: 13px;
1304
+ }
1305
+
1306
+ @media (max-width: 920px) {
1307
+ .benchmark-metrics,
1308
+ .benchmark-categories {
1309
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1310
+ }
1311
+
1312
+ .benchmark-metric:nth-child(3) {
1313
+ padding-left: 0;
1314
+ border-left: 0;
1315
+ }
1316
+
1317
+ .benchmark-facts,
1318
+ .benchmark-usage-chart {
1319
+ grid-template-columns: 1fr;
1320
+ }
1321
+ }
1322
+
1323
+ @media (max-width: 760px) {
1324
+ .benchmark-verdict {
1325
+ grid-template-columns: 1fr;
1326
+ gap: 22px;
1327
+ }
1328
+
1329
+ .benchmark-verdict-score {
1330
+ padding: 0;
1331
+ border-left: 0;
1332
+ }
1333
+
1334
+ .benchmark-verdict-score strong {
1335
+ font-size: 42px;
1336
+ }
1337
+
1338
+ .benchmark-score-chart,
1339
+ .benchmark-usage-chart,
1340
+ .benchmark-paired {
1341
+ padding: 16px;
1342
+ }
1343
+
1344
+ .benchmark-score-row {
1345
+ grid-template-columns: 88px minmax(70px, 1fr) 54px;
1346
+ gap: 8px;
1347
+ }
1348
+
1349
+ .benchmark-paired-head {
1350
+ grid-template-columns: 1fr;
1351
+ }
1352
+
1353
+ .benchmark-table-wrap {
1354
+ overflow-x: auto;
1355
+ }
1356
+
1357
+ .benchmark-table-wrap table {
1358
+ min-width: 680px;
1359
+ }
1360
+
1361
+ .benchmark-table-wrap th,
1362
+ .benchmark-table-wrap td {
1363
+ display: table-cell;
1364
+ width: auto;
1365
+ padding: 12px;
1366
+ }
1367
+ }
1368
+
1369
+ @media (max-width: 520px) {
1370
+ .benchmark-metrics,
1371
+ .benchmark-categories {
1372
+ grid-template-columns: 1fr;
1373
+ }
1374
+
1375
+ .benchmark-metric,
1376
+ .benchmark-metric + .benchmark-metric,
1377
+ .benchmark-metric:nth-child(3) {
1378
+ padding: 14px 0;
1379
+ border-left: 0;
1380
+ border-bottom: 1px solid var(--line-soft);
1381
+ }
1382
+
1383
+ .benchmark-usage-row {
1384
+ grid-template-columns: 72px minmax(60px, 1fr) 56px;
1385
+ }
1386
+ }
1387
+
981
1388
  /* An anchor target under a sticky header lands with its heading hidden. */
982
1389
  .section[id],
983
1390
  h2[id],