ai-developer-skill-os 10.1.0 → 10.2.0
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.
- package/.agents/AGENTS.md +13 -0
- package/.agents/LICENSE +21 -21
- package/.agents/docs/ARCHITECTURE.md +56 -120
- package/.agents/docs/GOVERNANCE.md +3 -3
- package/.agents/docs/SPEC.md +137 -60
- package/.agents/docs/VERSIONING.md +25 -57
- package/.agents/docs/adr/0005-v10-platform-consolidation.md +50 -0
- package/.agents/docs/schemas/learning.schema.yml +22 -57
- package/.agents/docs/schemas/skill.schema.yml +116 -161
- package/.agents/docs/schemas/workflow.schema.yml +51 -26
- package/.agents/docs/skill-classification.md +1 -1
- package/.agents/registry/graph.json +171 -77
- package/.agents/registry/index.yaml +68 -35
- package/.agents/rules/coding.md +1 -1
- package/.agents/rules/command-safety.md +1 -1
- package/.agents/rules/global.md +1 -1
- package/.agents/rules/prompt-compiler.md +1 -1
- package/.agents/rules/safety.md +1 -1
- package/.agents/rules/security.md +1 -1
- package/.agents/rules/skill-quality.md +18 -3
- package/.agents/skills/_template/SKILL.md +238 -88
- package/.agents/skills/qk-api-data-discovery/SKILL.md +176 -190
- package/.agents/skills/qk-api-data-discovery/references/bronze-record-format.md +47 -0
- package/.agents/skills/qk-api-data-discovery/references/data-contract-yaml.md +72 -0
- package/.agents/skills/qk-api-data-discovery/references/discovery-report-template.md +110 -0
- package/.agents/skills/qk-backend-data/SKILL.md +150 -1
- package/.agents/skills/qk-bug-resolution/SKILL.md +153 -1
- package/.agents/skills/qk-bug-resolution/evals/scorecard.yaml +1 -1
- package/.agents/skills/qk-code-cleaner/SKILL.md +150 -1
- package/.agents/skills/qk-code-review/SKILL.md +195 -1
- package/.agents/skills/qk-code-review/evals/scorecard.yaml +1 -1
- package/.agents/skills/qk-code-review/references/ai/{v8-schema-validation.md → schema-validation.md} +2 -2
- package/.agents/skills/qk-code-review/references/cross-cutting/async-concurrency-patterns.md +515 -515
- package/.agents/skills/qk-code-review/references/cross-cutting/error-handling-principles.md +492 -492
- package/.agents/skills/qk-code-review/references/cross-cutting/n-plus-one-queries.md +309 -309
- package/.agents/skills/qk-code-review/references/cross-cutting/sql-injection-prevention.md +307 -307
- package/.agents/skills/qk-code-review/references/cross-cutting/xss-prevention.md +263 -263
- package/.agents/skills/qk-code-review/references/languages/angular.md +768 -768
- package/.agents/skills/qk-code-review/references/languages/c.md +890 -890
- package/.agents/skills/qk-code-review/references/languages/cpp.md +893 -893
- package/.agents/skills/qk-code-review/references/languages/css-less-sass.md +661 -661
- package/.agents/skills/qk-code-review/references/languages/django.md +985 -985
- package/.agents/skills/qk-code-review/references/languages/fastapi.md +580 -580
- package/.agents/skills/qk-code-review/references/languages/go.md +993 -993
- package/.agents/skills/qk-code-review/references/languages/java.md +409 -409
- package/.agents/skills/qk-code-review/references/languages/java8.md +586 -586
- package/.agents/skills/qk-code-review/references/languages/kotlin.md +1018 -1018
- package/.agents/skills/qk-code-review/references/languages/nestjs.md +593 -593
- package/.agents/skills/qk-code-review/references/languages/php.md +684 -684
- package/.agents/skills/qk-code-review/references/languages/python.md +1073 -1073
- package/.agents/skills/qk-code-review/references/languages/qt.md +757 -757
- package/.agents/skills/qk-code-review/references/languages/react.md +871 -871
- package/.agents/skills/qk-code-review/references/languages/ruby.md +964 -964
- package/.agents/skills/qk-code-review/references/languages/rust.md +846 -846
- package/.agents/skills/qk-code-review/references/languages/svelte.md +1064 -1064
- package/.agents/skills/qk-code-review/references/languages/swift.md +936 -936
- package/.agents/skills/qk-code-review/references/languages/typescript.md +1016 -1016
- package/.agents/skills/qk-code-review/references/languages/vue.md +924 -924
- package/.agents/skills/qk-code-review/references/languages/zig.md +440 -440
- package/.agents/skills/qk-devops-release/SKILL.md +150 -1
- package/.agents/skills/qk-feature-delivery/SKILL.md +153 -1
- package/.agents/skills/qk-feature-delivery/evals/scorecard.yaml +1 -1
- package/.agents/skills/qk-orchestrator/SKILL.md +187 -2
- package/.agents/skills/qk-orchestrator/evals/scorecard.yaml +1 -1
- package/.agents/skills/qk-orchestrator/references/routing-table.md +1 -1
- package/.agents/skills/qk-product-spec/SKILL.md +150 -1
- package/.agents/skills/qk-prompt-compiler/SKILL.md +188 -65
- package/.agents/skills/qk-ui-engineer/SKILL.md +150 -1
- package/.agents/workflows/_schema.yml +146 -146
- package/.agents/workflows/bug-resolution.yml +155 -121
- package/.agents/workflows/code-review.yml +127 -93
- package/.agents/workflows/context-discovery.yml +128 -94
- package/.agents/workflows/documentation.yml +124 -90
- package/.agents/workflows/feature-delivery.yml +158 -124
- package/.agents/workflows/production-release.yml +207 -173
- package/.agents/workflows/prompt-compilation.yml +126 -0
- package/.agents/workflows/refactor.yml +136 -102
- package/.agents/workflows/security-audit.yml +149 -115
- package/.agents/workflows/shared/quality-gate.yml +3 -1
- package/.agents/workflows/skin-governance.yml +149 -115
- package/.agents/workflows/spec-driven-development.yml +78 -71
- package/CHANGELOG.md +61 -0
- package/README.md +3 -3
- package/bin/install.js +38 -51
- package/package.json +68 -74
- package/tooling/build-registry.js +226 -208
- package/tooling/run-aar.js +55 -126
- package/tooling/sync-versions.js +2 -2
- package/tooling/validate-graph.js +100 -87
- package/tooling/validate-skills.js +32 -14
- package/.agents/docs/decisions/ADR-001-v8-migration.md +0 -58
- package/.agents/docs/decisions/ADR-002-workflow-separation.md +0 -50
- package/.agents/docs/decisions/ADR-003-registry-generated.md +0 -54
- package/.agents/docs/decisions/ADR-008-skill-boundary-review.md +0 -27
- package/.agents/registry/capability-graph.yml +0 -390
- package/.agents/registry/skills-index.yml +0 -305
- package/.agents/skills/_template/capability.yaml +0 -34
- package/.agents/skills/_template/evals/scorecard.yaml +0 -19
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: qk-api-data-discovery
|
|
3
|
-
version: 10.
|
|
3
|
+
version: 10.2.0
|
|
4
4
|
status: stable
|
|
5
5
|
subtitle: "API & Data Discovery"
|
|
6
6
|
description: "Kỹ sư Khám phá API & Hợp đồng Dữ liệu: Phân tích Postman collection, thu thập phản hồi thực tế (Real API Evidence), khám phá Schema & Data Dictionary, đánh giá tầng Bronze Medallion, đối chiếu kiến trúc dự án và xuất báo cáo Checkpoint. Tuân thủ nguyên tắc: Discovery First, Implementation Only on User Direction. Dùng khi: postman, api discovery, api evidence, schema discovery, data contract, data dictionary, bronze ingestion, chuẩn hóa postman, phân tích postman collection."
|
|
7
|
+
platforms: [antigravity, claude, opencode]
|
|
8
|
+
runtime_version: 1
|
|
7
9
|
tools:
|
|
8
10
|
- filesystem
|
|
9
11
|
- terminal
|
|
@@ -33,23 +35,100 @@ triggers:
|
|
|
33
35
|
|
|
34
36
|
---
|
|
35
37
|
|
|
38
|
+
## Memory Workflow
|
|
39
|
+
|
|
40
|
+
### 0. Self-Init Protocol (Khởi Tạo Bộ Nhớ Local & Gitignore)
|
|
41
|
+
- Trước khi tra cứu hoặc lưu trữ tri thức, BẮT BUỘC kiểm tra sự tồn tại của thư mục `.ai-local/` tại gốc dự án:
|
|
42
|
+
- **Tự động tạo mới:** Nếu `.ai-local/` chưa tồn tại, AI phải tự động tạo cấu trúc thư mục `.ai-local/knowledge/` (và file `index.yaml` nếu cần thiết) cùng `.ai-local/candidates/`. Tuyệt đối không ngưng chạy hay hỏi ý kiến người dùng về thao tác khởi tạo tiêu chuẩn này.
|
|
43
|
+
- **Bảo mật Gitignore:** BẮT BUỘC kiểm tra file `.gitignore` của dự án, nếu chưa có dòng `.ai-local/` thì phải tự động thêm vào để tuyệt đối bảo mật tri thức cá nhân và tránh lộ lọt lên Git.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
### Pre-flight Retrieve (Trước khi thực thi)
|
|
48
|
+
- Trước các task có tính lặp lại, debug, refactor, kiến trúc hoặc rủi ro cao:
|
|
49
|
+
bắt buộc tra cứu:
|
|
50
|
+
- `.ai-local/knowledge/index.yaml` (Private Local Knowledge)
|
|
51
|
+
|
|
52
|
+
- Ưu tiên sử dụng các Knowledge đang có trạng thái `Active` thuộc:
|
|
53
|
+
- Architecture
|
|
54
|
+
- Hard Bug
|
|
55
|
+
- Convention
|
|
56
|
+
- Pattern
|
|
57
|
+
- Tech Debt Pattern
|
|
58
|
+
|
|
59
|
+
- Memory chỉ đóng vai trò **Navigator (bản đồ chỉ đường)**.
|
|
60
|
+
Không được xem Memory là Source of Truth.
|
|
61
|
+
Luôn xác minh lại bằng source code, configuration và trạng thái hiện tại của dự án trước khi áp dụng.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
### Learning Flow (AI tự học có kiểm soát)
|
|
66
|
+
- Trong quá trình làm việc, AI được phép tự phát hiện và tạo **Candidate Memory** khi nhận thấy:
|
|
67
|
+
- Hard Bug có khả năng tái diễn.
|
|
68
|
+
- Pattern làm việc lặp lại trong dự án.
|
|
69
|
+
- Convention hoặc quy tắc kiến trúc mới.
|
|
70
|
+
- Quyết định Architecture quan trọng.
|
|
71
|
+
- Tech Debt Pattern hoặc Code Smell có tính hệ thống.
|
|
72
|
+
|
|
73
|
+
- Candidate Memory chỉ là bản nháp quan sát, chưa phải tri thức chính thức.
|
|
74
|
+
- Candidate Memory có thể lưu tạm tại: `.ai-local/candidates/`
|
|
75
|
+
- AI không được tự động Promote Candidate Memory thành Project Knowledge.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
### Post-flight Harvest (Đề xuất → Phê duyệt)
|
|
80
|
+
Sau khi hoàn thành task:
|
|
81
|
+
- AI đánh giá các Candidate Memory đã tạo.
|
|
82
|
+
- Nếu phát hiện tri thức có giá trị tái sử dụng:
|
|
83
|
+
- Đề xuất người dùng xem xét.
|
|
84
|
+
- Gửi yêu cầu phê duyệt thông qua:
|
|
85
|
+
- `/learn`
|
|
86
|
+
- `qk-project-memory`
|
|
87
|
+
- Chỉ sau khi được phê duyệt, Candidate Memory mới được chuyển thành Knowledge chính thức:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
.ai-local/candidates/ ──(Approve)──> .ai-local/knowledge/index.yaml
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
- Project Knowledge phải được xem như tài sản kỹ thuật của dự án:
|
|
94
|
+
- Có thể review, cập nhật, loại bỏ và có lịch sử thay đổi.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### Ignore (Không đưa vào Memory)
|
|
99
|
+
Không lưu:
|
|
100
|
+
- Trace log của một session đơn lẻ.
|
|
101
|
+
- Temporary debugging data.
|
|
102
|
+
- Output của một lần chạy test/scan.
|
|
103
|
+
- Report health tạm thời của một đợt kiểm tra.
|
|
104
|
+
- Lỗi nhỏ chỉ xảy ra một lần.
|
|
105
|
+
- Thông tin không có khả năng tái sử dụng.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
### Golden Rule
|
|
110
|
+
> **AI được phép học, nhưng không được tự quyết định tri thức chính thức.**
|
|
111
|
+
> **AI quan sát → Đề xuất → Con người phê duyệt → Dự án tiến hóa.**
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
36
115
|
## 1. Nguyên Tắc Cốt Lõi & Tôn Chỉ Bất Di Bất Dịch
|
|
37
116
|
|
|
38
117
|
> 🎯 **Core Identity:** Đây KHÔNG PHẢI là một công cụ định dạng Postman đơn thuần ("Postman Formatter"). Đây là hệ thống **API-to-Data Discovery Engine**: Biến Postman collection từ một tập hợp request thô thành nguồn tri thức có bằng chứng thực tế phục vụ đồng thời Backend, QA, Data Engineer, Data Analyst và AI Agent.
|
|
39
118
|
|
|
40
119
|
### 🌟 4 Nguyên Tắc Vàng (Golden Principles)
|
|
41
120
|
1. **Evidence Over Inference (Bằng chứng trên suy đoán):**
|
|
42
|
-
|
|
43
|
-
|
|
121
|
+
> *"Never infer an API contract from endpoint names alone. Observe the real API response first, preserve raw evidence, then derive the schema and standardized collection from observed evidence."*
|
|
122
|
+
*(Không bao giờ suy diễn hợp đồng API chỉ từ tên endpoint. Luôn quan sát phản hồi thật trước, bảo toàn bằng chứng thô, rồi mới suy ra schema và bộ collection chuẩn hóa).*
|
|
44
123
|
2. **Hypothesis vs Truth (Giả thuyết vs Sự thật):**
|
|
45
|
-
|
|
46
|
-
|
|
124
|
+
> *"Observed API behavior is evidence; inferred schema is a hypothesis until validated by sufficient executions."*
|
|
125
|
+
*(Hành vi API quan sát được là bằng chứng; schema suy luận chỉ là giả thuyết cho đến khi được kiểm chứng qua đủ số lần chạy).*
|
|
47
126
|
3. **Discovery First, Implementation Upon Direction (Khám phá trước, làm sau):**
|
|
48
|
-
|
|
49
|
-
|
|
127
|
+
> *"DISCOVERY FIRST, IMPLEMENTATION ONLY ON EXPLICIT USER DIRECTION."*
|
|
128
|
+
*(Luôn ưu tiên khám phá, đánh giá và lập báo cáo checkpoint. TUYỆT ĐỐI KHÔNG tự động triển khai code, pipeline hay migration nếu chưa có chỉ đạo tường minh từ người dùng).*
|
|
50
129
|
4. **No Premature Architecture Mutation (Không tự ý biến đổi hệ thống):**
|
|
51
|
-
|
|
52
|
-
|
|
130
|
+
> *"The discovery agent MUST NOT create production code, Bronze pipelines, database schemas, or modify project architecture merely because those actions appear to be logical next steps."*
|
|
131
|
+
*(Agent cấm tự tiện tạo mã nguồn production, pipeline Bronze, hay sửa schema cơ sở dữ liệu chỉ vì thấy đó là bước tiếp theo hợp lý).*
|
|
53
132
|
|
|
54
133
|
### 📜 Quy Tắc Bàn Giao Quyền Quyết Định (The Handoff Contract Rule)
|
|
55
134
|
```text
|
|
@@ -223,120 +302,9 @@ Báo cáo phân tích `docs/api-discovery/<collection>-analysis.md` đóng vai t
|
|
|
223
302
|
|
|
224
303
|
---
|
|
225
304
|
|
|
226
|
-
### Mẫu Báo Cáo 10 Mục Hoàn Chỉnh
|
|
227
|
-
|
|
228
|
-
```markdown
|
|
229
|
-
# API Discovery & Evidence Report: [<collection_name>]
|
|
230
|
-
|
|
231
|
-
> **Status:** DISCOVERY_COMPLETED (Awaiting User Decision)
|
|
232
|
-
> **Execution Date:** <ISO_TIMESTAMP>
|
|
233
|
-
> **Environment:** <Staging / Production / Offline Logs>
|
|
234
|
-
|
|
235
|
-
---
|
|
236
|
-
|
|
237
|
-
## 1. Executive Summary
|
|
238
|
-
- **Collection Name:** `<name>`
|
|
239
|
-
- **Total Requests Analyzed:** `<total>`
|
|
240
|
-
- **Requests Executed (Evidence Collected):** `<executed_count>` (Success: `<success>`, Failed: `<failed>`)
|
|
241
|
-
- **Requests Not Executed:** `<skipped_count>` (Do phân loại rủi ro hoặc thiếu thông tin)
|
|
242
|
-
- **Average Response Latency:** `<avg_ms> ms` (Min: `<min_ms>`, Max: `<max_ms>`)
|
|
243
|
-
|
|
244
|
-
---
|
|
245
|
-
|
|
246
|
-
## 2. Project Context & Detected Architecture
|
|
247
|
-
- **Backend Stack:** `<stack hoặc None>`
|
|
248
|
-
- **Data Pipeline Stack:** `<dbt / Airflow / Python scripts / Không có>`
|
|
249
|
-
- **Existing Storage Zones:** `<Bronze/Silver/Gold folders hiện có>`
|
|
250
|
-
- **Relevant Existing Modules:**
|
|
251
|
-
- `<file_link_1>`
|
|
252
|
-
- `<file_link_2>`
|
|
253
|
-
|
|
254
|
-
---
|
|
255
|
-
|
|
256
|
-
## 3. API Inventory & Risk Classification
|
|
257
|
-
| # | Method | Endpoint Path | Risk Gate | Execution Status | HTTP Status | Response Time | Domain / Module |
|
|
258
|
-
|---|---|---|---|---|---|---|---|
|
|
259
|
-
| 1 | GET | `/api/v1/users` | AUTO | EXECUTED | 200 OK | 184 ms | User Management |
|
|
260
|
-
| 2 | POST | `/api/v1/users` | CONFIRM | NOT_EXECUTED | — | — | User Management |
|
|
261
|
-
| 3 | GET | `/api/v1/orders` | AUTO | EXECUTED | 200 OK | 340 ms | Order Processing |
|
|
262
|
-
|
|
263
|
-
---
|
|
264
|
-
|
|
265
|
-
## 4. Real API Evidence (Observed Responses)
|
|
266
|
-
### Endpoint: `GET /api/v1/users`
|
|
267
|
-
- **Execution Status:** EXECUTED
|
|
268
|
-
- **HTTP Code:** `200 OK` | **Latency:** `184 ms`
|
|
269
|
-
- **Observed Response Body (Raw Snippet):**
|
|
270
|
-
```json
|
|
271
|
-
{
|
|
272
|
-
"data": [
|
|
273
|
-
{ "id": 1024, "name": "Nguyen Van A", "createdAt": "2026-09-15T10:20:00Z" }
|
|
274
|
-
],
|
|
275
|
-
"pagination": { "page": 1, "pageSize": 20, "total": 128 }
|
|
276
|
-
}
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
---
|
|
280
|
-
|
|
281
|
-
## 5. Schema Discovery & API Data Dictionary
|
|
282
|
-
### Entity: `users` (Derived from `GET /api/v1/users`)
|
|
283
|
-
| Field Path | Data Type | Nullable | Sample Value | Evidence Confidence |
|
|
284
|
-
|---|---|---|---|---|
|
|
285
|
-
| `data[].id` | integer | No | `1024` | 100% (Observed) |
|
|
286
|
-
| `data[].name` | string | No | `"Nguyen Van A"` | 100% (Observed) |
|
|
287
|
-
| `data[].createdAt` | datetime | No | `"2026-09-15T10:20:00Z"` | 100% (Observed) |
|
|
288
|
-
| `pagination.total` | integer | No | `128` | 100% (Observed) |
|
|
289
|
-
|
|
290
|
-
---
|
|
291
|
-
|
|
292
|
-
## 6. Data Engineering Assessment (Medallion Bronze Layer)
|
|
293
|
-
- **Candidate Bronze Sources:**
|
|
294
|
-
- `GET /api/v1/users` → Bảng Bronze: `bronze_raw_users`
|
|
295
|
-
- `GET /api/v1/orders` → Bảng Bronze: `bronze_raw_orders`
|
|
296
|
-
- **Khuyến nghị Chiến lược Ingestion:**
|
|
297
|
-
- Lưu trữ dưới dạng `NDJSON` (Newline Delimited JSON) theo từng batch chạy.
|
|
298
|
-
- Bổ sung Ingestion Metadata Header (`ingestion_id`, `ingested_at`, `status_code`, `latency_ms`).
|
|
299
|
-
- Không bóc tách mảng `data[]` ở Bronze; giữ nguyên toàn bộ payload để đảm bảo tính toàn vẹn (Immutability).
|
|
300
|
-
|
|
301
|
-
---
|
|
302
|
-
|
|
303
|
-
## 7. Existing Project Alignment
|
|
304
|
-
- Codebase hiện đã có cấu trúc: `<liệt kê>`
|
|
305
|
-
- **Phương án tích hợp khả thi:**
|
|
306
|
-
- Phương án 1: Tích hợp vào pipeline ingest sẵn có tại `<path>`.
|
|
307
|
-
- Phương án 2: Tạo module API ingestion độc lập tại `<path>`.
|
|
308
|
-
|
|
309
|
-
---
|
|
310
|
-
|
|
311
|
-
## 8. Key Findings & Anomalies
|
|
312
|
-
- **F-001 (Pagination):** Endpoint `GET /api/v1/orders` dùng phân trang `page` & `pageSize`. Cần vòng lặp loop khi ingest toàn bộ.
|
|
313
|
-
- **F-002 (Nested Structures):** Trường `customer.profile` trả về object lồng nhau 3 cấp. Khuyến nghị chuẩn hóa tại tầng Silver.
|
|
314
|
-
- **F-003 (Rate Limiting):** API trả về header `X-RateLimit-Remaining: 60`. Cần cơ chế throttle delay 500ms giữa các batch.
|
|
315
|
-
|
|
316
|
-
---
|
|
305
|
+
### Mẫu Báo Cáo 10 Mục Hoàn Chỉnh
|
|
317
306
|
|
|
318
|
-
|
|
319
|
-
- ⚠️ **R-01 (Token Expiration):** Bearer token hết hạn sau 30 phút. Cần cơ chế refresh token nếu crawl dữ liệu lớn.
|
|
320
|
-
- ⚠️ **R-02 (Inconsistent Error Schema):** Endpoint trả về HTTP 404 có format khác với HTTP 500.
|
|
321
|
-
|
|
322
|
-
---
|
|
323
|
-
|
|
324
|
-
## 10. Recommended Next Actions & DECISION REQUIRED
|
|
325
|
-
|
|
326
|
-
> ⛔ **AI ACTION STOPPED HERE — WAITING FOR USER INSTRUCTION**
|
|
327
|
-
> AI **CHƯA THỰC HIỆN BẤT KỲ THAY ĐỔI MÃ NGUỒN HOẶC TẠO PIPELINE NÀO**. Xin vui lòng chọn 1 trong các định hướng sau:
|
|
328
|
-
|
|
329
|
-
- **Option A — Bronze Ingestion Pipeline:**
|
|
330
|
-
Xây dựng pipeline thu thập và sinh file dữ liệu thô `api_responses.ndjson` + `ingestion_manifest.json` sẵn sàng nạp vào hồ dữ liệu.
|
|
331
|
-
- **Option B — Postman Collection Standardization:**
|
|
332
|
-
Chuẩn hóa lại toàn bộ collection: gom nhóm folders theo Resource, gắn response mẫu thật, thiết lập biến môi trường và bổ sung bộ test scripts `pm.test`.
|
|
333
|
-
- **Option C — Formal Data Contract:**
|
|
334
|
-
Sinh file đặc tả hợp đồng dữ liệu `api_schema.json` + `data_dictionary.md` + file contract YAML làm căn cứ kiểm định cho tầng Silver.
|
|
335
|
-
- **Option D — Data Quality & Anomaly Assertions:**
|
|
336
|
-
Thiết lập bộ quy tắc kiểm tra chất lượng dữ liệu (Null checks, Uniqueness, Type assertions) cho các endpoint quan trọng.
|
|
337
|
-
- **Option E — Deep Scenario Execution:**
|
|
338
|
-
Tiếp tục chạy thêm các kịch bản biên (Empty Result, Invalid Params, Unauthorized) để hoàn thiện bức tranh hành vi của API.
|
|
339
|
-
```
|
|
307
|
+
→ Xem chi tiết tại `references/discovery-report-template.md`
|
|
340
308
|
|
|
341
309
|
---
|
|
342
310
|
|
|
@@ -360,75 +328,11 @@ api-discovery/
|
|
|
360
328
|
└── execution_report.json # Log chi tiết kỹ thuật từng lần gọi mạng
|
|
361
329
|
```
|
|
362
330
|
|
|
363
|
-
### Cấu Trúc
|
|
364
|
-
Mỗi dòng là một đối tượng JSON độc lập, bảo tồn trọn vẹn dữ liệu gốc và dữ liệu truy vết:
|
|
365
|
-
|
|
366
|
-
```json
|
|
367
|
-
{
|
|
368
|
-
"ingestion_metadata": {
|
|
369
|
-
"ingestion_id": "b7a2d481-9f33-4a11-8e02-4876211c1209",
|
|
370
|
-
"ingested_at": "2026-09-15T10:20:31.402Z",
|
|
371
|
-
"source_type": "postman_collection",
|
|
372
|
-
"collection_name": "ECommerce-Core-API",
|
|
373
|
-
"endpoint": "GET /api/v1/orders",
|
|
374
|
-
"environment": "staging",
|
|
375
|
-
"status_code": 200,
|
|
376
|
-
"response_time_ms": 184
|
|
377
|
-
},
|
|
378
|
-
"raw_request": {
|
|
379
|
-
"method": "GET",
|
|
380
|
-
"url": "https://staging.api.example.com/api/v1/orders?page=1&pageSize=20",
|
|
381
|
-
"headers": {
|
|
382
|
-
"Accept": "application/json",
|
|
383
|
-
"Authorization": "Bearer [REDACTED_SECRET]"
|
|
384
|
-
}
|
|
385
|
-
},
|
|
386
|
-
"raw_response": {
|
|
387
|
-
"status": 200,
|
|
388
|
-
"status_text": "OK",
|
|
389
|
-
"headers": {
|
|
390
|
-
"content-type": "application/json; charset=utf-8",
|
|
391
|
-
"x-ratelimit-remaining": "59"
|
|
392
|
-
},
|
|
393
|
-
"body": {
|
|
394
|
-
"data": [
|
|
395
|
-
{ "id": 501, "order_number": "ORD-2026-001", "total_amount": 1250000, "status": "COMPLETED" }
|
|
396
|
-
],
|
|
397
|
-
"pagination": { "page": 1, "pageSize": 20, "total": 1 }
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
```
|
|
331
|
+
### Cấu Trúc Raw Bronze & Data Contract
|
|
402
332
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
dataset: "orders"
|
|
407
|
-
source_endpoint: "GET /api/v1/orders"
|
|
408
|
-
schema:
|
|
409
|
-
fields:
|
|
410
|
-
- name: "id"
|
|
411
|
-
type: "integer"
|
|
412
|
-
nullable: false
|
|
413
|
-
description: "Primary key của đơn hàng"
|
|
414
|
-
- name: "order_number"
|
|
415
|
-
type: "string"
|
|
416
|
-
nullable: false
|
|
417
|
-
format: "^ORD-[0-9]{4}-[0-9]+$"
|
|
418
|
-
- name: "total_amount"
|
|
419
|
-
type: "numeric"
|
|
420
|
-
nullable: false
|
|
421
|
-
- name: "status"
|
|
422
|
-
type: "string"
|
|
423
|
-
allowed_values: ["PENDING", "PROCESSING", "COMPLETED", "CANCELLED"]
|
|
424
|
-
quality_rules:
|
|
425
|
-
- rule: "id must be unique"
|
|
426
|
-
level: "critical"
|
|
427
|
-
- rule: "total_amount must be greater than or equal to 0"
|
|
428
|
-
level: "critical"
|
|
429
|
-
- rule: "order_number must not be null"
|
|
430
|
-
level: "critical"
|
|
431
|
-
```
|
|
333
|
+
→ Xem chi tiết tại `references/bronze-record-format.md`
|
|
334
|
+
|
|
335
|
+
→ Xem chi tiết tại `references/data-contract-yaml.md`
|
|
432
336
|
|
|
433
337
|
---
|
|
434
338
|
|
|
@@ -468,3 +372,85 @@ Vui lòng xem báo cáo chi tiết và chọn bước đi tiếp theo:
|
|
|
468
372
|
👉 Option D: Cấu hình bộ Quality Assertion Rules
|
|
469
373
|
👉 Option E: Tiếp tục khám phá các kịch bản ngoại lệ sâu hơn
|
|
470
374
|
```
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
## 8. Mô Hình Độ Tin Cậy (Confidence Model)
|
|
379
|
+
|
|
380
|
+
| Level | Condition | Action |
|
|
381
|
+
|-------|-----------|--------|
|
|
382
|
+
| HIGH | Real API response observed with HTTP status code | Report evidence as FACT |
|
|
383
|
+
| MEDIUM | Schema inferred from response structure | Note as HYPOTHESIS requiring validation |
|
|
384
|
+
| LOW | No API executed, only Postman collection parsed | Report as NOT_EXECUTED |
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
## 9. Thoái Ra Mã (Exit Codes)
|
|
389
|
+
|
|
390
|
+
| Code | Meaning | When |
|
|
391
|
+
|------|---------|------|
|
|
392
|
+
| SUCCESS | Phase A complete, checkpoint report generated, user reviewing | Report saved at docs/api-discovery/ |
|
|
393
|
+
| PARTIAL | Some endpoints could not be executed | NOT_EXECUTED entries in report |
|
|
394
|
+
| BLOCKED | Missing Postman collection, credentials, or network access | Cannot proceed with Phase A |
|
|
395
|
+
| FAILED | Critical error during discovery or report generation | Abort and report error |
|
|
396
|
+
|
|
397
|
+
---
|
|
398
|
+
|
|
399
|
+
## Platform-Specific Instructions
|
|
400
|
+
|
|
401
|
+
### Antigravity (Google Gemini)
|
|
402
|
+
- Uses `.agents/AGENTS.md` as entry point
|
|
403
|
+
- Supports Cockpit integration
|
|
404
|
+
- Rewrite absolute paths for global mode
|
|
405
|
+
- `GEMINI.md` copied for global installs
|
|
406
|
+
|
|
407
|
+
### Claude Code (Anthropic)
|
|
408
|
+
- Reads `.claude/CLAUDE.md` automatically
|
|
409
|
+
- Large context window (~200K tokens)
|
|
410
|
+
- Can handle full skill files without trimming
|
|
411
|
+
- Uses native tool format (Read, Write, Edit, Bash)
|
|
412
|
+
|
|
413
|
+
### OpenCode (Open Source)
|
|
414
|
+
- Reads `.opencode/config.yaml`
|
|
415
|
+
- Context window ~128K tokens
|
|
416
|
+
- Keep skill files lean when possible
|
|
417
|
+
- Supports custom tool format
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
## Evidence Format
|
|
422
|
+
|
|
423
|
+
Every evidence claim must follow this format:
|
|
424
|
+
|
|
425
|
+
```
|
|
426
|
+
[SEVERITY] discovery-phase: [phase-name]
|
|
427
|
+
Reason: [why this evidence matters]
|
|
428
|
+
Confidence: [HIGH|MEDIUM|LOW]
|
|
429
|
+
Fix: [suggestion if evidence points to a bug]
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### Evidence Types
|
|
433
|
+
|
|
434
|
+
| Type | Example | Severity |
|
|
435
|
+
|------|---------|----------|
|
|
436
|
+
| API Response | HTTP 200 + JSON body | HIGH |
|
|
437
|
+
| Schema Match | Response matches OpenAPI spec | HIGH |
|
|
438
|
+
| Error Pattern | Stack trace + error code | MEDIUM |
|
|
439
|
+
| Missing Endpoint | 404 on discovered route | MEDIUM |
|
|
440
|
+
| Schema Mismatch | Field type differs | HIGH |
|
|
441
|
+
|
|
442
|
+
---
|
|
443
|
+
|
|
444
|
+
## Compliance
|
|
445
|
+
|
|
446
|
+
| Check | Status |
|
|
447
|
+
|-------|--------|
|
|
448
|
+
| Runtime Standard | 11/11 |
|
|
449
|
+
| Frontmatter Complete | ✅ |
|
|
450
|
+
| Platforms Field | ✅ |
|
|
451
|
+
| References Valid | ✅ |
|
|
452
|
+
| Decision Trees | PASS |
|
|
453
|
+
| Thresholds Defined | PASS |
|
|
454
|
+
| schema_version | 10.2.0 |
|
|
455
|
+
| runtime_version | 1 |
|
|
456
|
+
| platforms | [antigravity, claude, opencode] |
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Bronze Record Format — NDJSON (Newline Delimited JSON)
|
|
2
|
+
|
|
3
|
+
Mỗi dòng là một đối tượng JSON độc lập, bảo tồn trọn vẹn dữ liệu gốc và dữ liệu truy vết:
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"ingestion_metadata": {
|
|
8
|
+
"ingestion_id": "b7a2d481-9f33-4a11-8e02-4876211c1209",
|
|
9
|
+
"ingested_at": "2026-09-15T10:20:31.402Z",
|
|
10
|
+
"source_type": "postman_collection",
|
|
11
|
+
"collection_name": "ECommerce-Core-API",
|
|
12
|
+
"endpoint": "GET /api/v1/orders",
|
|
13
|
+
"environment": "staging",
|
|
14
|
+
"status_code": 200,
|
|
15
|
+
"response_time_ms": 184
|
|
16
|
+
},
|
|
17
|
+
"raw_request": {
|
|
18
|
+
"method": "GET",
|
|
19
|
+
"url": "https://staging.api.example.com/api/v1/orders?page=1&pageSize=20",
|
|
20
|
+
"headers": {
|
|
21
|
+
"Accept": "application/json",
|
|
22
|
+
"Authorization": "Bearer [REDACTED_SECRET]"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"raw_response": {
|
|
26
|
+
"status": 200,
|
|
27
|
+
"status_text": "OK",
|
|
28
|
+
"headers": {
|
|
29
|
+
"content-type": "application/json; charset=utf-8",
|
|
30
|
+
"x-ratelimit-remaining": "59"
|
|
31
|
+
},
|
|
32
|
+
"body": {
|
|
33
|
+
"data": [
|
|
34
|
+
{ "id": 501, "order_number": "ORD-2026-001", "total_amount": 1250000, "status": "COMPLETED" }
|
|
35
|
+
],
|
|
36
|
+
"pagination": { "page": 1, "pageSize": 20, "total": 1 }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Ví dụ nhiều bản ghi NDJSON:
|
|
43
|
+
|
|
44
|
+
```ndjson
|
|
45
|
+
{"ingestion_metadata":{"ingestion_id":"b7a2d481-9f33-4a11-8e02-4876211c1209","ingested_at":"2026-09-15T10:20:31.402Z","source_type":"postman_collection","collection_name":"ECommerce-Core-API","endpoint":"GET /api/v1/orders","environment":"staging","status_code":200,"response_time_ms":184},"raw_request":{"method":"GET","url":"https://staging.api.example.com/api/v1/orders?page=1&pageSize=20","headers":{"Accept":"application/json","Authorization":"Bearer [REDACTED_SECRET]}},"raw_response":{"status":200,"status_text":"OK","headers":{"content-type":"application/json; charset=utf-8","x-ratelimit-remaining":"59"},"body":{"data":[{"id":501,"order_number":"ORD-2026-001","total_amount":1250000,"status":"COMPLETED"}],"pagination":{"page":1,"pageSize":20,"total":1}}}}
|
|
46
|
+
{"ingestion_metadata":{"ingestion_id":"c8b3e592-0a44-5b22-9f33-5987322d3110","ingested_at":"2026-09-15T10:21:15.100Z","source_type":"postman_collection","collection_name":"ECommerce-Core-API","endpoint":"GET /api/v1/users","environment":"staging","status_code":200,"response_time_ms":92},"raw_request":{"method":"GET","url":"https://staging.api.example.com/api/v1/users?page=1&pageSize=20","headers":{"Accept":"application/json","Authorization":"Bearer [REDACTED_SECRET]}},"raw_response":{"status":200,"status_text":"OK","headers":{"content-type":"application/json; charset=utf-8","x-ratelimit-remaining":"120"},"body":{"data":[{"id":1024,"name":"Nguyen Van A","createdAt":"2026-09-15T10:20:00Z"}],"pagination":{"page":1,"pageSize":20,"total":128}}}}
|
|
47
|
+
```
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Data Contract YAML Template
|
|
2
|
+
|
|
3
|
+
Cấu trúc Data Contract YAML (`schema/data_contract.yaml`):
|
|
4
|
+
|
|
5
|
+
```yaml
|
|
6
|
+
contract_version: "1.0.0"
|
|
7
|
+
dataset: "orders"
|
|
8
|
+
source_endpoint: "GET /api/v1/orders"
|
|
9
|
+
schema:
|
|
10
|
+
fields:
|
|
11
|
+
- name: "id"
|
|
12
|
+
type: "integer"
|
|
13
|
+
nullable: false
|
|
14
|
+
description: "Primary key của đơn hàng"
|
|
15
|
+
- name: "order_number"
|
|
16
|
+
type: "string"
|
|
17
|
+
nullable: false
|
|
18
|
+
format: "^ORD-[0-9]{4}-[0-9]+$"
|
|
19
|
+
- name: "total_amount"
|
|
20
|
+
type: "numeric"
|
|
21
|
+
nullable: false
|
|
22
|
+
- name: "status"
|
|
23
|
+
type: "string"
|
|
24
|
+
allowed_values: ["PENDING", "PROCESSING", "COMPLETED", "CANCELLED"]
|
|
25
|
+
quality_rules:
|
|
26
|
+
- rule: "id must be unique"
|
|
27
|
+
level: "critical"
|
|
28
|
+
- rule: "total_amount must be greater than or equal to 0"
|
|
29
|
+
level: "critical"
|
|
30
|
+
- rule: "order_number must not be null"
|
|
31
|
+
level: "critical"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Ví dụ Data Contract cho Users dataset:
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
contract_version: "1.0.0"
|
|
38
|
+
dataset: "users"
|
|
39
|
+
source_endpoint: "GET /api/v1/users"
|
|
40
|
+
schema:
|
|
41
|
+
fields:
|
|
42
|
+
- name: "id"
|
|
43
|
+
type: "integer"
|
|
44
|
+
nullable: false
|
|
45
|
+
description: "Primary key của người dùng"
|
|
46
|
+
- name: "name"
|
|
47
|
+
type: "string"
|
|
48
|
+
nullable: false
|
|
49
|
+
description: "Họ và tên đầy đủ"
|
|
50
|
+
- name: "email"
|
|
51
|
+
type: "string"
|
|
52
|
+
nullable: true
|
|
53
|
+
format: "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
|
|
54
|
+
description: "Email liên hệ (có thể không có)"
|
|
55
|
+
- name: "createdAt"
|
|
56
|
+
type: "datetime"
|
|
57
|
+
nullable: false
|
|
58
|
+
format: "ISO-8601"
|
|
59
|
+
- name: "roles"
|
|
60
|
+
type: "array[string]"
|
|
61
|
+
nullable: false
|
|
62
|
+
description: "Danh sách vai trò của người dùng"
|
|
63
|
+
quality_rules:
|
|
64
|
+
- rule: "id must be unique"
|
|
65
|
+
level: "critical"
|
|
66
|
+
- rule: "email must match email format"
|
|
67
|
+
level: "high"
|
|
68
|
+
- rule: "name must not be empty string"
|
|
69
|
+
level: "critical"
|
|
70
|
+
- rule: "createdAt must be valid ISO-8601 datetime"
|
|
71
|
+
level: "high"
|
|
72
|
+
```
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# API Discovery & Evidence Report: [<collection_name>]
|
|
2
|
+
|
|
3
|
+
> **Status:** DISCOVERY_COMPLETED (Awaiting User Decision)
|
|
4
|
+
> **Execution Date:** <ISO_TIMESTAMP>
|
|
5
|
+
> **Environment:** <Staging / Production / Offline Logs>
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Executive Summary
|
|
10
|
+
- **Collection Name:** `<name>`
|
|
11
|
+
- **Total Requests Analyzed:** `<total>`
|
|
12
|
+
- **Requests Executed (Evidence Collected):** `<executed_count>` (Success: `<success>`, Failed: `<failed>`)
|
|
13
|
+
- **Requests Not Executed:** `<skipped_count>` (Do phân loại rủi ro hoặc thiếu thông tin)
|
|
14
|
+
- **Average Response Latency:** `<avg_ms> ms` (Min: `<min_ms>`, Max: `<max_ms>`)
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 2. Project Context & Detected Architecture
|
|
19
|
+
- **Backend Stack:** `<stack hoặc None>`
|
|
20
|
+
- **Data Pipeline Stack:** `<dbt / Airflow / Python scripts / Không có>`
|
|
21
|
+
- **Existing Storage Zones:** `<Bronze/Silver/Gold folders hiện có>`
|
|
22
|
+
- **Relevant Existing Modules:**
|
|
23
|
+
- `<file_link_1>`
|
|
24
|
+
- `<file_link_2>`
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 3. API Inventory & Risk Classification
|
|
29
|
+
| # | Method | Endpoint Path | Risk Gate | Execution Status | HTTP Status | Response Time | Domain / Module |
|
|
30
|
+
|---|---|---|---|---|---|---|---|
|
|
31
|
+
| 1 | GET | `/api/v1/users` | AUTO | EXECUTED | 200 OK | 184 ms | User Management |
|
|
32
|
+
| 2 | POST | `/api/v1/users` | CONFIRM | NOT_EXECUTED | — | — | User Management |
|
|
33
|
+
| 3 | GET | `/api/v1/orders` | AUTO | EXECUTED | 200 OK | 340 ms | Order Processing |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 4. Real API Evidence (Observed Responses)
|
|
38
|
+
### Endpoint: `GET /api/v1/users`
|
|
39
|
+
- **Execution Status:** EXECUTED
|
|
40
|
+
- **HTTP Code:** `200 OK` | **Latency:** `184 ms`
|
|
41
|
+
- **Observed Response Body (Raw Snippet):**
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"data": [
|
|
45
|
+
{ "id": 1024, "name": "Nguyen Van A", "createdAt": "2026-09-15T10:20:00Z" }
|
|
46
|
+
],
|
|
47
|
+
"pagination": { "page": 1, "pageSize": 20, "total": 128 }
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 5. Schema Discovery & API Data Dictionary
|
|
54
|
+
### Entity: `users` (Derived from `GET /api/v1/users`)
|
|
55
|
+
| Field Path | Data Type | Nullable | Sample Value | Evidence Confidence |
|
|
56
|
+
|---|---|---|---|---|
|
|
57
|
+
| `data[].id` | integer | No | `1024` | 100% (Observed) |
|
|
58
|
+
| `data[].name` | string | No | `"Nguyen Van A"` | 100% (Observed) |
|
|
59
|
+
| `data[].createdAt` | datetime | No | `"2026-09-15T10:20:00Z"` | 100% (Observed) |
|
|
60
|
+
| `pagination.total` | integer | No | `128` | 100% (Observed) |
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 6. Data Engineering Assessment (Medallion Bronze Layer)
|
|
65
|
+
- **Candidate Bronze Sources:**
|
|
66
|
+
- `GET /api/v1/users` → Bảng Bronze: `bronze_raw_users`
|
|
67
|
+
- `GET /api/v1/orders` → Bảng Bronze: `bronze_raw_orders`
|
|
68
|
+
- **Khuyến nghị Chiến lược Ingestion:**
|
|
69
|
+
- Lưu trữ dưới dạng `NDJSON` (Newline Delimited JSON) theo từng batch chạy.
|
|
70
|
+
- Bổ sung Ingestion Metadata Header (`ingestion_id`, `ingested_at`, `status_code`, `latency_ms`).
|
|
71
|
+
- Không bóc tách mảng `data[]` ở Bronze; giữ nguyên toàn bộ payload để đảm bảo tính toàn vẹn (Immutability).
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 7. Existing Project Alignment
|
|
76
|
+
- Codebase hiện đã có cấu trúc: `<liệt kê>`
|
|
77
|
+
- **Phương án tích hợp khả thi:**
|
|
78
|
+
- Phương án 1: Tích hợp vào pipeline ingest sẵn có tại `<path>`.
|
|
79
|
+
- Phương án 2: Tạo module API ingestion độc lập tại `<path>`.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 8. Key Findings & Anomalies
|
|
84
|
+
- **F-001 (Pagination):** Endpoint `GET /api/v1/orders` dùng phân trang `page` & `pageSize`. Cần vòng lặp loop khi ingest toàn bộ.
|
|
85
|
+
- **F-002 (Nested Structures):** Trường `customer.profile` trả về object lồng nhau 3 cấp. Khuyến nghị chuẩn hóa tại tầng Silver.
|
|
86
|
+
- **F-003 (Rate Limiting):** API trả về header `X-RateLimit-Remaining: 60`. Cần cơ chế throttle delay 500ms giữa các batch.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## 9. Identified Risks
|
|
91
|
+
- ⚠️ **R-01 (Token Expiration):** Bearer token hết hạn sau 30 phút. Cần cơ chế refresh token nếu crawl dữ liệu lớn.
|
|
92
|
+
- ⚠️ **R-02 (Inconsistent Error Schema):** Endpoint trả về HTTP 404 có format khác với HTTP 500.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 10. Recommended Next Actions & DECISION REQUIRED
|
|
97
|
+
|
|
98
|
+
> ⛔ **AI ACTION STOPPED HERE — WAITING FOR USER INSTRUCTION**
|
|
99
|
+
> AI **CHƯA THỰC HIỆN BẤT KỲ THAY ĐỔI MÃ NGUỒN HOẶC TẠO PIPELINE NÀO**. Xin vui lòng chọn 1 trong các định hướng sau:
|
|
100
|
+
|
|
101
|
+
- **Option A — Bronze Ingestion Pipeline:**
|
|
102
|
+
Xây dựng pipeline thu thập và sinh file dữ liệu thô `api_responses.ndjson` + `ingestion_manifest.json` sẵn sàng nạp vào hồ dữ liệu.
|
|
103
|
+
- **Option B — Postman Collection Standardization:**
|
|
104
|
+
Chuẩn hóa lại toàn bộ collection: gom nhóm folders theo Resource, gắn response mẫu thật, thiết lập biến môi trường và bổ sung bộ test scripts `pm.test`.
|
|
105
|
+
- **Option C — Formal Data Contract:**
|
|
106
|
+
Sinh file đặc tả hợp đồng dữ liệu `api_schema.json` + `data_dictionary.md` + file contract YAML làm căn cứ kiểm định cho tầng Silver.
|
|
107
|
+
- **Option D — Data Quality & Anomaly Assertions:**
|
|
108
|
+
Thiết lập bộ quy tắc kiểm tra chất lượng dữ liệu (Null checks, Uniqueness, Type assertions) cho các endpoint quan trọng.
|
|
109
|
+
- **Option E — Deep Scenario Execution:**
|
|
110
|
+
Tiếp tục chạy thêm các kịch bản biên (Empty Result, Invalid Params, Unauthorized) để hoàn thiện bức tranh hành vi của API.
|