Commit Graph

187 Commits

Author SHA1 Message Date
phamnazage-jpg
596a2a110c feat(vnext2): add user key self-service skeleton
Some checks are pending
CI / Build & Test (push) Waiting to run
CI / Lint (push) Waiting to run
CI / Security Scan (push) Waiting to run
CI / Docker Build (push) Waiting to run
CI / Release (push) Blocked by required conditions
- PORTAL_KEY_EXPERIENCE.md: review from pending to approved
- KEY_SELF_SERVICE_API.md: review from pending to approved
- 0015_user_keys.sql: migration for key_records table
- user_keys_repo.go + test: SQLite repo (Create/ListByOwner/GetByID/UpdateStatus)
- key_self_service.go: HTTP handlers (POST/GET /api/keys, pause/resume/delete)
- key_self_service_svc.go: action wiring (buildUserKeyHandler)
- registered in ActionSet + NewAPIHandlerWithAuth

Note: full user auth requires host+CRM co-deployment.
Current skeleton accepts Bearer token for testing.
2026-06-05 11:45:17 +08:00
phamnazage-jpg
53edcd86ac docs: update EXECUTION_BOARD + VNEXT_COMPLETION_CHECKLIST for vNext.1 closure
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
- EXECUTION_BOARD: record vNext.1 release gate completion, remote43 binary swap, fresh 3-layer acceptance status
- VNEXT_COMPLETION_CHECKLIST: upgrade to 'conditionally complete (vNext.1)', update all checklists
- add vnext_fresh_acceptance.py: standalone fresh 3-layer acceptance probe script
2026-06-05 11:39:46 +08:00
phamnazage-jpg
492f33a129 feat(vnext): complete vNext.1 release gate — default chain admission, idempotent init, user key skeleton
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
- DEFAULT_CHAIN_ADMISSION.md: reviewed and approved, real artifact refs added
- DEFAULT_DATA_IDEMPOTENT_RELEASE_GATE.md: reviewed and approved
- scripts/setup_default_data.sh: idempotent init with --dry-run/--apply/artifact
- scripts/test/test_default_data.sh: 4 test cases all pass
- scripts/acceptance/verify_user_key_self_service.sh: Phase 0 skeleton
- .gitignore: add generated artifact directories
2026-06-05 11:07:50 +08:00
phamnazage-jpg
77b7f7f660 feat: harden runtime import and frontend verification workflows
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
2026-06-04 20:02:36 +08:00
phamnazage-jpg
7ce72cbc35 docs: sync truth docs, frontend audits, and runbooks 2026-06-04 20:00:03 +08:00
phamnazage-jpg
4b743848bc refactor(portal): merge register + login into single auth entry
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
- Two separate cards (register + login) -> single unified card
- handleRegister + handleLogin -> single handleAuth that tries login first,
  falls back to register if login fails (new user detection)
- Single email/password input, single button, single status display
- Enter key submits on both fields
- File size 57873 -> 51329 chars (-11%)

Test: test_tksea_portal_assets.sh PASS, verify_frontend_smoke.sh PASS,
      verify_quality_gates.sh PASS (gofmt+vet+cov+integration)
2026-06-04 13:52:18 +08:00
phamnazage-jpg
2b5607285f docs(test): add 2026-06-04 testing pitfalls to checklist + fix key confusion in acceptance script
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
Key changes:

1. scripts/acceptance/import_remote43_provider.sh:690/695
   - Fixed  ->  for gateway direct probe
   - Added REDLINE comments explaining why sub_key is correct

2. docs/REAL_HOST_ACCEPTANCE_CHECKLIST.md: §9
   - 4 new pitfalls from 2026-06-04 real testing:
     - Gateway probe key confusion ( vs )
     - Hermes session key redaction (must get raw key from PG)
     - Account upstream key update method (PUT with type+key, not credentials)
     - Hermes redaction destroys shell variables in .sh files

3. docs/SOURCE_OF_TRUTH.md: evidence interpretation
   - Added rule #5: session env keys are redacted, must use PG raw values
2026-06-04 13:45:29 +08:00
Hermes
62b3c657a9 fix(portal): restore missing inputs in providers.html (revert buggy reorder)
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
The reorder_hints.py script incorrectly removed several <input> elements
when moving .hint spans before inputs. This commit restores the file to
the correct state from commit 56474264, preserving all inputs while
keeping the hints in their proper places.

Fixes: admin-username input missing, several other inputs corrupted
2026-06-03 21:02:50 +08:00
Hermes Agent
23fd8db77d refactor(portal): move .hint info-banner ABOVE its <input> + upgrade to teal-accented banner style
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
Two-part UX upgrade:

1. CSS — upgrade .hint from a generic "card with slate background" to a
   proper info-banner:
   - background: var(--color-primary-soft) (translucent teal 12%) instead
     of var(--bg-elev-2) (slate card) — visually distinct from any
     <input> card, so it can never be confused with one
   - border-left: 2px solid var(--color-primary) — clear "this is a hint"
     teal accent
   - padding: 8px 12px 8px 14px (smaller, lighter)
   - font-size: 12.5px (slightly larger for readability)
   - margin: 4px 0 8px 0 (sits between field label and input)
   - .hint code { monospace, teal-300, teal-tinted background } for inline
     <code> tokens
   - .hint strong { text-default color } for emphasis

   Also: label > input/select/textarea forced to display:block width:100%
   margin-top:6px (after the hint, hint + input collapse to margin-top:0)

2. HTML — reorder 11 labels across providers.html (7) and
   admin-batch-import.html (4) so the .hint span sits BEFORE the
   <input>/<select>/<textarea> it describes. Datalist stays adjacent to its
   owning input.

   Pattern before: <label>Field
  <input>
  <span class="hint">desc</span>
</label>
   Pattern after:  <label>Field
  <span class="hint">desc</span>
  <input>
</label>

Why: Linear/Vercel canonical form pattern is label + info banner above +
clean input below. The previous "input then hint" layout was just an
artifact of how the inline-script-dedup pass emitted the fields, not a
deliberate UX choice.

Verification (chrome remote-debugging, 7 pages, all .hint elements):
  Page                                            n_hints  covered
  https://sub.tksea.top/portal/                       2        0
  https://sub.tksea.top/portal/admin/                 0        0
  https://sub.tksea.top/portal/admin/providers.html   8        0
  https://sub.tksea.top/portal/admin/accounts.html    0        0
  https://sub.tksea.top/portal/admin/logical-groups   1        0
  https://sub.tksea.top/portal/admin/route-health     0        0
  https://sub.tksea.top/portal/admin-batch-import     4        0
  Total: 7/7 pages, 0 hint covered by any input

Local tests still PASS:
  - test_tksea_portal_assets.sh
  - verify_frontend_smoke.sh
2026-06-03 20:01:44 +08:00
Hermes Agent
3e158e780b fix(portal): prevent .hint description from being covered by <input>
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
5 .hint spans (ADMIN TOKEN / PACK PATH / PROVIDER ID / SMOKE TEST MODEL /
COMMIT MESSAGE) were being visually overlapped by their sibling <input>
boxes because:
  - .hint was inline, padding 10px 12px with background+border
  - <input> was inline-block
  - label was display:block, font-size 12px
  - the inline .hint box was being squeezed into the same flow line as the
    input, so its last 8-10px were covered

Verified via getBoundingClientRect + elementFromPoint probe before fix:
  hint.top < input.bottom (5 fields) = hint overlapped by input

Fix: force .hint to display:block with margin-top:6px so it always sits
below its input as a separate block; also force label > input/select/textarea
to display:block width:100% so the form field always stretches and never
inlines with the field label text.

Verified after fix: 0 hints overlapped on providers.html (the worst case
with 8 .hint spans).

CSS-only change; no HTML edits. Affects all 8 portal pages. Smoke +
frontend assets tests still PASS.
2026-06-03 16:31:01 +08:00
Hermes Agent
86412192fd docs(weekly): record 2026-05-28~06-03 cross-project learnings + 4 skills
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
7-day window 220 commits across 3 active repos (sub2api-cn-relay-manager 115,
user-system 72, llm-intelligence 33). 4 cross-project patterns extracted into
hermes-global skills:

1. numbered-task-board — M-/H-/B- + T-Data- prefix systems
2. six-stage-pipeline-verify — schema→lib→importer→fixture→real-dry→real-upsert
3. docs-only-commit — code/docs commits never mixed
4. test-coverage-iteration-workflow — per-module 30-100 test funcs

Each skill cites the source commits / files for verifiability.
This sub2api-cn-relay-manager view focuses on what the project contributed.

Docs-only commit (skill #3 in action). No code changes.
2026-06-03 15:56:03 +08:00
Hermes Agent
d6a0261a47 docs(understand-anything): record set-and-forget fallback chain upgrade for enrich
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
§9 of codegraph-integration note now documents the 2026-06-03 15:20 upgrade:
- enrich defaults to callWithFallback() chain (current model → fallback_providers)
- skips codex_responses transport providers automatically
- resolves __default._providerModel to endpoint-served name (not user alias)
- strips <think>...</think> blocks before JSON.parse
- explicit --provider still supported (skip chain, useful for fast mode)

Verified on 5 git repos (contract management / gongju / llm-intelligence /
user-system / supply-intelligence) — 13/13 OK, 0 fallback rotation needed,
all from minimax-m3/MiniMax-M3 (current agent model).

Docs-only commit; sibling subagent's parallel code changes are NOT included.
2026-06-03 15:30:48 +08:00
phamnazage-jpg
77f40c2b69 docs(understand-anything): record 16/16 workspace batch graph refresh (67s, 0 fatal)
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
2026-06-03 14:34:10 +08:00
phamnazage-jpg
c079b8ab66 docs(understand-anything): record 2026-06-03 offline graph refresh + script + skill
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
2026-06-03 14:24:12 +08:00
phamnazage-jpg
d493e97402 docs(codegraph): record 16/16 workspace rollout + wrapper bugfix
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
2026-06-03 13:53:07 +08:00
phamnazage-jpg
047ddca92c docs(portal): record codegraph workspace integration + OMP AGENTS.md refresh
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
2026-06-03 13:29:28 +08:00
Hermes Agent
56474264d6 refactor(portal): dedup inline scripts in accounts + batch-import + providers
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
All three admin pages had two parallel inline <script> blocks (a modern S1
that used adminRuntime + a legacy S2 that was self-contained). Both had
a nested <script> text inside S1 that the browser tolerated only because
the second script re-ran any state-affecting calls. Merge into a single
inline script per page; fix the nested <script> comment.

- providers.html: 100371 -> 62761 chars (-37610, -37%)
- accounts.html:  54878 -> 33098 chars  (-21780, -40%)
- batch-import:   43861 -> 26570 chars  (-17291, -39%)

Also rename draftProviderIDInput -> providerIDInput in providers.html
(the old draft-provider-id input was removed during the earlier workflow
merge, leaving the script with a null addEventListener on draft id).

All scripts pass node --check. Both test_tksea_portal_assets.sh and
verify_frontend_smoke.sh PASS.
2026-06-03 13:14:31 +08:00
phamnazage-jpg
09f7c07de3 feat(portal): make provider/batch-import form fields self-explanatory + auto-fill
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
Problem: provider manifest form had all-empty fields with cryptic
placeholders, users had to know what model IDs to type.

Fix on /portal/admin/providers.html (Provider Manifest 草稿):
- DISPLAY NAME: datalist of common vendors (OpenAI / DeepSeek /
  硅基流动 / Moonshot / 智谱 / Anthropic / 零一万物 / MiniMax / Qwen / Baichuan / 混元)
- PLATFORM: datalist of common platforms (openai / openai-compatible /
  deepseek / anthropic / gemini / zhipu / moonshot / minimax / qwen / ...)
- SMOKE TEST MODEL: datalist of common smoke models + auto-fills with
  first model from MODELS field if user leaves it empty
- BASE URL PLACEHOLDER: datalist of common base URLs (12 presets)
- MODELS: chip-row of 11 common models (gpt-5.4, gpt-5.4-mini,
  deepseek-chat, MiniMax-M2.7-highspeed, kimi-k2.6, glm-4.6,
  claude-sonnet-4-5, gemini-2.5-pro, qwen3-coder-plus, gpt-4o, o4-mini)
  + clear button. Click chip → append to MODELS field (dedup).
- KEYS textarea: 6 rows + example placeholder (sk-example-1/2/3)

Fix on /portal/admin-batch-import.html (发起导入):
- HOST ID: datalist of common host_ids + hint about loading pack first
- ENTRIES textarea: 6 rows + multi-line hint explaining
  base_url|api_key|model1,model2 format, optional model, batch import

JS change: syncDraftHelperState() in providers.html now auto-fills
smoke_test_model with first model if user hasn't filled it yet.
Also fixed: 2 duplicate copies of syncDraftHelperState (from
earlier batch script restoration) — both now have the new logic.

Verification:
- bash scripts/test/test_tksea_portal_assets.sh → PASS
- bash scripts/test/verify_frontend_smoke.sh → PASS
- browser_console click test: gpt-5.4 + deepseek-chat + kimi-k2.6 chips
  → models='gpt-5.4,deepseek-chat,kimi-k2.6' + smoke='gpt-5.4' auto-fill ✓
- screenshot: /tmp/portal-screenshots/admin-providers-v5.png
2026-06-03 11:24:54 +08:00
phamnazage-jpg
122d6282e1 fix(portal): unify all input/select/textarea/label/button/table styles via global fallback
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
Root cause: only admin/index.html had explicit .input / .select / .label classes.
100+ inputs across logical-groups / route-health / accounts / providers /
admin-batch-import + public portal had no class → browser default styling →
页面看起来「未统一」。

Fix:
- portal.css: add global rules that auto-apply design system styling to
  any input/select/textarea/label/button/table that doesn't opt out
  via .raw-input / .field-label. The existing .input / .select /
  .label / .btn classes still win (same styles, just explicit).
- portal.js: detectInitialTheme() now respects HTML's data-theme
  attribute first (page author intent), then localStorage, then OS
  preference. This makes admin pages' explicit data-theme="dark"
  actually stick instead of being overridden.
- admin/index.html: h3 标题 8 个 article 统一用 class="card-title"
  (前 4 个 inline 15px / 后 3 个 inline 16px 已统一)
- 6 admin pages: 修复 critical HTML 结构 bug — 之前 batch 处理的
  残留让 <link> 和 <style> 嵌套在 <style>:root{} 块内,浏览器
  解析时直接忽略,导致所有 stylesheet 不加载、整个页面无样式

Verification:
- bash scripts/test/test_tksea_portal_assets.sh → PASS
- bash scripts/test/verify_frontend_smoke.sh → PASS
- 8 张 screenshot v4 在 /tmp/portal-screenshots/ (各 600KB-1.2MB)
- 浏览器实测:3 stylesheets 加载,103 个 input 全部 38px/12px 圆角输入框
  35 个 label 全部 12px uppercase slate-400
  6 个 select 全部 38px + 自定义箭头
2026-06-03 11:05:10 +08:00
phamnazage-jpg
e804a830a0 docs(portal): record 2026-06-03 frontend visual upgrade + design system runbook
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
- EXECUTION_BOARD.md: new 2026-06-03 entry with full evidence trail
  (asset tests, browser smoke, screenshot list, conclusion=已闭环)
- 2026-06-03-FRONTEND-DESIGN-SYSTEM-RUNBOOK.md (new, 10KB):
  * file structure + design token quick reference
  * standard page skeleton + component API (stat-card, statusbar,
    Portal.icons, Portal.toast, Portal.copyText, Portal.theme,
    Portal.renderModernAdminNav)
  * test-contract string rules (70+ strings must remain in HTML)
  * common pitfalls (duplicate <!doctype>, duplicate const AdminCommon,
    stat-card ID drift, accidental script removal)
  * submission workflow + screenshot evidence commands
2026-06-03 09:11:18 +08:00
phamnazage-jpg
cc8fc900ca refactor(portal): migrate 8 pages to portal.css+portal.js design system
Each page now uses the new page-hero + stat-card + statusbar pattern
with the Linear/Vercel-aligned token system, while preserving all
admin-common.js nav render contract and 70+ test-contract strings.

- public portal: index.html (1816 → 1280 lines)
- admin entry: admin/index.html
- admin pages: logical-groups / route-health / accounts / providers
- batch import: admin/batch-import.html (39-line redirect to
  admin-batch-import.html for legacy URL compatibility)
- admin-batch-import.html: real legacy URL handler page

Verified:
- bash scripts/test/test_tksea_portal_assets.sh → PASS
- bash scripts/test/verify_frontend_smoke.sh → PASS (all 7 admin
  pages + public portal render with smoke-admin / Smoke Logical
  Group / Smoke Provider Account / smoke-route-primary visible)
- 8 screenshot artifacts at /tmp/portal-screenshots/ (1440×2400
  chromium headless, 269KB–1.2MB each = real content)
2026-06-03 09:11:07 +08:00
phamnazage-jpg
3a9061e11d style(portal): add design system + shared layer (portal.css/portal.js/admin-common.css shim)
- portal.css: 777-line real design system (Linear/Vercel 信息建筑派)
  * tokens: spacing 4/8/12/16/24/32/48, type 12/13/14/15/17/20/24/32/44
  * colors: ink/paper/accent/success/warn/danger × 50/100/500/900
  * teal #14b8a6 1:1 aligned with host sub2api Vue/Tailwind
  * dark-first; light override for public portal
  * components: page-hero, stat-card, card, status, pill, btn-primary,
    toast-host, empty, skeleton, drawer, tabs
- portal.js: window.Sub2ApiPortal — toast, lucide 1.75px stroke SVG
  icon registry (shield/group/activity/route/health/account/provider/
  import/check/x/alert/info/copy/edit/trash/plus/refresh/...),
  copyToClipboard, theme auto/dark/light, drawer, renderModernAdminNav
- admin-common.css: 4KB legacy shim — maps old class names
  (.topnav/.primary/.secondary/.ghost/.danger/.metric/.statusbar/.stat/
  .eyebrow/.hero-points/.page-hero__eyebrow/.shell/.fade-in/.topline/
  .chip/.tag/.mono/.meta-card/.meta-label/.status-pill/.inline-code/
  .tone-*) onto new tokens without breaking admin-common.js nav contract

Evidence:
- bash scripts/test/test_tksea_portal_assets.sh → PASS (70+ string assertions)
- bash scripts/test/verify_frontend_smoke.sh → PASS (chromium headless 7 pages)
2026-06-03 09:10:45 +08:00
phamnazage-jpg
35447be934 feat(deploy): add CRM-only online deployment to remote43
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
- scripts/deploy/deploy_crm_only.sh: 单进程部署 sub2api-cn-relay-manager
  CRM 控制面到 remote43,不依赖 sub2api host / PG / Redis 容器。
  复用 scripts/deploy/remote43_patched_stack_lib.sh 的 env 渲染
  (render_remote43_crm_env),render_crm_only_bootstrap 用 $\{VAR\} 占位符 +
  sed 注入避开 set -u + unquoted-heredoc 边缘问题。
  部署前先 kill 老进程 (再 scp 二进制) 避免 ELF overwrite 失败。

- docs/DEPLOYMENT.md: 加 '在线部署节点' 段,记录 stack / 端口 / 入口 / 验证。
- docs/EXECUTION_BOARD.md: 顶部加 'Latest Online Stack' 段。
- artifacts/online-deploy-20260602/: 本次真实部署的证据
  - 01-local-build.txt: 本地 server 二进制 md5 + git head
  - 02-remote-inspect.txt: 远端 process / port / db tables
  - 03-crm-api-checks.txt: /healthz /api/packs /api/hosts /metrics 真实响应
  - 04-portal-public.txt: sub.tksea.top 公共入口
  - 05-quality-gates.txt: gofmt / vet / test -race / integration
  - manifest.json: 结构化汇总

验证(2026-06-02 21:32-21:43):
- /healthz: HTTP 200 'ok'
- /api/packs (Bearer): HTTP 200 '{"packs":[]}'
- /api/hosts (Bearer): HTTP 200 '{"hosts":[]}'
- /api/packs (no auth): HTTP 401
- /metrics (Prometheus): HTTP 200,含 active_hosts/active_providers/
  db_connections_active + Go runtime
- sub.tksea.top/portal/: HTTP 200
- sub.tksea.top/portal-admin-api/healthz: HTTP 200 'ok'(反代到 CRM)
- go test -race ./internal/... ./tests/integration/...: PASS
- gofmt / go vet: 干净
2026-06-02 21:46:39 +08:00
phamnazage-jpg
4ec9dad44f test: 修 build-broken edge-case 测试
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
- internal/store/sqlite/edge_cases_test.go: 把错误的 sqlite.New 调用换成
  实际存在的 sqlite.Open(ctx, dsn),清掉阻塞 `go test ./internal/...`
  的 build 失败
- internal/host/sub2api/edge_cases_test.go: gofmt
- internal/worker/runner_extra_test.go: TestRunnerLoggerCalled 加
  sync.Mutex 保护 logger 写入的共享状态;测试结束前 cancel 并留 20ms
  flush 窗口,避免 -race 检测到 goroutine 仍在写

验证: gofmt -l . 干净,go vet ./... 零警告,
go test -race -count=1 ./internal/... 全包通过,集成测试通过
2026-06-02 20:38:29 +08:00
phamnazage-jpg
f6600d663a feat(monitoring): add complete Prometheus + Grafana monitoring stack
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
Add production-ready monitoring infrastructure:
- 15 alerting rules (4 Critical + 11 Warning)
- Grafana dashboard with service health panels
- Full documentation with deployment guide

Covers: service availability, error rates, latency,
routing health, database connections, and log metrics
2026-06-02 19:54:38 +08:00
phamnazage-jpg
fb32deb2b1 docs: 更新验证报告,记录 metrics 端点修复
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
2026-06-02 07:22:24 +08:00
phamnazage-jpg
5e3bd44e96 fix(metrics): 在主路由中注册 /metrics 端点
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
- 添加 metrics 包导入
- 在主 handler 中注册 GET /metrics 路由
2026-06-02 07:22:01 +08:00
phamnazage-jpg
278991bc9d docs: 添加生产上线全面验证报告
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
2026-06-02 07:17:37 +08:00
phamnazage-jpg
8bbdffaf17 test: 补充真实功能验证测试
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
- ErrorMetrics 并发安全测试
- AsyncLogWriter 错误指标真实记录测试
- HTTP Server 超时配置真实验证
- Prometheus 指标 HTTP 端点真实测试
- 日志文件输出真实写入测试
2026-06-02 07:07:53 +08:00
phamnazage-jpg
28f377f2bd feat(api): M-04 添加版本信息端点
Some checks failed
CI / Build & Test (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Release (push) Has been cancelled
- 添加 /version 端点返回版本信息
- 版本变量支持构建时 ldflags 注入
- 返回 version、commit、build_time、go_version
2026-06-02 07:00:15 +08:00
phamnazage-jpg
133da2d442 test: M-03 添加边界测试
- 添加大量数据边界测试(100条记录)
- 添加特殊字符 PackID 边界测试
- 添加空字段验证边界测试
2026-06-02 06:58:45 +08:00
phamnazage-jpg
b69cb9166e refactor: M-02 添加 errs 包提供错误处理基础设施 2026-06-02 06:57:13 +08:00
phamnazage-jpg
08f7db1bc2 test: M-01 替换测试代码中的 panic 为 t.Fatal
- packs_repo_test.go: panic → t.Fatal
- providers_repo_test.go: panic → t.Fatal
2026-06-02 06:56:30 +08:00
phamnazage-jpg
21065735dd fix(docker): H-05 优化 Dockerfile 环境变量配置
- 添加清晰的注释说明 SUB2API_CRM_ADMIN_TOKEN 为必需配置
- 分离必需和可选环境变量到不同区块
- 更新 Go 版本到 1.23 以匹配 go.mod
2026-06-02 06:55:36 +08:00
phamnazage-jpg
d688722dd2 feat(metrics): H-04 Prometheus 指标暴露
- 创建 internal/metrics 包集成 Prometheus 客户端
- 添加 HTTP 请求指标(总量、延迟直方图)
- 添加业务指标(active_hosts、active_providers)
- 添加路由指标(decisions、failovers)
- 添加数据库指标(connections、operations)
- 添加日志指标(flush_errors、dropped_events)
- 添加 HTTP Middleware 自动收集请求指标
- 添加 StartServer 方法启动独立 metrics 服务
2026-06-02 06:53:24 +08:00
phamnazage-jpg
8984451845 feat(log): H-03 日志 flush 错误监控
- 添加 ErrorMetrics 结构体记录 flush/write/drop 错误数
- 添加 ErrorHandler 回调接口用于自定义错误处理
- 在 AsyncLogWriterOptions 中支持配置错误处理器
- 在 flushBatch 中记录 flush 错误指标并回调错误处理器
- 在 enqueue fallback 路径中记录丢弃事件数
- 添加 Metrics() 方法暴露错误统计
2026-06-02 06:51:14 +08:00
phamnazage-jpg
97502b8a86 test: H-02 补充 migrations 测试
- 验证迁移文件正确嵌入 embed.FS
- 测试所有迁移文件可读且非空
- 验证迁移文件命名规范(NNNN_前缀)
- 测试迁移文件排序一致性
- 验证初始迁移文件包含预期 SQL 内容
2026-06-02 06:50:02 +08:00
phamnazage-jpg
3838d78b00 test: H-01 补充 testutil 测试
- 添加 SQLiteTestDSN 函数测试(外键启用/禁用、特殊字符)
- 添加路径唯一性验证测试
- 添加 OpenSQLiteStore 功能测试(含并发测试)
- 添加 CloseSQLiteStore 测试
- 添加无效 DSN 错误处理测试
2026-06-02 06:49:07 +08:00
phamnazage-jpg
6865b3a33b ci: B-04 添加 GitHub Actions CI/CD 工作流
- 添加完整的 CI 流水线:构建、测试、覆盖率检查
- 集成 golangci-lint 静态代码分析
- 集成 gosec 和 govulncheck 安全扫描
- 添加 Docker 镜像构建验证
- 添加 Release 自动打包(多架构支持)
- 设置覆盖率阈值 60%
2026-06-02 06:47:06 +08:00
phamnazage-jpg
cf7dd35e1d feat(log): B-03 日志轮转配置 - 添加 lumberjack 支持
- 添加 lumberjack.v2 依赖实现日志轮转
- 支持配置文件输出(stdout/stderr/file)
- 支持文件轮转(100MB/3备份/7天/压缩)
- 添加 Config 结构体灵活配置
- 添加完整测试用例

测试验证:
- TestInitWithConfig PASS
- TestInitWithConfigFileOutput PASS
- TestDefaultConfig PASS
- 全量日志测试通过
2026-06-01 22:06:56 +08:00
phamnazage-jpg
714c4acbe4 fix(log): 修复测试文件未使用导入 2026-06-01 22:03:14 +08:00
phamnazage-jpg
91fa5d6ab4 fix(review): 完成系统性 Review 修复方案 - Task B-01 HTTP Server 超时配置
本次提交包含:
- B-01: HTTP Server 添加超时配置 (ReadTimeout/WriteTimeout/IdleTimeout/MaxHeaderBytes)
- 添加结构化日志包 internal/log/ (B-02 部分完成)
- 添加 Review 报告文档
- 添加系统性修复方案文档
- 添加最佳实践审核报告文档
- 更新任务清单和执行板

测试验证:
- TestServerHasTimeoutConfiguration 通过

关联文档:
- docs/2026-06-01-SYSTEMATIC-REVIEW-REPORT.md
- docs/2026-06-01-SYSTEMATIC-REPAIR-PLAN.md
- docs/2026-06-01-BEST-PRACTICE-AUDIT-REPORT.md
2026-06-01 22:02:01 +08:00
phamnazage-jpg
5fbac6ef0b test(frontend): add provider admin acceptance coverage
Add a dedicated acceptance script for providers.html, cover it in the local real-host script regression suite, and document the current frontend review baseline, closure audit, providers action matrix, and remediation task board.

This keeps the frontend acceptance boundary explicit: providers.html now has a repeatable verification entry point for its page-level actions, while non-UI provider operations remain documented as backend-only capabilities.
2026-06-01 09:58:20 +08:00
phamnazage-jpg
c588a95c7d fix(access): verify subscription readiness with real user keys
When subscription access is requested with an explicit access_api_key, assign the subscription to the real target user, bind that user's API key to the subscription group, and probe readiness with the same key instead of falling back to a managed synthetic user.

Update the runtime/reconcile flows, adapter tests, and source-of-truth docs so subscription_ready now reflects user-visible host access rather than managed-key-only closure success.
2026-06-01 09:55:11 +08:00
phamnazage-jpg
702ae19a61 feat(pack): publish provider admin draft provider-admin-publish-1780230107 2026-05-31 20:21:50 +08:00
phamnazage-jpg
fd12838519 docs(testing): record repo upsert closure 2026-05-30 18:54:07 +08:00
phamnazage-jpg
64e14ac30d test(quality): cover repo upsert fallback branches 2026-05-30 18:54:07 +08:00
phamnazage-jpg
2f2653c76f docs(testing): record upsert and open branch follow-up 2026-05-30 18:48:20 +08:00
phamnazage-jpg
9e32a24f8c test(quality): cover upsert validation and redis open branches 2026-05-30 18:48:20 +08:00
phamnazage-jpg
d9216d5712 docs(testing): record narrow branch coverage follow-up 2026-05-30 18:28:03 +08:00