| Files | Last commit | Last update |
|---|---|---|
fix(paths): drop duplicate src/api/routes/im.py (use domains/runtime/routes/im); restore deleted diag script | 11 days ago | |
feat(#3588): SQLite WAL/SHM stale detection and self-healing reconnect In overlayfs containers the WAL/SHM sidecar files can be replaced delete-then-recreate by copy-up; long-lived connections keep fds to the deleted inode, every statement then fails with disk I/O error and the API stays 500 until restart. This ports the issue #3588 self-healing loop (merged to local-liufei as PR !1883) onto the arch-weekly-11 layout: - src/kernel/db_health.py (new): stale predicates (exception-driven disk I/O error / malformed / unable-to-open, plus a lightweight periodic WAL/SHM inode snapshot check), a SelfHealingSQLiteDB connection proxy (stale -> close old -> rebuild via factory with PRAGMA replay -> replay the statement once for reads), and a db_health() aggregate signal (db_status / wal_valid / reconnects) exposed via /healthz. - session_manager: the SQLite main connection goes through the proxy; new DEVOPS_DB_JOURNAL_MODE deployment option (default wal unchanged). - IM outbox / bulk_read / engine_wiring short connections are wrapped as well; the outbox consumer gains a capped backoff on consecutive failures; migration scripts detect SQLite through db_health. - transaction protection: rebuilding inside an open transaction raises instead of silently losing writes; write statements are never replayed. Review round 1 remediation: - F3 (Medium): a brand-new database no longer reports wal_valid=False and reconnects=1 on its first write. Snapshots taken while the WAL/SHM files do not exist yet are treated as unknown (not stale), the baseline is absorbed on the first successful statement (one-shot), and _reconnects only counts real rebuilds - the constructor no longer increments it. Verified end to end: fresh DB -> ok/True/0, WAL inode replacement -> reconnects=1 with a full read/write cycle. - F1 (A13): the self-healing signals are now exported as Prometheus metrics - grape_db_reconnects_total{db} and grape_db_wal_valid{db} (file-name label, not the deploy path), registered through the same idempotent install() as the existing kernel metrics and a no-op until the metrics server installs the registry. Verified via a live registry scrape after a forced WAL replacement. - F5: the regenerated help.html artifact is dropped from this PR. - F6: imports moved to the per-line style used in the rest of the tree. The three numeric defaults (check TTL 5s, backoff steps 1x/2x/4x, short read attempts 2) are registered as pending-decision items until production measurements exist; the env/args to tune them are all in place and their behavior is covered by tests. (Closes #3588) | 4 hours ago | |
feat(sync): land arch11-weekly-1102-zrr rework for four-process topology takeover Squash-lands the branch-side changes of arch11-weekly-1102-zrr (previously spread over commits 54b01c01/584ebd45/75e40561/9246a31d/1039ded3/6d0de4da/ 2f1f9bde/d55a704d/1b1854ff and several merge commits) into a single English Conventional Commits landing, per compliance review (Issue #3913 items 2-1/2-2). Content is unchanged from the reviewed PR head 2d0918bc9: - #3834 takeover cascade chain: backfill the takeover conclusion and keep the A2A chain alive; failed-terminal symmetry, original attribution fields, next-dispatchable validation, backfilled observability, plus real-HTTP link test cases - #3621 trigger_pipeline switch on issue create, with the pending-issue first-trigger path (stage=created -> vod via atomic CAS claim) and 409/400 idempotency guards - #3620 tko_ takeover token on git-credential with strict repo-scope check and takeover-session liveness revalidation - skills contract fixes: restore _validate_repo_param and document the repo owner/repo contract params - pending-issue trigger path no longer holds db_lock inside async code (sync critical section + asyncio.to_thread) - A2A dispatch by service mapping, v2 claim Request passthrough, and ratchet/snapshot refresh; takeover dispatch real-HTTP test updates - #3874 worker onboard review gaps: docs, CI gate, wheel platform coverage, pyyaml/model-gate resilience - 3-db cold-start bootstrap path (scripts/bootstrap_3db.py) and the deploy/README.md four-process wiring section - docs: grape-kit raw install URL fallback, openapi snapshot and i18n ratchet refresh, cross-domain read baseline refreshes | 6 hours ago | |
bugfix and promote response Co-authored-by: songspace<songspace@grape.dev> Co-authored-by: lvjuntao<jentle_81@163.com> | 8 days ago | |
fix(qa): close the QC findings from PR #1244 review Addresses the 2 BLOCKED + 4 Critical + 3 Medium guard findings and the atomic report's C05-C10 (C08 was already fixed in cb551583b). BLK-1 / S112: scripts/release_pack.py derived its worker closure from an 11-entry literal that had drifted from src/kernel/worker_package.MANIFEST; it now calls tools_manifest_files() (MANIFEST-derived, repo root on sys.path) and the pack loop handles directory entries, so the release tarball can no longer miss src/domains/runtime/vcs/. MANIFEST additionally pins that directory. tests/runtime/test_s112_worker_pkg_closure.py: 7 passed. BLK-2 / C05: engine_wiring._MIGRATION_PATH resolved to src/domains/scripts/migrations/001_channel_tables.py (nonexistent) because the module moved deeper after the canonical restructure; new _repo_root() walks up to the directory holding scripts/migrations. Verified: the path now exists. CR-1 / C06: scripts/migrations/003_channel_table_prefix.py and scripts/smoke/im_channel_mysql_smoke.py still imported src.im.* / src.runtime.*; all six imports now point at src.domains.runtime.*. CR-2 / CR-3: windows-smoke.yml lost three regression gates in the merge - AtomCode engine tests, Issue #1750 recover-orphans whitelist and the reregister/client contract nodes; all restored, and the stale tests/atomic and tests/im paths now point at tests/api and tests/runtime/im. Makefile DOMAINS drops the removed atomic entry. CR-4: the three conflicted frontend files (index.html, pages/dashboard.js, pages/issues.js) were re-merged three-way against merge-base b439764f instead of taking one side, so base's XSS escaping (window.escHtml) and its newer cache version numbers survive alongside this line's board-cursor work; every ?v= token and __I18N_CACHE_VER__ is at least base's value. C07: tests/runtime/im/test_card_ir.py pointed at src/im/* and patched src.user.db; both canonicalised, and the three dead platform-card dict literals (_BIND_SUCCESS_CARD_TPL x2, _NO_REPO_CARD) left in the business layer are gone - the live path already builds channel-neutral Card IR. 49 passed. C09: migrations 202611080001 / 202611090001 / 202611090002 / 202611100001 were renumbered into this line's own block 202611120001-0004 (uuid-pk moved to 202611120005); test_migration_no_baseline_version_collision passes. C10 / MED-2 / MED-3: check-arch WHITELIST dropped the stale mysql_compat R1 and aishell_acp/event_pipeline R6 entries (targets no longer imported), R5 now prints intra-package cycles instead of silently skipping them, and grape_constraint_check's mandatory MANIFEST surface covers src/kernel/, src/domains/ and src/domains/runtime/vcs/. Whitelist precision: 3 passed. Also fixed an R6 violation the merge introduced (direct_executor importing src.session_manager). Verified: check-arch RESULT PASS (R1-R7), make lint import OK, tests/arch 22 passed, tests/kernel 594 passed / 54 failed, tests/api 429 passed / 54 failed. | 11 days ago | |
fix(token): stop backfilling bot-level tokens into agent session rows (echo loop) Root cause: repo binding / agent config save / scene apply all resolved the full token chain and wrote the resolved value (often level-2 bot token) into devops_agent_session.repo_gitcode_token. Level-1 (session) then always hit the bot token, and the self-loop guard treated the bot actor as a legit user -> bot comments triggered pipelines -> echo loop. Changes: - upsert_agent_session: repo_gitcode_token now None = keep existing value (aligned with enable/subscribe_events/im_* convention). INSERT falls back to empty string. No caller can clobber a user-configured session token with a lower-level value anymore. - ensure_default_agent_sessions: drop the resolve_config_level token read entirely; binding means the session row must stay token-empty. - agents.py update_agent_config: AgentConfig has no token field, so the read_stored_token value was always a lower-level backfill; both upsert call sites now pass None. - scenes.py apply_scene: same treatment, drop get_repo_token_with_refresh. Also removes now-dead github-token side write in ensure_default. SessionTokenHandler.is_self_loop_actor consumer-side guard is intentionally kept as defense-in-depth. scripts/sql/clean_session_bot_token_20261023.sql: one-shot cleanup for existing polluted rows (value == global/repo bot token), with backup table. | 1 month ago | |
chore: #699 unify skills dir to .grape/skills/ [Coding Agent] Issue #699 Phase 0 Step 6: - Change SKILLS_DIR in src/config.py from 'skills' to '.grape/skills' - Update scripts/sync_skills.sh: sync target $ROOT_DIR/skills/ -> $ROOT_DIR/.grape/skills/ - Update scripts/adapt_skills_vcs.sh: SKILLS_DIR path -> .grape/skills - Move .opencode/skills/grape-dev-workflow/SKILL.md -> .grape/skills/dev-workflow/SKILL.md - Update .gitignore: .grape/ -> .grape/* with !.grape/skills/ and !.grape/docs/ exceptions; remove !.opencode/ and !.opencode/skills/ (no tracked files remain there) - Update scripts/release_pack.py: pack_skills archive path skills/ -> .grape/skills/, scenes/ -> configs/scenes/; update INSTALL.md deploy instructions - Move runtime skills/custom/ to .grape/skills/custom/ | 20 days ago | |
refactor: #699 extract src/kernel/ (18 shared modules, auth_sdk, db_migrations) with re-export shims | 20 days ago | |
fix: #582 anchor only path-type env keys in atom_selfcheck run_case | 21 days ago | |
fix(credentials): expose broken creds, stop hiding repo lists (#3200) Credential rows whose ciphertext cannot be decrypted (written by a process that used another JWT_SECRET, or an OAuth row with a retired kid) were silently folded into "not configured". Users saw an empty project list, a "you bound the wrong channel" hint or a bare 502, while the credential rows and repo caches were all still in place. - read path: _load_credential_json reports decrypt_failed or parse_failed through an optional diagnostics dict, and the credential readers can expose that broken state on request (include_unreadable / diagnostics); defaults are unchanged. - platform links: keep "declared" and "token usable" as separate dimensions instead of collapsing both into one boolean, and classify an undecryptable OAuth token as decrypt_failed instead of "token expired" (the identity scan reports the reason per provider). - fail-safe: pruning is a destructive write, so it now runs only when every source is known. get_user_identities and list_platform_links grew a strict flag (default off, so the other callers are untouched) and the identity scan passes it down, so a swallowed read can no longer reach the prune as an empty set. A failed scan skips the round and logs instead of revoking the user's platform links in bulk. - /repos/member: broken platforms never contribute repo rows (cached rows included) and every 200 carries hint plus _credential_broken, so a platform cannot disappear silently. The notice ignores platforms disabled on this instance. ?provider= answers 400 CREDENTIAL_UNAVAILABLE with the real reason. - /repos/sync: sync only usable platforms and report the broken ones with the same hint, instead of turning the whole refresh into a 502. - transfer-bind: a transfer without a platform token stores status=4 (bound, needs re-auth) instead of an unusable status=1 binding, and the frontend guides the user through one more authorization. - settings: PAT existence reads the credential domain only, and the new platform_auth block reports token_source / oauth_bound / pat_broken. The legacy api_token_exists / token_exists keys (gitcode, github) now mean "PAT in the credential domain only" as well; the semantic change is registered in the endpoint docstring for out-of-tree consumers. - frontend: four-state credential badge (a usable OAuth wins over a broken PAT, which stays in the row detail line), project page credential banner with a fix link, and re-auth guidance after a transfer. Colors use the shared theme tokens (var(--y) / var(--a) through color-mix) instead of fixed hex, so the dark theme matches. Comments were reworded so the Chinese-literal ratchet stays frozen. - contract: the 400 answers of /api/repos/member (explicit ?provider=) and /api/repos/sync are now recorded in help/api/openapi-baseline.json and the served openapi.json; the pre-existing baseline drift (4 missing paths, duplicate route) is unchanged by this commit. - tests: the new visibility suite covers the swallowed-read prune case, the degraded PAT scan, the undecryptable OAuth token, mixed usable/broken providers for member and sync, the credentials endpoint (OAuth-only is not a PAT; a broken PAT reports broken), and a transfer that carries a token (status=1 with an expiry). The d109 dangling-link scenario creates the identity and credential tables it depends on, and the empty-repos fixture follows the real save_user_repos(providers=) signature. Locale files changed, so the shell i18n cache version was bumped (index.html 63 -> 64) and the locale ratchet fingerprint was synced, otherwise old clients would keep the stale language packs. - scripts: read-only audit of undecryptable credentials. Closes #3200 Signed-off-by: yang-aiwu-new <yang-aiwu-new@noreply.git.com> | 5 days ago | |
merge: sync arch-weekly-11 (AtomCode engine, vcs decoupling, a2a guard, qa gate) into weekly-11 merge branch | 11 days ago | |
refactor: #699 extract src/kernel/ (18 shared modules, auth_sdk, db_migrations) with re-export shims | 20 days ago | |
merge: sync arch-weekly-11 (AtomCode engine, vcs decoupling, a2a guard, qa gate) into weekly-11 merge branch | 11 days ago | |
refactor: #699 reorganize src/ into domains (mgmt/runtime/insight/contracts) with re-export shims | 20 days ago | |
chore(branch): consolidate arch-weekly-11-zj into a single commit (Closes #2764) Squash the 53-commit arch-weekly-11-zj line (with its base merges) into one commit, then rebase onto the tip of arch-weekly-11. Full history is preserved in backup branch backup/arch-weekly-11-zj-20261118-1253 on And-ZJ2/grape. Net changes carried by this commit: - #2395 runtime env contract: unify runtime env injection contract across engines and address review feedback on contract keys. - #2292 branch guard: canonical lock import and worker smoke guard, wire branch guard canonical lock regression into smoke workflow, optional QA items (canonical otel, temporary --no-verify hint). - #2245 read-only gitdir: make coding worktree git metadata writable with read-only fallback, tighten worktree add gate, probe common write, preserve HEAD on relocate; review-fix coverage wired into CI gate. - #2314: treat stale lease as fast-forward in branch guard. - #827: preserve user_id on assignee change and record created_by, widen mine filter to user_id OR created_by OR assignee, created_by fallback in backfill script, regression tests relocated to runtime domain. - #2227 grape CLI capability drift guard: detect CLI capability drift, wire drift guard into checks and worker install, document version requirement and fallback verification. - #2281: recover unpushed worktree commits and add push retry channel. - #2225 issue/PR write guard: guard issue and PR writes against cross-issue content, isolate per-session staging tmpdir and sweep opencode residuals, read-only guard lookup, tmpdir fallback tiers, wire guard into issue/pr comment creates and issue create, release guard anchor skips quoted lines, gate sqlite read fast-path by db backend, confine sweeper deletions, openapi baseline sync. - #2706 branch lease: converge lease lock import into _lock_module() and fail open when lock module is unavailable, guard import smoke and lease fallback regression wired into linux-backend gate, worker package ships lock and guard modules, repogit probe/relocate bare except replaced with logged warnings, tests moved under tests/runtime, cross-domain read inventory baseline bump files_scanned 467 -> 469. - #2514 workspace binding + arch-guard round-9 BLOCKED findings F1/F2 closure. Verification: single-commit squash equals the 237b5738 tree at the old merge-base (reset --soft, tree unchanged); post-rebase tree re-validated against a trial merge of the same two tips. Rebase conflict resolution (branch_guard.py, single conflict file): - Union of base 2028-05 evolution (stdin fail-open, --no-verify hint, hook_main/_hook_main refactor with issue aggregation) and the zj-side #2292 HOOK_REPAIR_HINT guidance; HOOK_TEMPLATE_VERSION bumped to "2028-06" and registered in test_issue_2933 frozen assertion. - #2314 lease semantics (local_sha fast-forward, reconcile_pending, _initial_expected, refresh_expected, record_pending_push) verified present in the rebased _hook_main. Verification: squash tree == 237b5738 tree (identical tree hash cb9060ef4); three-point diff vs base shows only the deliberate union deltas; trial merge of the same tips hits the same single conflict file; tests: branch_guard suites 2292/2314/2933 = 57 passed, domain suites 2225/2227/2245/2395/2706/827 = 109 passed (env -u PYTHONPATH, repo venv). | 5 days ago | |
refactor: #699 extract src/kernel/ (18 shared modules, auth_sdk, db_migrations) with re-export shims | 20 days ago | |
feat(arch-weekly-11): card-driven credentials, login whitelist row format, admin dual menus and platformization completion Rebased onto arch-weekly-11 tip 749ee21e1 with full zero-loss reconciliation: - baseline wins on conflicts; all 94 baseline-added lines verified landed, all 251 ours-added lines verified retained (2 stale comment lines replaced by baseline engine_host adoption) - migration version collisions 202611150001/2 vs baseline seed migrations renumbered to 202611150005/6 (idempotent per G4 convention); baseline seed migrations inherited same-number-same-name; collision guard baseline list refreshed to arch-weekly-11 tip 749ee21e1 - local_engine_device_name uses engine_host() per the stable-identity contract (GRAPE_HOSTNAME first); single-source device-mount semantics kept - guard tests isolated-run green: collision guard 2, admin card 7, s40 ui 11, whitelist ratchet 4, admin user crud 20, login whitelist row 12, auth routes 18, agent-type/event-filter seed 9, host identity 6, worker deps 3, sync_domain_views 13, tests/arch 25, check-arch PASS, destructive-ddl PASS Signed-off-by: yang-aiwu-new <yang-aiwu-new@noreply.git.com> | 10 days ago | |
refactor: #699 reorganize src/ into domains (mgmt/runtime/insight/contracts) with re-export shims | 20 days ago | |
fix(gsb): #2479 cache routed service handles per process with A/B bench data (review R2) | 9 days ago | |
fix(scripts): harden bootstrap_3db env path, secret masking and DSN parsing - default env file moves from /root/.grape-3db.env to ~/.grape-3db.env (doc, argparse default and deploy/README.md example), so the cold-start path no longer assumes a root deployment - the child-process log is now written with DSN/password masked and 0600 permissions: tracebacks could otherwise leave DB credentials in a world-readable /tmp file - DSN parsing now reuses the kernel single source (src/kernel/db_registry.py::parse_dsn) instead of a local copy | 6 hours ago | |
grape kit adapter & plugin market Co-authored-by: zrr<zrr@local> Co-authored-by: grape_bot<grape_bot@noreply.git.com> Co-authored-by: my_grape_bot<my_grape_bot@noreply.git.com> Co-authored-by: zrr000212<zrr000212@noreply.gitcode.com> | 3 days ago | |
grape kit adapter & plugin market Co-authored-by: zrr<zrr@local> Co-authored-by: grape_bot<grape_bot@noreply.git.com> Co-authored-by: my_grape_bot<my_grape_bot@noreply.git.com> Co-authored-by: zrr000212<zrr000212@noreply.gitcode.com> | 3 days ago | |
chore(arch): drop the kernel R1 whitelist now that the debt is paid off All 132 kernel -> src.domains imports are gone (inverted onto kernel ports), so the whitelist entries that exempted them no longer protect anything — they only hide future regressions. Removes 18 R1 rules and the 10 entries that became empty, keeping the R2 (api) and R8 (table write) rules that are still in effect. Also corrects the header, which claimed R1/R2/R4 exclude deferred in-function imports. They never did: the R1 loop iterates imports_of() all_imports, which includes function-body imports. That stale comment is why 132 defer-imports were repeatedly described as sitting outside the checker's view — they were inside it, merely exempted. Verified by injecting a deferred from src.domains.mgmt.user.db import ... into src/kernel/repo.py: R1 reports it and check-arch exits FAIL; after restoring, PASS. whitelist entries 38 -> 21. | 4 days ago | |
fix(qa): bump the locale cache versions and make both ratchets monotonic Guard re-review at head bc544236 raised C-1 (locale pack cacheVer stale) and R-1 (the restored ratchet only enforces cross-page equality, so a coordinated downgrade still passes), plus five nits. - shell pages: locale pack cacheVer bumped where the pack content changed (index 42->43, admin 20261016-8->20261113-1, register/forgot 34->35). Base arch-weekly-11 itself ships '42', so this is a content bump, not a revert fix. - new tests/api/test_i18n_locale_cache_ratchet.py binds the pack content to the cache key: the locales fingerprint must be re-recorded whenever content changes, every page's cacheVer must equal the recorded value and never fall below the arch-weekly-11 floor, and shell/js/i18n.js's own date-typed ?v= gets the same lower-bound check (it was previously checked by nothing). - tests/api/test_frontend_cache_version_ratchet.py now covers all four shell pages (index/admin/register/forgot), freezes app.css/auth.css, rejects two versions of one module inside a page, and asserts register/forgot stay in sync — exact equality keeps versions monotonic for the numeric modules. - scripts/check-shared-versions.sh: drops the single-consumer app.js entry and reads every reference per page instead of the first match, so intra-page splits fail loudly. - scripts/release_pack.py: also asserts every /static-vue/** asset referenced by shell/index.html exists in static-dist, so a stale build cannot pack silently. - Makefile: new test-js target — tests/js/** finally has an execution entry. - tests/runtime/test_port_p2_acceptance.py: the #1961 frontend check was still reading the deleted src/api/static and failing; repointed at frontend/shell and made it assert the mechanism rather than version literals. - scripts/check-css-vars.py: trailing newline. Verified: check-all.sh exit 0; make test-js 94 files rc=0; 15 pytest cases pass; five mutation shapes (coordinated i18n.js downgrade, coordinated app.css downgrade, intra-page split, cacheVer rollback, locale content change without a bump) each turn the guards red. | 10 days ago | |
chore(merge): sync arch-weekly-11 tip (d2787875) into the Vue line Brings in the two commits arch-weekly-11 landed after the last sync: the issues clarification import/URL fix (a09e794d) and the credential rebuild + PAT-only repository visibility hardening (d2787875). Conflict resolutions (structure ours, backend theirs): - shell/index.html keeps the Vue chunk list. The legacy /static/js/pages/*.js tags stay out; the only module the other side still lists that we do not have is that removed page set. - shell/js/app.js keeps the Vue shell and restores _hasVcsBinding() (D102-C), wiring it at the three routing decision points instead of the bare bindings.length check. The platform-card catalog loader it reads stays out with the retired pages, so the helper currently degrades to "bindings non-empty" - same behaviour as before, but the semantics match arch-weekly-11 so the next sync does not lose it. - The repository lobby platform bar moves to ReposView.vue: the tab set is derived from the repo_key prefixes actually present, with identity bindings as the fallback for an empty list, and the filter matches the selected platform prefix exactly (bare key counts as gitcode). This is the d2787875 fix for PAT-only platforms disappearing behind pagination. src/api/static/js/pages/repos.js stays deleted. Also fixed while closing the gates: - scripts/check-destructive-ddl.py classified lines inside a docstring as code whenever a hunk started mid-docstring (the triple-quote parity state has no opening line in that hunk), so a sentence in db_setup.py that mentions RENAME TO was reported as an unclosed destructive DDL. Added-lines now carry file and line numbers, strings and comments are masked with tokenize, and the paren-depth state resets at hunk bounds. - The two SQLite rebuild helpers ran their RENAME through a bare c.execute; both now go through _destructive_ddl(c, ..., kind_hint ="cleanup") like every other table-level swap. Versions: app.js 261 -> 262, repos-view.js 52 -> 53, both registered in the FROZEN map. Verified on this tree: check-all.sh exit 0 (ratchets, i18n keys, css vars, secrets, DDL, OpenAPI, node suite), make test-js 96 files green, pytest ratchets + platform-helper-imports + pat-identity-boundary 18 passed, and the merge regression list (14 items from the previous review round) green. | 10 days ago | |
fix(qa): view-supply reproducibility for 13 sandbox tables; devbox EIP placeholder + guard rule Three small remediations from the round-6 compliance reports: - sync_domain_views.py DEFAULT_SYNC_TABLES + 13 sandbox control-plane tables. Reproducibility gap proven live on the 8070 three-db instance: mgmt-side views for these tables existed only as hand-run CREATE VIEW statements (built during session hotfixing), so any fresh install or redeploy would re-hit the 1146 chain (_build_cred_map -> provider_id empty -> sandbox credential detail button never renders; takeover sessions 500). Admission keeps the established pattern: the code-side default set carries table names only (no real db names in-tree); per-instance view-allowlist files stay local per the chore(oss) redaction ruling (view-allowlist.txt deliberately untracked since 3ce512d72). Can be re-derived from the ownership canon once G-21 is adjudicated. - devbox_dns.py docstring example EIP 110.41.x.x -> RFC5737 doc reserved 203.0.113.10 (compliance round-6 manual-review item). - check-doc-redaction.py: new EIP rule for the 110.41.0.0/16 devbox gateway segment so the docstring class of leak is no longer missed (the old rules only covered 121.36.33.* / 124.70.*). Verification (env -u PYTHONPATH aw11 venv): - py_compile all three files; check-doc-redaction --diff base: 0 hits on the new rule (the old example is now a reserved address); the 57 pre-existing hits are the G-03 backlog fixture/policy-CIDR set, double-tree-verified earlier as non-assets, unchanged by this diff. - tests/arch/ 35 passed. | 6 days ago | |
fix(issue-348): admin i18n + CSS tokens + health panel + OAuth whitelist + user CRUD + security hardening Resolves #348 (merges #332). Part A — Admin i18n + CSS Tokens + Bot Token Health Panel: - Extract tokens.css shared variable layer from app.css :root + apple-theme.css - i18n.js MODULES adds 'admin', _INLINE_PACKS adds admin critical strings - New zh/en admin.json locale packs (208 keys each, full parity) - admin.html: all Chinese → data-i18n, CSS hardcoded → var(--xxx, fallback) - Apple theme detection + first-paint flash prevention - Health panel: consume nested {overall, platforms, checked_at} structure - Per-platform rendering via Object.keys(platforms) iteration - esc() XSS fix: add double-quote escaping - Config page placeholder re-render on language switch (cached data, no API call) - Nav highlight in showCfg() to match showUsers/showWhitelist pattern - showWhitelist ev.target.closest('a') fix for span-inside-a case - 4 contract check scripts + check-all.sh + smoke-admin.sh - contracts/health.schema.json JSON Schema Part B — OAuth Login Whitelist + User CRUD (#332): - GET/POST/DELETE /api/admin/whitelist + PUT /api/admin/whitelist/toggle - POST /api/admin/users + PUT /api/admin/users/{id} + POST /users/{id}/reset-password - login_whitelist DDL: github_username UNIQUE partial index - Frontend: OAuth whitelist UI + create/edit/reset-password user modal - editUser uses cached page data (no redundant API call) - list_grape_users SELECT includes nickname Part C — Security Hardening: - Admin login brute-force protection (login_throttle, account + IP dimension) - Admin password SHA-256 → bcrypt migration with transparent upgrade - Password strength check (3 paths: change/create/reset) - Audit logs for all write endpoints (14 event types, including pre-existing change-password and PUT /config brought to parity) - All API error/success messages unified to English (45 messages) - Error code + frontend i18n mapping: backend returns error_code field, frontend errMsg() maps to admin.error.* locale keys, raw message → console only - .gitignore: configs/db-backend.json.* wildcard (credential leak prevention) - Case-insensitive queries: 8 WHERE username=? → LOWER(username)=LOWER(?) - DB layer case-insensitive unique indexes (SQLite expr index + MySQL generated column) - Forward-compat migration: _migrate_allow_signup_default (preserve baseline on upgrade) - invalidate_login_whitelist_cache() for immediate toggle effect - Health status flip notification (log.warning/log.info) - Dead code cleanup: _hash_password SHA-256, duplicate esc(), /whitelist-status endpoint Part D — allow_signup value consistency fix (regression from round 1/2 audit): - _migrate_allow_signup_default: write "1" instead of "true" (align with toggle endpoint) - read_public_config(): normalize via _is_allow_signup() → always return "1"/"0" (handles "true"/"1"/"yes"/"" in meta table uniformly) - Add TestAllowSignupValueConsistency (4 cases: true/1/yes/empty → 1/1/1/0) Signed-off-by: Hermes Agent <hermes@nousresearch.com> Signed-off-by: grape <grape@local> | 1 month ago | |
chore(merge): sync arch-weekly-11 into the Vue line (structure ours, features theirs) 248 incoming commits, 128 conflicted paths, resolved as: the deleted src/api/static tree stays deleted (24 files), their new shell assets (slack/telegram/wechat svg, host-status.js, oauth-buttons.js) land in frontend/shell, locales deep-merged, index.html keeps the /static-vue wiring plus their two new scripts, and the backend/script conflicts take our paths with their new options. Their tests/api/js tree tested the removed legacy pages, so it is dropped; our 88 Vue-era tests are restored and Issue #1740 is ported to IssuesView.vue source assertions (6/6 green). Known gap: the token-deeplink helper in their account.js has no Vue counterpart, its test is not carried over. | 10 days ago | |
grape kit adapter & plugin market Co-authored-by: zrr<zrr@local> Co-authored-by: grape_bot<grape_bot@noreply.git.com> Co-authored-by: my_grape_bot<my_grape_bot@noreply.git.com> Co-authored-by: zrr000212<zrr000212@noreply.gitcode.com> | 3 days ago | |
fix(security): stop hardcoding OBS AK/SK in scripts + repo-wide secrets guard Audit finding (2026-10-21): the release-bucket Access Key / Secret Key were hardcoded in plaintext inside scripts/release_pack.py and scripts/release_admin_pack.py, and the dev-bucket pair in scripts/verify_obs_storage.py / verify_obs_skill_e2e.py. The files are tracked in the open-source branch (weekly-07-clean) and shipped inside every release package uploaded to OBS -- i.e. the credentials were effectively published, and no guard existed to catch it (check-doc-redaction.py only scans docs/** and has no key patterns; the QA compliance bot only reviews PR deltas and these files predate them). Changes: 1. scripts/obs_credentials.py (new): single place that resolves credentials at runtime -- environment first (OBS_RELEASE_AK/SK for the release bucket, OBS_ACCESS_KEY/OBS_SECRET_KEY for the runtime bucket), then a non-repo config (/etc/grape/release-obs.json, /etc/grape/grape.env). If nothing is found it raises with instructions: no silent fallback, no placeholder values, and never 'upload anyway'. 2. release_pack.py / release_admin_pack.py: build the obsutil argv from the resolved credentials; abort with a clear message when they are missing. 3. verify_obs_storage.py / verify_obs_skill_e2e.py: inject the runtime OBS config instead of literal keys. 4. scripts/check-secrets.py (new): repo-wide plaintext-key scanner (Huawei AK/SK, AWS AK/SK, GitHub tokens, private-key blocks, explicit key assignments). Scans git-tracked files by default, masks matched values in its output, supports an inline 'secrets-check: allow' escape hatch. 5. check-all.sh: run the docs-redaction and secrets checks together. Verified: - scripts/check-secrets.py -> OK on all 1419 tracked files (0 hits) - resolved credentials work against the real bucket (obsutil ls, read-only) - missing credentials produce an explicit error instead of a silent upload Note: the two exposed pairs must still be rotated/revoked at the console (purging them from git history of a public branch is a separate decision). Credentials now live outside the repo: /etc/grape/release-obs.json (0600). Signed-off-by: liufei_cloud <gcw_3FZApeLT@noreply.gitcode.com> | 1 month ago | |
fix(qa): bump the locale cache versions and make both ratchets monotonic Guard re-review at head bc544236 raised C-1 (locale pack cacheVer stale) and R-1 (the restored ratchet only enforces cross-page equality, so a coordinated downgrade still passes), plus five nits. - shell pages: locale pack cacheVer bumped where the pack content changed (index 42->43, admin 20261016-8->20261113-1, register/forgot 34->35). Base arch-weekly-11 itself ships '42', so this is a content bump, not a revert fix. - new tests/api/test_i18n_locale_cache_ratchet.py binds the pack content to the cache key: the locales fingerprint must be re-recorded whenever content changes, every page's cacheVer must equal the recorded value and never fall below the arch-weekly-11 floor, and shell/js/i18n.js's own date-typed ?v= gets the same lower-bound check (it was previously checked by nothing). - tests/api/test_frontend_cache_version_ratchet.py now covers all four shell pages (index/admin/register/forgot), freezes app.css/auth.css, rejects two versions of one module inside a page, and asserts register/forgot stay in sync — exact equality keeps versions monotonic for the numeric modules. - scripts/check-shared-versions.sh: drops the single-consumer app.js entry and reads every reference per page instead of the first match, so intra-page splits fail loudly. - scripts/release_pack.py: also asserts every /static-vue/** asset referenced by shell/index.html exists in static-dist, so a stale build cannot pack silently. - Makefile: new test-js target — tests/js/** finally has an execution entry. - tests/runtime/test_port_p2_acceptance.py: the #1961 frontend check was still reading the deleted src/api/static and failing; repointed at frontend/shell and made it assert the mechanism rather than version literals. - scripts/check-css-vars.py: trailing newline. Verified: check-all.sh exit 0; make test-js 94 files rc=0; 15 pytest cases pass; five mutation shapes (coordinated i18n.js downgrade, coordinated app.css downgrade, intra-page split, cacheVer rollback, locale content change without a bump) each turn the guards red. | 10 days ago | |
grape kit adapter & plugin market Co-authored-by: zrr<zrr@local> Co-authored-by: grape_bot<grape_bot@noreply.git.com> Co-authored-by: my_grape_bot<my_grape_bot@noreply.git.com> Co-authored-by: zrr000212<zrr000212@noreply.gitcode.com> | 3 days ago | |
chore(branch): consolidate arch-weekly-11-zj into a single commit (Closes #2764) Squash the 53-commit arch-weekly-11-zj line (with its base merges) into one commit, then rebase onto the tip of arch-weekly-11. Full history is preserved in backup branch backup/arch-weekly-11-zj-20261118-1253 on And-ZJ2/grape. Net changes carried by this commit: - #2395 runtime env contract: unify runtime env injection contract across engines and address review feedback on contract keys. - #2292 branch guard: canonical lock import and worker smoke guard, wire branch guard canonical lock regression into smoke workflow, optional QA items (canonical otel, temporary --no-verify hint). - #2245 read-only gitdir: make coding worktree git metadata writable with read-only fallback, tighten worktree add gate, probe common write, preserve HEAD on relocate; review-fix coverage wired into CI gate. - #2314: treat stale lease as fast-forward in branch guard. - #827: preserve user_id on assignee change and record created_by, widen mine filter to user_id OR created_by OR assignee, created_by fallback in backfill script, regression tests relocated to runtime domain. - #2227 grape CLI capability drift guard: detect CLI capability drift, wire drift guard into checks and worker install, document version requirement and fallback verification. - #2281: recover unpushed worktree commits and add push retry channel. - #2225 issue/PR write guard: guard issue and PR writes against cross-issue content, isolate per-session staging tmpdir and sweep opencode residuals, read-only guard lookup, tmpdir fallback tiers, wire guard into issue/pr comment creates and issue create, release guard anchor skips quoted lines, gate sqlite read fast-path by db backend, confine sweeper deletions, openapi baseline sync. - #2706 branch lease: converge lease lock import into _lock_module() and fail open when lock module is unavailable, guard import smoke and lease fallback regression wired into linux-backend gate, worker package ships lock and guard modules, repogit probe/relocate bare except replaced with logged warnings, tests moved under tests/runtime, cross-domain read inventory baseline bump files_scanned 467 -> 469. - #2514 workspace binding + arch-guard round-9 BLOCKED findings F1/F2 closure. Verification: single-commit squash equals the 237b5738 tree at the old merge-base (reset --soft, tree unchanged); post-rebase tree re-validated against a trial merge of the same two tips. Rebase conflict resolution (branch_guard.py, single conflict file): - Union of base 2028-05 evolution (stdin fail-open, --no-verify hint, hook_main/_hook_main refactor with issue aggregation) and the zj-side #2292 HOOK_REPAIR_HINT guidance; HOOK_TEMPLATE_VERSION bumped to "2028-06" and registered in test_issue_2933 frozen assertion. - #2314 lease semantics (local_sha fast-forward, reconcile_pending, _initial_expected, refresh_expected, record_pending_push) verified present in the rebased _hook_main. Verification: squash tree == 237b5738 tree (identical tree hash cb9060ef4); three-point diff vs base shows only the deliberate union deltas; trial merge of the same tips hits the same single conflict file; tests: branch_guard suites 2292/2314/2933 = 57 passed, domain suites 2225/2227/2245/2395/2706/827 = 109 passed (env -u PYTHONPATH, repo venv). | 5 days ago | |
fix(gsb): #2476 wire gate self-tests into CI and fail closed on missing roots | 9 days ago | |
feat(org): add organization pipeline, dispatch, and repo map Add the organization workbench pipeline: intake, dispatch, aggregation, context publishing/snapshots, repo map analysis, knowledge, audit, and retention. Includes the org management API, Vue workbench pages, CLI contracts, UUID-primary-key migrations with grape_t_ prefixes, metrics, and guard/test coverage. Review remediation included in this commit: - route destructive DDL through _destructive_ddl; - register the lazy VcsApiClient export in the A3 gate; - retire the standalone org-pipeline page behind an explicit redirect and replace its stale source assertions with a retirement contract test; - squash the branch onto arch-weekly-11 and refresh the migration and cross-domain-read baselines after rebasing on the target branch; - treat dispatch ids and org issue idents as strings/uuids end to end in the aggregation closure, and keep the top-bar org default contract; - add a single-db fallback for the mgmt read port so structured task memory works outside the three-db topology. Signed-off-by: chenyan <1534887760@qq.com> | 3 days ago | |
fix(gate): ship the undefined-name ratchet script that the gate references The previous commit wired scripts/check_undefined_names.py into both make lint and rds_gate.sh, but that path matches scripts/check_*.py in .gitignore, so the script itself never entered the repository. A fresh clone would run the gate against a missing file and fail immediately. The ignore rule gets an explicit exception for this one gate script, matching how the file is already excluded for the empty-string cleanup script. Verified: git ls-files now lists scripts/check_undefined_names.py; the ratchet reports 1/1 against the committed baseline and make lint passes. | 8 days ago | |
docs(db): record the merge-gate-log duplicate cleanup in production grape_t_merge_gate_log is the audit trail of the PR merge gate (pre_merge_qa, pre_merge and post_merge decisions) written best-effort by insight public. Both production copies were empty, so the runtime duplicate was backed up to /home/grape/merge-gate-log-runtime-copy-backup-20261115.sql and dropped, leaving insight as the single owner. The ownership guard now reports should_skip(...,runtime)=True and should_skip(...,insight)=False, so no other process will recreate it. | 8 days ago | |
fix(issue-372): user token driven misjudgment, silent failure, and GitHub symmetry fixes (Closes #419) Implement comprehensive token-driven misjudgment prevention and silent failure elimination across the grape platform. Key changes: - FR-17/18: Replace OR-based dual-column queries with provider-specific single-column lookups via um_column_for_repo() utility, eliminating cross-platform empty-string false matches - FR-18.4: Backfill unified_user_mapping from external_identities instead of grape_accounts.username, preventing pseudo-identity reinjection - FR-18.7: Add bind_feishu_identity() to only write Feishu columns without touching platform identity columns - FR-11.2/11.3: Add empty-input early returns and CASE WHEN guards to prevent empty-string column matches - FR-1/2/8: Probe timeline hardening — token 401 pre-check, webhook empty-list uncertainty skip, dual-signal 404 cross-verification, safety fuse (max 2 deletions per round), webhook-lost vs deleted separation - FR-5.2: Enhanced host_repo error mapping with TOKEN_PERMISSION_INSUFFICIENT error_code for frontend mapping - FR-13: Parse TEXT timestamps as UTC via _parse_utc_timestamp() - FR-14.1/14.2: INSERT with conflict retry instead of INSERT OR REPLACE for exchange_codes and binding_tickets; UPSERT for repo_im_group_binding - FR-15: Escape LIKE pattern special characters in provider prefix queries - FR-16.1: Partial unique index on chat_conversations for task sessions with MySQL compatibility (WHERE clause dropped on MySQL) - FR-20: Token expiry handling — expired tokens not written to session, config_level field added to TokenResult - FR-21: GitHub symmetry — provider-aware token column selection in agents/settings/session_store, GitHub collaborator identity resolution via external_identities - Anonymization: Clear columns preserve row (UPDATE SET='') instead of DELETE, preventing backfill pseudo-identity reinjection - FR-11.4: Deliver clean_empty_strings_to_null.py script (gitignore exception) Compatibility fixes (FR-22, deep audit): - FR-22.1: Fix missing (user_id,) param in cooldown.py DELETE feishu_onboard_task (P0) - FR-22.2: Revert issues.py permission narrowing — role field absent in get_current_user dict, user_id=0 issues were locked for all non-creators (P1) - FR-22.3: Fix engine_select EXISTS case mismatch — use LOWER() on both sides to match external_login stored with mixed case (P1) - FR-22.4: Add 'constraint' keyword to _is_constraint_error for SQLite UNIQUE constraint failed detection (P2) - FR-22.5: Add user_id fallback in get_feishu_open_id for username != platform login edge case (P2) MySQL compatibility fix (FR-23, production-detected): - FR-23.1: Fix _update_repo_bot_token writing empty string to MySQL INTEGER webhook_id column on webhook rebuild failure — causes 1366 error and silent bot token loss. Convert to int(0) for empty values. Unmanage permission fix (FR-24, production-detected): - FR-24.1: Fix _check_unmanage_vcs_permission using grape registration name instead of VCS platform login. Align with host_repo pattern: use with_oauth_token + VCS /user API to get real platform login. Issue attribution EXISTS guard fix (FR-25, full-scan detected): - FR-25.1: Fix session_store and issues_center EXISTS guard comparing ga.username (registration name) with m.gitcode_user (platform login). Changed to ga.id=m.user_id AND ga.status=1. - FR-25.2: Fix engine_select L2/L3 fallback EXISTS outer key using ga.username instead of external_identities. Removed outer ga.username predicate, EXISTS now solely validates via ei.external_login. Template onboarding owner fix (FR-26, full-scan detected): - FR-26.1: Fix templates.py owner priority — was user.get('username') or owner_login (registration name first), reversed to owner_login or user.get('username') (platform login first). Test fixes: - test_agents_routes.py: repo_gitcode_token_exists -> repo_token_exists - test_issue_395_bugfixes.py: adapted for FR-5.2 error_code enhancement - test_issue_372_r14_audit.py: return False -> ok=False (dict return type) - test_unified_user_info.py: fixed None vs '' regression (removed or None) - test_p2p_bind.py: adapted for FR-18.7 bind_feishu_identity (no gitcode_user) Based on weekly-08 (17509551a). 193 tests passed. Signed-off-by: grape <grape@local> | 1 month ago | |
merge weekly-02: resolve 7 conflicts, keep local bug fixes (a2a task_id, github_bot_token key, a2a redispatch) | 2 months ago | |
refactor: #699 reorganize src/ into domains (mgmt/runtime/insight/contracts) with re-export shims | 20 days ago | |
feat(guards)!: table ownership manifest + DDL owner guard, stop duplicate base tables When several domain processes share one schema set, every process runs the same migration module and creates every table, so a table that belongs to one domain also exists as a base table in the other databases. Those copies then diverge: writes go to one copy while reads come from another, and after a host split they become orphaned data. This change makes table ownership explicit and enforces it at the DDL entry points: - configs/table_ownership.json: ownership manifest for 136 base tables (mgmt 81 / runtime 45 / insight 10). The eleven tables that previously had several base copies are decided to runtime, based on which process writes them and which copy actually holds data. - src/kernel/table_ownership.py: domain resolution (DEVOPS_DB_NAME, then GRAPE_PROCESS_ROLE), manifest lookup with mtime based reload, and a guard that is enabled only for the MySQL multi-schema backend so single-file sqlite deployments and the test suite keep building a complete schema. - src/api/db_setup.py: _create_tables, _create_indexes and _ensure_column skip tables owned by another domain and log [DDL_SKIP] with the owner, so the guard is visible in normal startup logs. Unknown tables are still created, and GRAPE_DDL_OWNER_GUARD=0 disables the guard as an escape hatch. - scripts/view_owner_known_duplicates.txt: the allowlist shrank from eleven to the two tables whose copies are still needed until the mgmt code paths move to the runtime library. Cleanup applied on dev with the guard in place: the seven mgmt copies of the IM channel tables, the mgmt and insight copies of branch_guard_state, the insight copies of the two credential tables and the insight copy of takeover_sessions were dropped, and takeover_sessions gained the seven columns that only existed in the mgmt copy. Duplicate base tables went from eleven to two. Tests: 18 cases covering manifest coverage, domain detection for every naming shape, owner resolution, unknown tables passing through, guard disable via env and via sqlite backend, index table-name parsing, and the db_setup hook. Signed-off-by: grape-dev <dev@grape.local> Refs #699. | 10 days ago | |
bugfix and promote response Co-authored-by: songspace<songspace@grape.dev> Co-authored-by: lvjuntao<jentle_81@163.com> | 8 days ago | |
feat(platform)!: decouple login channels, repo platforms and bot identity Rework the multi-platform layer so login credentials and repository credentials are separate objects, every platform decision comes from configuration or a platform card instead of a hardcoded pair of names, and the user-facing surface obeys one explicit visibility switch. Object model - grape_t_oauth_channels and grape_t_repo_platforms are the runtime authority; configs/*.json is an import source only (canonical hash, source=config|manual, orphaned rows soft-deleted, manual rows never overwritten). - The credential-caps table was merged into the platform rows and dropped; the channel<->platform relation keeps only the pair - the relation tier, drivers and scope no longer gate anything and same-domain pairing is implicit. - Issue/PR URLs, webhook paths, clone auth and token storage fields come from the platform card, so a new platform needs a card, not a code branch. Bot identity - One bot per platform, stored on the platform row (bot_username, bot_token_enc, bot_token_status, bot_checked_at); the bot account catalog is retired: the live table is exported to data/bot_accounts-backup-<ts>.json before it is dropped, and the drop is refused when the export cannot be written. - Read chain is platform row -> meta -> seed file; the seed file keeps its original name (configs/global-bot-token.json) and now also accepts a per-platform array. Tokens copied from meta during the backfill are encrypted in place - they had been landing as plaintext PATs under an _enc column. - Rotating a platform bot token refreshes the path-A repositories' webhook secret, so existing webhooks keep verifying. User-side visibility - One switch: grape_t_repo_platforms.enabled. The meta list vcs_platforms_hidden is retired (migration 202611170021 copies it into enabled=0 and deletes the key); the admin list marks rows disabled. - Directory, both /repos/member paths and the admin list share one predicate (domains/platform/visibility.py). A disabled platform answers 403 PLATFORM_DISABLED before the no-binding shortcut, and the merged repo list never fetches it - hiding a platform with repos left visible would be a half-usable state where the credential entry point is gone. - The registry no longer conflates "no rows" with "all rows disabled": an empty filtered result is an answer ([]), never a reason to fall back to the config cards. Before this, disabling every platform made all of them reappear. - Disabling asks for confirmation and returns the impact first (409 with repo, user, hosted and PAT counts); disabling is always confirmed, zero impact included, so every platform behaves the same. - Default-hidden platforms live in init code (DEFAULT_HIDDEN_PLATFORMS = {gitlab}): applied when a platform row is first created and once by migration 021, never by an import update, and an orphaned row coming back counts as available again. Admin UI - Channels and platforms got list/detail views with brand icons (standalone SVGs with xmlns - inline copies load as broken images), localized provider names (the huawei channel reads Huawei in both locale packs), per-platform bot editing, and the channel pairing section removed: the three-way wording could not be explained and relations are meant to come from configuration. - Field help popovers teleport to body and position themselves fixed: an absolute popover inside an overflow:hidden group was cut in half, which is what "the ? is covered" looked like in the browser. - Platform shutdown confirms in a page-local Vue modal with its own fixed/inset styles and ghost/danger buttons. window.confirm is not used, and the shared AGModal was dropped because the admin shell never loads its design tokens, so the mask lost position:fixed and the dialog rendered outside the viewport. - enabled now has two meanings and two doc keys: channels (login allowed, 403 CHANNEL_DISABLED otherwise) and platforms (visible to users, still usable internally). The old shared "whether this object is enabled" text was wrong on the platform page. - Deployment-level config keeps webhook_url, documented for what it is: a public base URL - the platform path is appended from the card and any /webhook/<platform> written into the value is discarded. Correctness sweeps - Prefix filters use substr equality instead of LIKE (provider names may contain underscores) and every prefix site is registered in one guard. - A platform's cached repositories survive another platform's refresh. - Migration runner: post-DDL verification before stamping, frozen checksums for applied migrations, and the platform DDL test pins the table set. - Design docs, requirements and code carry no real credentials: the live bot token and webhook secret that sat in a sample config block were replaced by placeholders, and a scan guard flags credential-shaped values from now on. Breaking changes - The channel<->platform relation tier column is dropped and pairing is configured, not tiered. - grape_t_bot_accounts is dropped; bot credentials live on the platform row. - Admin no longer offers channel<->platform pairing edits. - Platforms disabled in grape_t_repo_platforms.enabled are invisible to users (gitlab ships disabled by default). Tests: the 53 test modules this commit touches were run on the rebased tree and on the arch-weekly-11 tip with the same interpreter. Result: 0 failures beyond the baseline set (19 cases still red, all of them already red on the baseline), and all 229 branch-only cases are green. Baseline sync - Rebased onto arch-weekly-11 (de0b8f190, 2026-11-16 17:23) so this branch carries the current weekly tip. Conflict resolution follows "baseline is authoritative, our capability is re-implemented on top": onboarding.py keeps the runtime-domain alias shim (our LIKE -> substr prefix fix moved into src/domains/runtime/onboarding.py); admin auth-channel save keeps the runtime public merge-in-one-transaction primitive with the file-card base (builtin_channels) instead of the retired code table; user db keeps domain read/write primitives (insight repo_keys_sharing_value, runtime meta set-* helpers) plus the PAT hook calls and the doc-key filter; engine scope filter keeps the mgmt-resolved username path and now takes its repo candidates from repo_key_candidates instead of three hardcoded platform keys; the entry CSS injection is dropped because the baseline bundles view CSS into all-views.css. - Platform-object migrations are renumbered to 202611170030-202611170040 (the baseline already owns 202611170009); every migration is still registered through register_migration and the destructive ones keep the min_code_version gate. - openapi.json and help/api/openapi.json are regenerated from the merged app; front-end and i18n cache-version ratchets are re-pinned to the new shell pages. Capability kept on top of the baseline - Prefix filters stay exact ( substr(col,1,?)=?): the bot-token impact scan moved to the insight-domain named query and now takes a literal prefix instead of a LIKE pattern; the guard registry follows both the onboarding move and the insight query. - No hardcoded provider pair: config_store derives the bot-token field from its field map instead of "gitcode" if provider == "gitcode", and the engine scope filter takes its candidates from repo_key_candidates. - Admin field docs and page i18n: the six page keys used by AdminChannels/AdminPlatforms are now in the inline i18n bundle too (zh + en), the AGHelp wiring and the "empty result is an answer" registry contract are locked by tests updated to the final rulings. - Test fixtures that stub the mgmt connection now also stub the _mg_db domain proxy, which is what the baseline routes writes through. Three-db / four-process boundary (docs/lib-3db-3host-design.md section 1.1) - The four platform-object tables are registered in configs/table_ownership.json as mgmt owned (grape_t_repo_platforms also gets a runtime view for the same-instance rollback topology), and the D109 DDL migration passes every statement through the ownership guard; the grape_t_repo_credentials column additions now run only in the insight-owning process. - runtime no longer opens its own database for platform rows: the platform-card read and the bot health write go through new mgmt public primitives (repo_platform_cards / mark_repo_platform_bot_status) backed by portable named queries, so the split topology reads and writes the authoritative mgmt copy instead of an empty local one. Credential columns (bot_token_enc / client_*_enc) stay out of the cross-domain column list. - tests/api/test_platform_object_domain_boundary.py locks the four rules: manifest ownership, owner-guarded DDL, no platform ORM imports under runtime/insight, and cross-domain access only through mgmt public. - Nine silent except sites in the new modules log instead of pass/continue, keeping the silent-except ratchet green (tests/arch/test_silent_except_ratchet.py). Migration self-healing (live evidence 2026-11-16) - On a legacy snapshot database the first run took the legacy-stamp full track: version 202611170030 was recorded (2 ms) while none of the four platform tables were created, and the following backfill migrations failed. Saving a PAT then hit "no such table: grape_t_user_repo_platform_link", so the user-platform relation never appeared even though the hook ran (on_pat_saved in the logs). - The platform-object DDL is now replayed by an idempotent guard migration (202611170041 ensure-platform-object-tables): any database whose ledger claims the tables exist but does not have them converges on the next start, without touching the baseline executor semantics. Deployment hardening and incident follow-up - scripts/deploy_preflight.py rejects a start when the process role is missing, the migration ledger is empty, a stamped version collides with the registry, or an owner table is absent; the four server entries now default GRAPE_PROCESS_ROLE so the ownership guard can never skip this domain's DDL by accident. - /api/repos/member no longer turns a workspace page into 401 when every listable provider's credential has been rejected and no cache exists: it degrades to the guide payload (200 + _no_vcs_binding) with a provider-aware hint (OAuth -> reauthorize, PAT -> reconfigure), while an explicit ?provider= request keeps the 401 with action=credential_invalid. - Docs: D109 design gains section 20 (single table owner, cross-domain access through mgmt public primitives, migration self-healing, deployment preflight, degraded-credential policy); requirements gain FR-33 with R1-R5; use cases UC-D109-45..49 and the UC-to-test mapping. - Tests: deploy preflight (5 cases), migration self-healing (3), PAT-to-relation scenario (2), credential-degradation (2). Workspace entry gate (workspace / my projects / project templates) - The relation snapshot used by the entry gate was taken once at login: refreshRepoLinks existed but was never called, so an account that had just cleared its credentials still looked bound. loadRepos (projects + templates entry) and goToRepos (lobby entry) now refresh the relation snapshot before deciding, and loadRepos renders the binding guide instead of the lobby when there is no relation. - Relation read path gained the reverse self-heal: a relation row whose sources (identity rows and PAT credential rows) are all gone is revoked on read and dropped from the payload, so the frontend can no longer act on a ghost relation. Same payload feeds /auth/platform-links and the profile field. - Tests: test_workspace_entry_relation_gate (judgement source, three entries, snapshot refresh, self-heal present) and a dangling-relation scenario in the PAT relation suite; docs: D109 section 20.6, FR-33 R6, UC-D109-50/51. Credential usability joins the predicate (identity row is not proof of a usable token) - A bound platform can still be unusable: an identity row whose stored access token was written under an older key cannot be decrypted (refresh token empty, no PAT), so the relation row stays active while every repo call would need re-authorization. The read path then reported has_any=true while /repos/member had nothing usable, and the two views contradicted each other. - list_platform_links now marks token_usable per provider; /repos/member only counts usable providers (no doomed call, no 401), and the platform-links payload exposes needs_reauth plus a hint so the entry guide asks for re-authorization instead of pretending the account is not bound. - The empty-workspace response now tells the two cases apart: an account that never bound a code platform gets the bind hint, an account whose binding token is unusable gets "<provider> sign-in authorization expired, re-authorize" plus _reauth_provider. - Tests: test_dead_identity_not_counted (dead identity is not a binding, a live PAT still is); the PAT relation read test now asserts the usable/needs_reauth contract. Docs: D109 section 20.7, FR-33 R7, UC-D109-52. Signed-off-by: yang-aiwu-new <yang-aiwu-new@noreply.git.com> | 7 days ago | |
feat: #699 add Phase 6 dual-mode deployment (chat tables to runtime, four-container compose, profiles, dev script, TC-6.1~6.5 tests) | 20 days ago | |
feat(engine): integrate AtomCode CLI as an execution engine | 12 days ago | |
feat(db): add domain split guards and cutover tools P0/P1 guards for the three-RDS split: foreign-table ref ratchet (138 pairs / 1306 refs), view allowlist (only-decrease, 122 views), R8 kernel-writes-domain-table rule (77 ratcheted sites), dependency board, internal contract snapshot, write-channel coverage, cutover baseline/verify and P5 isolation verifier. 60 zero-reference views backed up and dry-run only (DROP awaits sign-off). | 9 days ago | |
refactor: #699 extract src/kernel/ (18 shared modules, auth_sdk, db_migrations) with re-export shims | 20 days ago | |
refactor: #699 extract src/kernel/ (18 shared modules, auth_sdk, db_migrations) with re-export shims | 20 days ago | |
merge: sync arch-weekly-11 (AtomCode engine, vcs decoupling, a2a guard, qa gate) into weekly-11 merge branch | 11 days ago | |
chore(scripts): incident-handling ops scripts — zombie runtime binding fix/failed-event replay/chat config re-binding | 3 months ago | |
chore(db): reconcile the three databases with the ownership manifest Full audit of all 139 manifest entries against the three live databases, then the clean-up. The audit result and what was done about it: ✓ position correct 126 -> 139 (after the fixes below) ✗ table never created 5 -> 0 ✗ built in the wrong database 1 -> 0 ⚠ duplicated across databases 7 -> 0 (1 of them was correct by design) Zero-row shells dropped (both sides were empty on the wrong side, data was on the right side): mgmt.branch_guard_state (runtime holds the 13 rows) runtime.managed_repos (mgmt holds 19) runtime.oauth_states runtime.user_accounts (mgmt holds 63) runtime.user_credentials (mgmt holds 3) runtime.user_repos (mgmt holds 349) Six tables registered that existed but were missing from the manifest: backend_agents → runtime grape_t_guard_check → insight grape_t_guard_finding → insight gsb_provider_route → mgmt devops_pipeline_scene_uid_backup_1208 → mgmt Plus a new manifest section _per_domain_tables for names that legitimately exist in every domain database and are therefore not cross-domain references at all: grape_t_schema_migrations (per-domain migration ledger) and grape_t_xwrite_log (per-domain write audit). Both check-arch R8 and foreign_table_refs now skip them — without this, every domain using its own ledger counted as a violation. grape_t_cloud_sandboxes moved to where the manifest says it belongs: a runtime-domain migration (202611180001, domains=("runtime",)) creates it in the runtime database, and the empty copy in mgmt was dropped. Stamped and verified on the live database in 110ms. Legacy un-prefixed tables dropped after confirming zero code references and zero rows: cloud_sandboxes, egress_admin_exception, egress_admin_policy, engine_sandbox_config, engine_sandbox_paths, engine_sandbox_whitelist, sandbox_provider_config, sandbox_templates, sandbox_whitelist, task_proxy_tokens, plus user_llm_credentials, admin_user_role_rel and template_usage (the last two were already declared unused). They were the pre-grape_t_ ancestors of the current tables — and they are what made my earlier batches harder to verify, because the live database had the old names while the code and manifest used the new ones. Registering the missing tables immediately surfaced two real violations that the gap had been hiding: backend_agents←api 6 all in db_setup.py's legacy build/migrate path — migration, so exempt gsb_provider_route←kernel 4 kernel's GSB route cache; sinking it into mgmt.public would require kernel to import domains, which R1 forbids. Registered in R8_WHITELIST as a permanent exception rather than a debt, with that reasoning written next to it. Final state: mgmt 89 / runtime 39 / insight 16 tables, all 139 manifest entries in the right place, no orphan tables outside the manifest except the three per-domain logs. check-arch PASS · make lint clean · pytest 236 passed · allowlist 23 pairs / 62 refs. | 5 days ago | |
feat(guard): migration version integrity guard (baseline snapshot) + probe timeout 30s with --warmup | 11 days ago | |
refactor(frontend): rename the legacy shell directory to shell The directory no longer holds legacy code - it is the HTML host plus the native runtime, locales and images that mount the Vue views - so it is now frontend/shell. 62 files of path references follow (8 backend mounts/generators, 6 scripts, 45+ tests). Browser URLs are untouched because the shell always referenced /static/... absolutely. A temporary ignored symlink frontend/legacy -> shell keeps the currently running API process serving /static until its next restart. | 11 days ago | |
fix(qa): close the 7 findings from the PR #1602 guard review QA 在 head 51cd0d18e 上逐项实跑,列出 7 项整改。全部有可复现证据,逐条修: configs/table_ownership.json 成为唯一权威后,运行期与主检查器都走 load_owner_json,但这条链上还有 5 个脚本仍在用 TSV 解析器(按 schema\ttable 切行)读 JSON —— JSON 没有制表符,解析结果恒为空,于是: scripts/rds_gate.sh:18 --owner(TSV)→ 归属为空 → 23 对基线全判「清零」 → 恒打印 OK = 守卫被掏空。改 --owner-json。 scripts/gen_domain_dependency_board.py:32 路径指向 docs/weekly-11/table_ownership.json(404) → rds_gate 的 P3 步直接 FileNotFoundError。 路径改 configs/,:60 改 load_owner_json。 scripts/rds_burndown.py:44 load_owner → load_owner_json scripts/rds_burndown.py:79 同一 404 路径 → 改用 OWNER 常量 scripts/rds_next_batch.py:73 load_owner → load_owner_json scripts/split_schema_ddl.py:36 自带 TSV 行解析 → 读 JSON scripts/split_migration_sql.py:107 同上 修完实测(改前全是 0 / 崩溃): rds_gate --quick 剩余跨域 SQL 62 处 / 20 张表(改前静默 0) rds_burndown RESULT: 未清零(静态 62 / 运行 0) rds_next_batch 输出真实候选文件清单 split_schema_ddl --dry-run 可搬 DDL 常量 2 个(改前 0) split_migration_sql --dry-run 输出真实迁移待搬清单(改前 0) B-2 FROZEN index.html:app.js 冻结 273、实际 274(bump 时漏改登记)。改 274。 B-1 i18n 语言包指纹:tasks.json 的 tag_* 去掉 <b></b> 前缀后内容变了,但 LOCALE_FINGERPRINT 仍是 base 的值。按守卫同款算法(sha256,{lang}/{name}: + 文件字节,无分隔符)实算 42 个语言包 = a241ecb4b93db836,与 QA 数值一致。 同时四页 cacheVer 各升一档并同步 CACHE_VER —— 只改指纹能让守卫变绿,但老 客户端仍会命中浏览器里的旧 JSON,本次文案修正对存量用户不生效: index.html 63 → 64 admin.html 20261117-3 → 20261117-4 register.html 49 → 50 forgot.html 49 → 50 顺带重算了因为 owner 解析恢复而变化的两个基线:dependency-matrix/board 重新生成, cross-domain-reads 与 foreign-refs 基线收紧(62 refs / 23 pairs)。 门禁:check-arch PASS · make lint exit=0 · 242 passed(arch+contracts+scripts+ ownership+migration_guard+两个前端守卫)。 未处理(QA 明示不判本 PR,属基线红):scan_pgconn.py --check 的 5 处上升, base 与 head 同红同清单。 | 5 days ago | |
chore(scripts): commit internal contract snapshot generator The generator was referenced by tests/contracts/test_internal_contract_snapshot.py but never committed (gitignore pattern covers gen_* tools), so a clean checkout could not refresh the snapshot. | 9 days ago | |
feat(trace): prefer kernel OTel path and enrich DB spans (Issue #3570) - server_common.build_app: pick the instrumentation path by env, kernel path (src/kernel/otel.py, OTEL_EXPORTER_OTLP_ENDPOINT) first, legacy (GRAPE_OTLP_ENDPOINT) kept as fallback. The two are mutually exclusive. - kernel instrument_fastapi: honor GRAPE_TRACE_SERVICE so the four beta processes are not all reported as grape-server-a; skip when the app is already instrumented (grape_server.py instruments it a second time); install RequestsInstrumentor, which the kernel path was missing entirely (LLM/VCS outbound calls disappeared from traces after switching). - kernel start_db_span/end_db_span: add db.name, db.sql.table, db.operation, sanitized db.statement (string literals and IN lists collapsed to ?, numbers after comparison operators masked), db.rowcount, and on failure mark the span ERROR with exception.type/message plus db.mysql_errno. - mysql_compat: pass the target database into the span and report the exception instead of ending the span in a finally block that hides errors. - excluded_urls: the regexes are matched against the full URL with re.search, but the patterns were missing the api/ prefix (and the runtime_id segment), so worker claim/heartbeat polling was instrumented instead of excluded. Also exclude /faro/collect. - scripts/grape-systemd-run.sh: stop defaulting GRAPE_OTLP_ENDPOINT to http://127.0.0.1:4317. That default made "not configured" look configured, which kept the new path disabled and shipped spans to a port nothing listens on. Keep it opt-in only. | 3 days ago | |
feat(gsb): list the remote-callable /internal interfaces in the bus dashboard The dashboard showed traffic but not the contract surface: which /internal endpoints each domain exposes and whether anyone calls them. scripts/gsb_inventory.py enumerates them from the routers that attach_internal_routes() actually mounts (mgmt readonly+xwrite, runtime, insight) and joins Prometheus' 6h route counts, so the list cannot drift from the code. Current result: 41 remote-callable endpoints (mgmt 12 / runtime 20 / insight 9), exactly one (/internal/issues/card) with real traffic (473 calls in 6h); the rest are 0, which is the expected baseline. Endpoints that put repo_key in the path segment are marked in the table as 404-prone for cross-host calls. --update-dashboard publishes the regenerated markdown into panel 23 and moves the trailing panel when the table grows. Dashboard stays in the Grape folder; repo copy is authoritative. | 7 days ago | |
docs(codegraph): fix the npm package name (codegraph → @colbymchenry/codegraph) + offline install script - npm 上 codegraph 是空壳占位包(无 bin/dist),真包带 scope(2026-08-18 实测) - 4 个技能 reference 同步修正 + 补充发布包离线安装指引 - scripts/install-codegraph.sh:离线解压平台包 + 软链 bin,零依赖自带 node 运行时 | 3 months ago | |
bugfix and promote response Co-authored-by: songspace<songspace@grape.dev> Co-authored-by: lvjuntao<jentle_81@163.com> | 8 days ago | |
feat(sync): land arch11-weekly-1102-zrr rework for four-process topology takeover Squash-lands the branch-side changes of arch11-weekly-1102-zrr (previously spread over commits 54b01c01/584ebd45/75e40561/9246a31d/1039ded3/6d0de4da/ 2f1f9bde/d55a704d/1b1854ff and several merge commits) into a single English Conventional Commits landing, per compliance review (Issue #3913 items 2-1/2-2). Content is unchanged from the reviewed PR head 2d0918bc9: - #3834 takeover cascade chain: backfill the takeover conclusion and keep the A2A chain alive; failed-terminal symmetry, original attribution fields, next-dispatchable validation, backfilled observability, plus real-HTTP link test cases - #3621 trigger_pipeline switch on issue create, with the pending-issue first-trigger path (stage=created -> vod via atomic CAS claim) and 409/400 idempotency guards - #3620 tko_ takeover token on git-credential with strict repo-scope check and takeover-session liveness revalidation - skills contract fixes: restore _validate_repo_param and document the repo owner/repo contract params - pending-issue trigger path no longer holds db_lock inside async code (sync critical section + asyncio.to_thread) - A2A dispatch by service mapping, v2 claim Request passthrough, and ratchet/snapshot refresh; takeover dispatch real-HTTP test updates - #3874 worker onboard review gaps: docs, CI gate, wheel platform coverage, pyyaml/model-gate resilience - 3-db cold-start bootstrap path (scripts/bootstrap_3db.py) and the deploy/README.md four-process wiring section - docs: grape-kit raw install URL fallback, openapi snapshot and i18n ratchet refresh, cross-domain read baseline refreshes | 6 hours ago | |
feat(sync): land arch11-weekly-1102-zrr rework for four-process topology takeover Squash-lands the branch-side changes of arch11-weekly-1102-zrr (previously spread over commits 54b01c01/584ebd45/75e40561/9246a31d/1039ded3/6d0de4da/ 2f1f9bde/d55a704d/1b1854ff and several merge commits) into a single English Conventional Commits landing, per compliance review (Issue #3913 items 2-1/2-2). Content is unchanged from the reviewed PR head 2d0918bc9: - #3834 takeover cascade chain: backfill the takeover conclusion and keep the A2A chain alive; failed-terminal symmetry, original attribution fields, next-dispatchable validation, backfilled observability, plus real-HTTP link test cases - #3621 trigger_pipeline switch on issue create, with the pending-issue first-trigger path (stage=created -> vod via atomic CAS claim) and 409/400 idempotency guards - #3620 tko_ takeover token on git-credential with strict repo-scope check and takeover-session liveness revalidation - skills contract fixes: restore _validate_repo_param and document the repo owner/repo contract params - pending-issue trigger path no longer holds db_lock inside async code (sync critical section + asyncio.to_thread) - A2A dispatch by service mapping, v2 claim Request passthrough, and ratchet/snapshot refresh; takeover dispatch real-HTTP test updates - #3874 worker onboard review gaps: docs, CI gate, wheel platform coverage, pyyaml/model-gate resilience - 3-db cold-start bootstrap path (scripts/bootstrap_3db.py) and the deploy/README.md four-process wiring section - docs: grape-kit raw install URL fallback, openapi snapshot and i18n ratchet refresh, cross-domain read baseline refreshes | 6 hours ago | |
docs(compliance): keep internal hosts, paths and credentials out of the repository Open-source review of this branch reported that the table ownership record and a few maintenance scripts carried deployment details: internal host addresses, absolute backup and instance paths, and a default staging database password. Changes: * configs/table_ownership_notes.md is rewritten as a code-level decision record. It keeps the authority (docs/weekly-11/table-owner.tsv), the derivation rules, the fourteen table decisions, the DDL relocation and the owner-connection design, and drops the environment topology, backup file names, data row counts and cleanup ledger. A maintenance rule now states that this file must not describe environments. * scripts/p4_p5_loop.sh no longer ships a default staging password and no longer hardcodes the remote MySQL instance directory: STAGE_DB_PWD and REMOTE_RDS_HOME must come from the environment and fail fast when unset. * scripts/rds_p4_provision.py replaces internal host literals in its usage examples with placeholders; the source host defaults to loopback and stays overridable via --source-host. * scripts/probe/nginx_probe.py reads its probe targets from the PROBE_NODES environment variable (JSON array) and defaults to a single loopback target; deployment paths in the docstring are placeholders. * scripts/migrate_chat_cwd.py documents a placeholder data root instead of an absolute user path. Verification: a scan of every tracked file under configs/ and scripts/ for internal address ranges, absolute deployment paths and the staging password now returns nothing; tests/scripts, tests/arch and the ownership tests pass (94 passed); bash -n and py_compile are clean on the touched scripts. | 8 days ago | |
feat: #699 add schema migration and table-ref codemod scripts | 20 days ago | |
refactor: #699 reorganize src/ into domains (mgmt/runtime/insight/contracts) with re-export shims | 20 days ago | |
fix(db): route cross-domain reads to the owner connection and stop the 1146 flood Non-owner processes kept querying domain tables over their own connection, so the three-database topology produced ERROR 1146 (table does not exist) that the call sites swallowed: on the rehearsal cluster the mgmt process logged 274 of them in eight minutes and dashboards silently returned empty data. Two root causes: * the mgmt entry started the insight observability loops (_start_obs_alert/ rollup/sample) while the obs_* tables live in the insight database; * insight observability modules, the kernel audit table, the GSB route config, takeover and the health scorer all used session_manager.db, which is the process domain, not the table owner. Changes: * new src/kernel/owner_db.py: db_pair(domain) returns a db-compatible proxy plus a process-wide reentrant lock. With GRAPE_DOMAIN_LIB=1 and a DSN it uses that domain's thread-local connection (dialect translation preserved); otherwise it falls back to session_manager.db so single-database and test topologies behave exactly as before. * grape_server only starts the observability loops when the database is insight-owned (or in a shared single database) and logs the skip otherwise. * twelve modules now resolve their database through the owner proxy: the whole insight observability package, runtime takeover and event store, the kernel credential usage log, GSB route config (which also creates its table before the first read), mgmt pipeline config and the runtime health scorer (runtime tables on runtime, runtime_health_scores on insight). * the user-id migration script only scans tables owned by the current domain and logs a skip for the rest, instead of failing on foreign tables. Measured after a restart: 1146 counts over the next eight minutes are zero in all four processes (was 274 in mgmt alone); /api/dashboard/ops/overview and the issues API still return real data; the test suites match the baseline failure set exactly (13 failed / 889 passed / 28 errors) plus seven new owner_db tests; rds_gate.sh --quick is fully green. | 8 days ago | |
test(#2050): structured handoff and advisory guard coverage Adds the shared scripted fake DB and the thirty-two-case suite for the structured handoff contract, the stall judges, the advisory-only guard on scene-order derivation, the legacy A2A: line compatibility and the stall badge fields. Sits in tests/mgmt/ next to the existing patrol unit tests. | 11 days ago | |
feat(vcs): multi-platform decoupling with card-driven OAuth and repo credentials Baseline: arch-weekly-11 (13c6d0979). All conflicts resolved in favour of the baseline; weekly-10 capabilities are re-implemented on top of the arch layout instead of being restored verbatim, so the baseline behaviour is preserved. Capabilities delivered (design/use-case docs under docs/weekly-09/multi-platform-decouple): - OAuth platform configuration: login channels are driven by meta.oauth_providers_config (card JSON) plus oauth_<p>_client_id/secret, the login page renders the configured channels (gitcode/github/gitee/huawei) and degrades to the "unconfigured" hint instead of hiding providers. - Repository support is configurable and decoupled from OAuth: platform cards (configs/platforms/*.json + vcs_providers_config) declare host, dialect, API auth, webhook verification, clone auth, storage fields and resource mapping. Repository credentials live in repo_credentials (repo_key x cred_type, UNIQUE contract) and are resolved through repo_key_candidates / get_platform_card, never through login identities. - Onboarding a new platform is a card-only change: registry, webhook, verification token, resource adapter, credential family and bot identity are all derived from the card (UC65 acceptance lock, including the negative case "no card, no onboarding"). - Account system on grape_accounts only: user_accounts is a retired dead table (zero writes, 10 deprecated write helpers removed), identity binding goes through external_identities, and account ids are UUID (D105/D105b). - ITX/VCS related primary keys are UUID/TEXT: issue, session token, account FK, credential and event ids use uuid7 with explicit generation (no raw INSERT + lastrowid in uuid domains). - Provider-generic token resolution (D37/S57): call sites derive the provider from repo_key or the platform card; the arch-specific legacy symbols are declared per card (legacy_token_symbol) and resolved lazily, so no platform name is hard-coded in business paths. Baseline-preserving details worth reviewing: - build_app gains an optional default_response_class (default = baseline FastAPI behaviour) used only by the single-process entry for safe JSON serialisation (Issues #684/#818). - Verify-token / login-whitelist gates are card-derived while keeping the baseline status codes and the downstream config_store.verify_token call. - get_user_github_token_with_refresh is kept as an arch-native compatibility symbol (two baseline tests patch it) but delegates to the generic resolver and keeps the baseline PAT early-return semantics. - QA conclusion gate (#1739/#1963): baseline port is authoritative (blocked issues stage to pending_review); the stale src.user import in the baseline annotation path is repaired to the canonical module and the provider is derived from repo_key. - Tests: module paths adapted to the arch layout (rename table 4ebe33b7b..1938d6591), duplicate guard helpers collapsed to the baseline definition, and expectations updated only where the baseline deliberately changed behaviour (documented inline). Baseline sync notes (13c6d0979): the AtomCode engine (cards/backends/_BACKENDS entry), its CI job and the ACP safe-termination wrapper are taken from the baseline; our provider-derived token resolution in executor/agent and the pytest guard around engine termination are re-applied on top. Verification (isolated, one file per run, unshare + private tmpfs): - platform cards: test_platform_card_matrix 28P, test_s3_card_driven_resources 21P, test_platform_onboarding_acceptance 11P, test_platform_whitelist_ratchet 4P, test_s115_platform_gate_closure 16P, test_s120_agent_chain_credentials 6P - identity/accounts: test_d105_batch2_account_uuid_pk 7P, test_d105_uuid_pk_migration 4P, test_account_fk_user_id_text_migration 10P, test_schema_fk_type_invariant 4P, test_user_accounts_write_freeze_guard 2P, test_uc42_system_credentials 11P, test_uc42b_retirement 5P - provider-generic tokens: test_multi_platform_decouple_step1 9P, test_s73_family_closure 3P, test_login_provider 21P, test_repos_host_provider 7P, test_issue_372_round8_audit 13P (2 baseline pre-existing failures, unchanged), test_probe_github_hooks_404 3P (3 pre-existing, unchanged) - delivery/pipeline: test_issue_1739_qa_close_gate 52P, test_d29_comment_delivery_card_driven 8P, test_issue_1668 16P, test_issue_1770_a2a_dispatch_guard 17P+1XPASS, test_port_qa_gate_p1 7P, test_port_p2_acceptance 7P, test_result_post_policy 38P - engine: test_atomcode_runtime 39P, test_kill_stale_engine_no_tty 3P/2F (identical to baseline), test_issue_1811 6P - VCS API: test_git_repo_api 69P+1xfail; live end-to-end on a verification instance: issue create/comment/close and pull create/comment/close against gitcode and github repositories (7/7 each) Docs: docs/weekly-09/multi-platform-decouple/ (design + UC mapping), platform card schema in configs/platforms/SCHEMA.md. Scope of this MR (narrowed after review): - only the multi-platform decoupling work is included: platform cards and provider adapters, OAuth channel configuration, repository/credential decoupling, account system and UUID primary keys, provider-generic token resolution, plus the tests and design docs that back them - excluded on purpose: per-issue working docs (docs/issue-*), the IM engine design notes and its test suite, and the unreferenced IM adapter modules that arrived with an unrelated work stream. IM source modules that are referenced from observability/scheduler/chat wiring stay in the tree to avoid broken imports; a separate MR should move the whole IM stream out together with that wiring. Review-round fixes (squashed into this commit, PR #1231): Compliance (open-source review): - placeholder-ize internal usernames, repo names, hosts, the public IP and RDS/db capacity data across docs, source comments, dingtalk card template mockData, smoke scripts and test fixtures (example-user/example-org/example-repo, <public-host>, <worker-host>, <public-server-ip>); wecom card fallback URL is a non-routable placeholder; /root/grape doc paths become <repo-root> - configs/platforms/*.json kept as code-level default platform cards (data-driven feature core, no credentials) Guard realignment (deep review): - bump app.js cache version to 253; repoint s100/s96/s103 guard reads to the arch layout; fix the s122 src/ segment; drop now-legal domains modules from the legacy-shim blacklist; register the merged-baseline silent-except points; check-arch whitelist for the deferred kernel->domains lookups (R1), the baseline-inherited R5/R6 findings, plus canonicalizing the 4 new shim imports (same module objects) Routing fix found by the new coverage: - the im router was included after the SPA catch-all so GET /api/im/* never reached its handlers; it is now included before attach_frontend Milestone create due_on contract (three-platform live-fire finding): - GitCode/Gitee v5 upstreams require due_on on milestone create; the proxy now rejects a missing due_on with a readable 400 via the MILESTONE_DUE_ON_REQUIRED provider contract switch (no silent default date - a fabricated due date would pollute ordering/overdue reporting); GitHub stays optional; date-only coercion unchanged Verification (isolated, plus targeted regression): - platform cards: test_platform_card_matrix 28P, test_s3_card_driven 21P, test_platform_onboarding_acceptance 11P, test_platform_whitelist_ratchet 4P, test_s115 16P, test_s120 6P; identity/accounts: d105 family 25P+; token generalization: multi_platform_decouple_step1 9P, login_provider 21P - VCS API: test_git_repo_api 69P+1xfail; live end-to-end on a verification instance against gitcode and github repositories (issue create/comment/close and pull create/comment/close, 7/7 each) - review-round regression: 131 targeted tests green, scripts/check-arch.py PASS, sensitive-token sweep over the increment clean - due_on gate: tests/test_milestone_due_on_contract.py 6P; proxy contract and dialect backend suites 67P green Docs: docs/weekly-09/multi-platform-decouple/ (design + UC mapping), configs/platforms/SCHEMA.md (platform card contract). Architecture-guard round fixes (rounds 3/4, squashed into this commit): - release_pack.py: the if __name__ == "__main__" guard sat before tools_manifest_files() (script-mode run -> NameError in pack_tools); the guard now terminates the file and the duplicated trailing shebang/docstring dead block is removed; entry-order guard test added - frontend cache versions: the 16 changed page modules are bumped and a frozen-map ratchet test locks page-module ?v= values (bump must pair with a test update); app.js stays at 253 - i18n: account.js's 28 new hardcoded zh user-visible strings are keyed to app.account.* (31 new keys in zh/en app.json, sets verified equal); the || 'zh fallback' literals are dropped in dashboard/skills; a Chinese-literal ratchet freezes per-file counts (only-decrease) - credential tables renamed to the grape_t_ prefix (rule A6): repo_credentials -> grape_t_repo_credentials, system_credentials -> grape_t_system_credentials across DDL/SQL/ORM/tests/docs; both tables are introduced by this PR and no merged database carries the old names, so no rename migration is required; grape_t_credential_usage_log.credential_kind values are D100 domain labels and intentionally keep their unprefixed spelling - check-arch: the 13 new whitelist entries are registered at (file x import-target) precision (dict targets form; the string form stays legacy whole-rule for pre-existing entries), so new dependencies in the same file are no longer silently swallowed; reasons carry evidence pointers and a due Phase; the Phase 5 clearance criteria are written into docs (05-quality-infra.md); the configs/platforms exception is registered in SCHEMA.md - domain boundaries: the legacy-shim blacklist is restored to the baseline list (src.user / src.vc assertions pass on the arch tree) - milestone due_on dialect symmetry (three-platform live-fire follow up): MILESTONE_DUE_TIME_ONLY on github normalizes plain dates to T00:00:00Z (upstream 422 "not a valid date-time" otherwise); the update endpoint normalizes with the same dialect switches as create Verification: 284 targeted tests green across the guard, credential, proxy and IM suites; scripts/check-arch.py PASS; check-i18n-keys OK; node --check clean on the touched page modules. Known pre-existing reds on this line (stale guard paths / a script dropped by the port, verified identical before and after this commit): test_issue_1005, test_issue_1076, test_s118, test_uc39 (missing scripts/check_deploy_backfill.py), test_uc40 nested round9 path, test_migration_no_baseline_version_collision, s119 uc23. QA round-6 fixes (head 8be42d4c review, squashed into this commit): - conftest: the unguarded duplicate test-db deletion block is removed (it defeated the GRAPE_PYTEST_NESTED guard and re-triggered the D100 nested-run DB pollution path; the guarded import-time deletion stays) - check-arch C-1 verification: a precision guard test locks every dict-form whitelist entry to the exact set of actual kernel->domains / shim imports in that file (extra registration = stale, missing registration = new dependency fails immediately); string-form (whole-rule) entries are frozen to the pre-existing legacy set - check-destructive-ddl: coverage extended to scripts/migrations/*.py (QA M-2) with a sanctioned-channel concept - migration destructive DDL is reported as INFO (one-shot, constant-driven, reviewed per file) while db_setup rules stay unchanged; live run PASS - check-i18n-keys: module list now derives from locales/zh/*.json so every language pack is covered (QA M-3); all 19 modules validate OK - deploy_mysql_gate: database passwords travel via MYSQL_PWD env instead of -p argv (QA M-4; ps/history-visible); run_cmd gains an env pass-through and the gate tests now assert no password ever appears in argv and MYSQL_PWD is injected - migrations/002: the global_im_bot_config DROP is deferred (QA M-5) - bot_lease/feishu_async still hold lease-fallback reads against that table, so dropping it would cut the fallback chain; the report now states the deferral and db_setup DDL stays consistent with the readers Verification: 189 targeted tests green (3 pre-existing order/stale-path reds identical on the pre-change tree: s118 x2, s78 order-dependent); check-arch PASS; check-destructive-ddl PASS; check-i18n-keys all 19 modules OK; deploy_mysql_gate 20/20 with the new password assertions. Signed-off-by: xiaowu2119 <xiaowu2119@noreply.gitcode.com> | 12 days ago | |
feat(vcs): multi-platform decoupling with card-driven OAuth and repo credentials Baseline: arch-weekly-11 (13c6d0979). All conflicts resolved in favour of the baseline; weekly-10 capabilities are re-implemented on top of the arch layout instead of being restored verbatim, so the baseline behaviour is preserved. Capabilities delivered (design/use-case docs under docs/weekly-09/multi-platform-decouple): - OAuth platform configuration: login channels are driven by meta.oauth_providers_config (card JSON) plus oauth_<p>_client_id/secret, the login page renders the configured channels (gitcode/github/gitee/huawei) and degrades to the "unconfigured" hint instead of hiding providers. - Repository support is configurable and decoupled from OAuth: platform cards (configs/platforms/*.json + vcs_providers_config) declare host, dialect, API auth, webhook verification, clone auth, storage fields and resource mapping. Repository credentials live in repo_credentials (repo_key x cred_type, UNIQUE contract) and are resolved through repo_key_candidates / get_platform_card, never through login identities. - Onboarding a new platform is a card-only change: registry, webhook, verification token, resource adapter, credential family and bot identity are all derived from the card (UC65 acceptance lock, including the negative case "no card, no onboarding"). - Account system on grape_accounts only: user_accounts is a retired dead table (zero writes, 10 deprecated write helpers removed), identity binding goes through external_identities, and account ids are UUID (D105/D105b). - ITX/VCS related primary keys are UUID/TEXT: issue, session token, account FK, credential and event ids use uuid7 with explicit generation (no raw INSERT + lastrowid in uuid domains). - Provider-generic token resolution (D37/S57): call sites derive the provider from repo_key or the platform card; the arch-specific legacy symbols are declared per card (legacy_token_symbol) and resolved lazily, so no platform name is hard-coded in business paths. Baseline-preserving details worth reviewing: - build_app gains an optional default_response_class (default = baseline FastAPI behaviour) used only by the single-process entry for safe JSON serialisation (Issues #684/#818). - Verify-token / login-whitelist gates are card-derived while keeping the baseline status codes and the downstream config_store.verify_token call. - get_user_github_token_with_refresh is kept as an arch-native compatibility symbol (two baseline tests patch it) but delegates to the generic resolver and keeps the baseline PAT early-return semantics. - QA conclusion gate (#1739/#1963): baseline port is authoritative (blocked issues stage to pending_review); the stale src.user import in the baseline annotation path is repaired to the canonical module and the provider is derived from repo_key. - Tests: module paths adapted to the arch layout (rename table 4ebe33b7b..1938d6591), duplicate guard helpers collapsed to the baseline definition, and expectations updated only where the baseline deliberately changed behaviour (documented inline). Baseline sync notes (13c6d0979): the AtomCode engine (cards/backends/_BACKENDS entry), its CI job and the ACP safe-termination wrapper are taken from the baseline; our provider-derived token resolution in executor/agent and the pytest guard around engine termination are re-applied on top. Verification (isolated, one file per run, unshare + private tmpfs): - platform cards: test_platform_card_matrix 28P, test_s3_card_driven_resources 21P, test_platform_onboarding_acceptance 11P, test_platform_whitelist_ratchet 4P, test_s115_platform_gate_closure 16P, test_s120_agent_chain_credentials 6P - identity/accounts: test_d105_batch2_account_uuid_pk 7P, test_d105_uuid_pk_migration 4P, test_account_fk_user_id_text_migration 10P, test_schema_fk_type_invariant 4P, test_user_accounts_write_freeze_guard 2P, test_uc42_system_credentials 11P, test_uc42b_retirement 5P - provider-generic tokens: test_multi_platform_decouple_step1 9P, test_s73_family_closure 3P, test_login_provider 21P, test_repos_host_provider 7P, test_issue_372_round8_audit 13P (2 baseline pre-existing failures, unchanged), test_probe_github_hooks_404 3P (3 pre-existing, unchanged) - delivery/pipeline: test_issue_1739_qa_close_gate 52P, test_d29_comment_delivery_card_driven 8P, test_issue_1668 16P, test_issue_1770_a2a_dispatch_guard 17P+1XPASS, test_port_qa_gate_p1 7P, test_port_p2_acceptance 7P, test_result_post_policy 38P - engine: test_atomcode_runtime 39P, test_kill_stale_engine_no_tty 3P/2F (identical to baseline), test_issue_1811 6P - VCS API: test_git_repo_api 69P+1xfail; live end-to-end on a verification instance: issue create/comment/close and pull create/comment/close against gitcode and github repositories (7/7 each) Docs: docs/weekly-09/multi-platform-decouple/ (design + UC mapping), platform card schema in configs/platforms/SCHEMA.md. Scope of this MR (narrowed after review): - only the multi-platform decoupling work is included: platform cards and provider adapters, OAuth channel configuration, repository/credential decoupling, account system and UUID primary keys, provider-generic token resolution, plus the tests and design docs that back them - excluded on purpose: per-issue working docs (docs/issue-*), the IM engine design notes and its test suite, and the unreferenced IM adapter modules that arrived with an unrelated work stream. IM source modules that are referenced from observability/scheduler/chat wiring stay in the tree to avoid broken imports; a separate MR should move the whole IM stream out together with that wiring. Review-round fixes (squashed into this commit, PR #1231): Compliance (open-source review): - placeholder-ize internal usernames, repo names, hosts, the public IP and RDS/db capacity data across docs, source comments, dingtalk card template mockData, smoke scripts and test fixtures (example-user/example-org/example-repo, <public-host>, <worker-host>, <public-server-ip>); wecom card fallback URL is a non-routable placeholder; /root/grape doc paths become <repo-root> - configs/platforms/*.json kept as code-level default platform cards (data-driven feature core, no credentials) Guard realignment (deep review): - bump app.js cache version to 253; repoint s100/s96/s103 guard reads to the arch layout; fix the s122 src/ segment; drop now-legal domains modules from the legacy-shim blacklist; register the merged-baseline silent-except points; check-arch whitelist for the deferred kernel->domains lookups (R1), the baseline-inherited R5/R6 findings, plus canonicalizing the 4 new shim imports (same module objects) Routing fix found by the new coverage: - the im router was included after the SPA catch-all so GET /api/im/* never reached its handlers; it is now included before attach_frontend Milestone create due_on contract (three-platform live-fire finding): - GitCode/Gitee v5 upstreams require due_on on milestone create; the proxy now rejects a missing due_on with a readable 400 via the MILESTONE_DUE_ON_REQUIRED provider contract switch (no silent default date - a fabricated due date would pollute ordering/overdue reporting); GitHub stays optional; date-only coercion unchanged Verification (isolated, plus targeted regression): - platform cards: test_platform_card_matrix 28P, test_s3_card_driven 21P, test_platform_onboarding_acceptance 11P, test_platform_whitelist_ratchet 4P, test_s115 16P, test_s120 6P; identity/accounts: d105 family 25P+; token generalization: multi_platform_decouple_step1 9P, login_provider 21P - VCS API: test_git_repo_api 69P+1xfail; live end-to-end on a verification instance against gitcode and github repositories (issue create/comment/close and pull create/comment/close, 7/7 each) - review-round regression: 131 targeted tests green, scripts/check-arch.py PASS, sensitive-token sweep over the increment clean - due_on gate: tests/test_milestone_due_on_contract.py 6P; proxy contract and dialect backend suites 67P green Docs: docs/weekly-09/multi-platform-decouple/ (design + UC mapping), configs/platforms/SCHEMA.md (platform card contract). Architecture-guard round fixes (rounds 3/4, squashed into this commit): - release_pack.py: the if __name__ == "__main__" guard sat before tools_manifest_files() (script-mode run -> NameError in pack_tools); the guard now terminates the file and the duplicated trailing shebang/docstring dead block is removed; entry-order guard test added - frontend cache versions: the 16 changed page modules are bumped and a frozen-map ratchet test locks page-module ?v= values (bump must pair with a test update); app.js stays at 253 - i18n: account.js's 28 new hardcoded zh user-visible strings are keyed to app.account.* (31 new keys in zh/en app.json, sets verified equal); the || 'zh fallback' literals are dropped in dashboard/skills; a Chinese-literal ratchet freezes per-file counts (only-decrease) - credential tables renamed to the grape_t_ prefix (rule A6): repo_credentials -> grape_t_repo_credentials, system_credentials -> grape_t_system_credentials across DDL/SQL/ORM/tests/docs; both tables are introduced by this PR and no merged database carries the old names, so no rename migration is required; grape_t_credential_usage_log.credential_kind values are D100 domain labels and intentionally keep their unprefixed spelling - check-arch: the 13 new whitelist entries are registered at (file x import-target) precision (dict targets form; the string form stays legacy whole-rule for pre-existing entries), so new dependencies in the same file are no longer silently swallowed; reasons carry evidence pointers and a due Phase; the Phase 5 clearance criteria are written into docs (05-quality-infra.md); the configs/platforms exception is registered in SCHEMA.md - domain boundaries: the legacy-shim blacklist is restored to the baseline list (src.user / src.vc assertions pass on the arch tree) - milestone due_on dialect symmetry (three-platform live-fire follow up): MILESTONE_DUE_TIME_ONLY on github normalizes plain dates to T00:00:00Z (upstream 422 "not a valid date-time" otherwise); the update endpoint normalizes with the same dialect switches as create Verification: 284 targeted tests green across the guard, credential, proxy and IM suites; scripts/check-arch.py PASS; check-i18n-keys OK; node --check clean on the touched page modules. Known pre-existing reds on this line (stale guard paths / a script dropped by the port, verified identical before and after this commit): test_issue_1005, test_issue_1076, test_s118, test_uc39 (missing scripts/check_deploy_backfill.py), test_uc40 nested round9 path, test_migration_no_baseline_version_collision, s119 uc23. QA round-6 fixes (head 8be42d4c review, squashed into this commit): - conftest: the unguarded duplicate test-db deletion block is removed (it defeated the GRAPE_PYTEST_NESTED guard and re-triggered the D100 nested-run DB pollution path; the guarded import-time deletion stays) - check-arch C-1 verification: a precision guard test locks every dict-form whitelist entry to the exact set of actual kernel->domains / shim imports in that file (extra registration = stale, missing registration = new dependency fails immediately); string-form (whole-rule) entries are frozen to the pre-existing legacy set - check-destructive-ddl: coverage extended to scripts/migrations/*.py (QA M-2) with a sanctioned-channel concept - migration destructive DDL is reported as INFO (one-shot, constant-driven, reviewed per file) while db_setup rules stay unchanged; live run PASS - check-i18n-keys: module list now derives from locales/zh/*.json so every language pack is covered (QA M-3); all 19 modules validate OK - deploy_mysql_gate: database passwords travel via MYSQL_PWD env instead of -p argv (QA M-4; ps/history-visible); run_cmd gains an env pass-through and the gate tests now assert no password ever appears in argv and MYSQL_PWD is injected - migrations/002: the global_im_bot_config DROP is deferred (QA M-5) - bot_lease/feishu_async still hold lease-fallback reads against that table, so dropping it would cut the fallback chain; the report now states the deferral and db_setup DDL stays consistent with the readers Verification: 189 targeted tests green (3 pre-existing order/stale-path reds identical on the pre-change tree: s118 x2, s78 order-dependent); check-arch PASS; check-destructive-ddl PASS; check-i18n-keys all 19 modules OK; deploy_mysql_gate 20/20 with the new password assertions. Signed-off-by: xiaowu2119 <xiaowu2119@noreply.gitcode.com> | 12 days ago | |
fix(security): stop hardcoding OBS AK/SK in scripts + repo-wide secrets guard Audit finding (2026-10-21): the release-bucket Access Key / Secret Key were hardcoded in plaintext inside scripts/release_pack.py and scripts/release_admin_pack.py, and the dev-bucket pair in scripts/verify_obs_storage.py / verify_obs_skill_e2e.py. The files are tracked in the open-source branch (weekly-07-clean) and shipped inside every release package uploaded to OBS -- i.e. the credentials were effectively published, and no guard existed to catch it (check-doc-redaction.py only scans docs/** and has no key patterns; the QA compliance bot only reviews PR deltas and these files predate them). Changes: 1. scripts/obs_credentials.py (new): single place that resolves credentials at runtime -- environment first (OBS_RELEASE_AK/SK for the release bucket, OBS_ACCESS_KEY/OBS_SECRET_KEY for the runtime bucket), then a non-repo config (/etc/grape/release-obs.json, /etc/grape/grape.env). If nothing is found it raises with instructions: no silent fallback, no placeholder values, and never 'upload anyway'. 2. release_pack.py / release_admin_pack.py: build the obsutil argv from the resolved credentials; abort with a clear message when they are missing. 3. verify_obs_storage.py / verify_obs_skill_e2e.py: inject the runtime OBS config instead of literal keys. 4. scripts/check-secrets.py (new): repo-wide plaintext-key scanner (Huawei AK/SK, AWS AK/SK, GitHub tokens, private-key blocks, explicit key assignments). Scans git-tracked files by default, masks matched values in its output, supports an inline 'secrets-check: allow' escape hatch. 5. check-all.sh: run the docs-redaction and secrets checks together. Verified: - scripts/check-secrets.py -> OK on all 1419 tracked files (0 hits) - resolved credentials work against the real bucket (obsutil ls, read-only) - missing credentials produce an explicit error instead of a silent upload Note: the two exposed pairs must still be rotated/revoked at the console (purging them from git history of a public branch is a separate decision). Credentials now live outside the repo: /etc/grape/release-obs.json (0600). Signed-off-by: liufei_cloud <gcw_3FZApeLT@noreply.gitcode.com> | 1 month ago | |
bugfix and promote response Co-authored-by: songspace<songspace@grape.dev> Co-authored-by: lvjuntao<jentle_81@163.com> | 8 days ago | |
fix(#2524): scan_pgconn 模块环境不再收集函数体赋值(消除作用域混叠),改显式参数来源传播 + 函数内别名导入识别;同步基线(总量 282 不变,分布修正) | 8 days ago | |
fix(issue-3580): resolve default branch for gitlab and persist the whole card Verified against a real gitlab.com project, which surfaced three defects. 1. ref=HEAD does not exist upstream. GitLab's /repository/tree and /repository/files only accept a real branch, tag or commit; HEAD answers 404 Tree/Commit Not Found. The gateway now resolves the default branch for the hooks dialect family (gitlab reads the project's default_branch instead of branches[0], which is not guaranteed to be the default) and the root contents / file handlers do the same when ref is empty, instead of handing HEAD to the upstream. 2. The admin card writer dropped capability fields. The hand-maintained whitelist in PUT /api/admin/vcs-platforms was missing webhook_dialect and ca_bundle, so a self-hosted instance written through the admin API lost its webhook family (hosting then fails closed with "webhook dialect not declared") and its private CA, with no error anywhere. The card is now persisted from dataclasses.asdict with only provider/overrides renamed; empty capabilities are dropped and non-empty ones converted to a list, because the value object keeps them as a tuple and the builder only accepts None/[] (the same request rebuilds the card to write bot tokens, so a tuple rejected the whole card). 3. The probe treated legitimate empty-repo 404s as failures. A project with empty_repo=true 404s on tree/files by design; those are now SKIP with an explanation, and the probe resolves the default branch from the project list before reading (no HEAD). Verified on gitlab.com with a real project access token: probe reports six PASS lines (token, repos, tree, file, hook dry-run, CA), the product gateway returns normalised tree/root/file payloads with ref empty (base64 content of the seeded README), and a live admin write of a two-field card stores source=manual with webhook_dialect=gitlab_v4 and ca_bundle set; after a restart the row is untouched by the importer and the instance is still listed in /settings/vcs/platforms with the card rebuilt from the table. Tests: probe gains an empty-repo SKIP case and the gitlab path tests gain the default-branch resolution for tree/root/file; the admin card test now asserts the row carries webhook_dialect and a non-empty branch_create_form. Observed, pre-existing and out of scope: gitcode/gitlab config rows carry branch_create_form='' (their card files do not declare it), which makes the table+file card merge log a warning and fall back to the file card. Signed-off-by: yangaiwu <org-b@users.noreply.gitcode.com> | 3 days ago | |
fix(qa): close the 7 findings from the PR #1602 guard review QA 在 head 51cd0d18e 上逐项实跑,列出 7 项整改。全部有可复现证据,逐条修: configs/table_ownership.json 成为唯一权威后,运行期与主检查器都走 load_owner_json,但这条链上还有 5 个脚本仍在用 TSV 解析器(按 schema\ttable 切行)读 JSON —— JSON 没有制表符,解析结果恒为空,于是: scripts/rds_gate.sh:18 --owner(TSV)→ 归属为空 → 23 对基线全判「清零」 → 恒打印 OK = 守卫被掏空。改 --owner-json。 scripts/gen_domain_dependency_board.py:32 路径指向 docs/weekly-11/table_ownership.json(404) → rds_gate 的 P3 步直接 FileNotFoundError。 路径改 configs/,:60 改 load_owner_json。 scripts/rds_burndown.py:44 load_owner → load_owner_json scripts/rds_burndown.py:79 同一 404 路径 → 改用 OWNER 常量 scripts/rds_next_batch.py:73 load_owner → load_owner_json scripts/split_schema_ddl.py:36 自带 TSV 行解析 → 读 JSON scripts/split_migration_sql.py:107 同上 修完实测(改前全是 0 / 崩溃): rds_gate --quick 剩余跨域 SQL 62 处 / 20 张表(改前静默 0) rds_burndown RESULT: 未清零(静态 62 / 运行 0) rds_next_batch 输出真实候选文件清单 split_schema_ddl --dry-run 可搬 DDL 常量 2 个(改前 0) split_migration_sql --dry-run 输出真实迁移待搬清单(改前 0) B-2 FROZEN index.html:app.js 冻结 273、实际 274(bump 时漏改登记)。改 274。 B-1 i18n 语言包指纹:tasks.json 的 tag_* 去掉 <b></b> 前缀后内容变了,但 LOCALE_FINGERPRINT 仍是 base 的值。按守卫同款算法(sha256,{lang}/{name}: + 文件字节,无分隔符)实算 42 个语言包 = a241ecb4b93db836,与 QA 数值一致。 同时四页 cacheVer 各升一档并同步 CACHE_VER —— 只改指纹能让守卫变绿,但老 客户端仍会命中浏览器里的旧 JSON,本次文案修正对存量用户不生效: index.html 63 → 64 admin.html 20261117-3 → 20261117-4 register.html 49 → 50 forgot.html 49 → 50 顺带重算了因为 owner 解析恢复而变化的两个基线:dependency-matrix/board 重新生成, cross-domain-reads 与 foreign-refs 基线收紧(62 refs / 23 pairs)。 门禁:check-arch PASS · make lint exit=0 · 242 passed(arch+contracts+scripts+ ownership+migration_guard+两个前端守卫)。 未处理(QA 明示不判本 PR,属基线红):scan_pgconn.py --check 的 5 处上升, base 与 head 同红同清单。 | 5 days ago | |
docs(db): record the merge-gate-log duplicate cleanup in production grape_t_merge_gate_log is the audit trail of the PR merge gate (pre_merge_qa, pre_merge and post_merge decisions) written best-effort by insight public. Both production copies were empty, so the runtime duplicate was backed up to /home/grape/merge-gate-log-runtime-copy-backup-20261115.sql and dropped, leaving insight as the single owner. The ownership guard now reports should_skip(...,runtime)=True and should_skip(...,insight)=False, so no other process will recreate it. | 8 days ago | |
fix(qa): close the 7 findings from the PR #1602 guard review QA 在 head 51cd0d18e 上逐项实跑,列出 7 项整改。全部有可复现证据,逐条修: configs/table_ownership.json 成为唯一权威后,运行期与主检查器都走 load_owner_json,但这条链上还有 5 个脚本仍在用 TSV 解析器(按 schema\ttable 切行)读 JSON —— JSON 没有制表符,解析结果恒为空,于是: scripts/rds_gate.sh:18 --owner(TSV)→ 归属为空 → 23 对基线全判「清零」 → 恒打印 OK = 守卫被掏空。改 --owner-json。 scripts/gen_domain_dependency_board.py:32 路径指向 docs/weekly-11/table_ownership.json(404) → rds_gate 的 P3 步直接 FileNotFoundError。 路径改 configs/,:60 改 load_owner_json。 scripts/rds_burndown.py:44 load_owner → load_owner_json scripts/rds_burndown.py:79 同一 404 路径 → 改用 OWNER 常量 scripts/rds_next_batch.py:73 load_owner → load_owner_json scripts/split_schema_ddl.py:36 自带 TSV 行解析 → 读 JSON scripts/split_migration_sql.py:107 同上 修完实测(改前全是 0 / 崩溃): rds_gate --quick 剩余跨域 SQL 62 处 / 20 张表(改前静默 0) rds_burndown RESULT: 未清零(静态 62 / 运行 0) rds_next_batch 输出真实候选文件清单 split_schema_ddl --dry-run 可搬 DDL 常量 2 个(改前 0) split_migration_sql --dry-run 输出真实迁移待搬清单(改前 0) B-2 FROZEN index.html:app.js 冻结 273、实际 274(bump 时漏改登记)。改 274。 B-1 i18n 语言包指纹:tasks.json 的 tag_* 去掉 <b></b> 前缀后内容变了,但 LOCALE_FINGERPRINT 仍是 base 的值。按守卫同款算法(sha256,{lang}/{name}: + 文件字节,无分隔符)实算 42 个语言包 = a241ecb4b93db836,与 QA 数值一致。 同时四页 cacheVer 各升一档并同步 CACHE_VER —— 只改指纹能让守卫变绿,但老 客户端仍会命中浏览器里的旧 JSON,本次文案修正对存量用户不生效: index.html 63 → 64 admin.html 20261117-3 → 20261117-4 register.html 49 → 50 forgot.html 49 → 50 顺带重算了因为 owner 解析恢复而变化的两个基线:dependency-matrix/board 重新生成, cross-domain-reads 与 foreign-refs 基线收紧(62 refs / 23 pairs)。 门禁:check-arch PASS · make lint exit=0 · 242 passed(arch+contracts+scripts+ ownership+migration_guard+两个前端守卫)。 未处理(QA 明示不判本 PR,属基线红):scan_pgconn.py --check 的 5 处上升, base 与 head 同红同清单。 | 5 days ago | |
chore(scripts): add the burndown driver loop and per-batch worklist The remaining references are dynamic SQL and migration logic that no mechanical rewrite can absorb, so the loop keeps a single source of truth instead: each round checks the gate, prints the remaining count, regenerates a worklist naming the top files with their foreign tables, line numbers and whether the owner domain already exposes named queries, then waits for the next batch. ROUNDS=1 runs one pass for CI or a manual trigger. | 9 days ago | |
fix(qa): close the 2 Critical + 2 Medium from the guard re-review head b95f3cd74 的定向重查:前轮 7 项全部关闭,本轮新发现 2 Critical + 2 Medium + 4 Info。 ensure_runtime_type_info_columns.py 用 session_manager.db(进程库)执行 ALTER, scan_pgconn.py --check 净新增 1 处。没有去 --update-baseline 放宽基线,而是消除它: 改用 db_registry.connection_for("runtime") 取 owner 库连接(kernel 层可 import, 不必绕 api 层的 _migration_conn),三库未启用时回落进程库。 实测 scan_pgconn.py --check:该文件已不在上升清单,剩余 6 条全是 base 存量 (a2a_repo_scope / engine_select / health_scorer / service / notify / runtime.py), QA 明示不溯及本 PR。 rds_next_batch.py:113 与 split_migration_sql.py:29 生成的「每批验收口径」命令仍是 foreign_table_refs.py --owner configs/table_ownership.json --check —— --owner 是 TSV 解析器,喂 JSON 归属恒空 → 输出「23 项下降/清零 OK」且 exit 0,真实 62 处跨域引用零检查。 这与 rds_gate.sh:18 的注释「必须用 --owner-json」直接矛盾:守卫自己修了,但它**教给 下一批人的命令**还是错的。两处文案改 --owner-json 并写明原因。 QA 指出:grape_t_guard_check/grape_t_guard_finding 全仓零引用,而同类的 admin_user_role_rel / sandbox_whitelist / template_usage 被移入「不算在用」段。 实查后**不移**,因为判据不是「本仓 grep 命中」而是「是否仍在被活跃写入」: grape_t_guard_check insight 实存 1412 行,checked_at 2026-11-17T11:18:38 ~ 2026-11-18T17:32:29 grape_t_guard_finding insight 实存 2621 行,同区间,最新 2026-11-18T17:32:29 列名即用途:role / unit_active / unit_restarts / pid / port_listening / health_code / db_name / expected_tables / actual_tables / missing_tables / foreign_tables → 外部巡检守护按角色巡检进程/端口/健康码/库表一致性,写入方在本仓代码之外 核对时刻 2 分钟前仍有写入 移入 _not_in_current_schema 会让归属检查放过真实的跨域引用。改为在 json 新增 _provenance 段记录来源、活跃证据、列语义与裁决理由,供后续复核(QA 说 「INSUFFICIENT DATA TO VERIFY」正因缺这份证据)。tables 段仍是 139 条,未增删。 三处定义统一为 VARCHAR(32) NOT NULL DEFAULT 'local' / TEXT (db_setup 的 _ensure_column、schema_ddl 的 DDL、迁移 202611180002)。 只影响新建库路径;存量库已是 varchar(64) NOT NULL DEFAULT '',两者对 'local'/'sandbox' 等价,无需 ALTER。 I-1 check-arch.py:75 注释自相矛盾(「json 已并入并删除」→ 实为 tsv 已并入 json 后删除) I-2 issue_ident_columns.py docstring 仍以已删除的 tsv 为口径来源,改为 JSON 权威 I-3 sync_to_sibling.sh 口令从 sshpass -p(进 argv,ps 可见)改 sshpass -e(SSHPASS 环境变量);内网默认值加注「开源分发时由部署方覆盖」 I-4 rds_next_batch.py 变量名 OWNER_TSV 指向 JSON → 改 OWNER_JSON 顺带修掉自己引入的一处静默 except(commit 失败被 pass 吞掉 → 改为 warning 留痕, silent-except 棘轮因此回绿),并重算 cross-domain-reads / foreign-refs 基线。 门禁:check-arch PASS · make lint exit=0 · 242 passed。 | 5 days ago | |
docs(compliance): keep internal hosts, paths and credentials out of the repository Open-source review of this branch reported that the table ownership record and a few maintenance scripts carried deployment details: internal host addresses, absolute backup and instance paths, and a default staging database password. Changes: * configs/table_ownership_notes.md is rewritten as a code-level decision record. It keeps the authority (docs/weekly-11/table-owner.tsv), the derivation rules, the fourteen table decisions, the DDL relocation and the owner-connection design, and drops the environment topology, backup file names, data row counts and cleanup ledger. A maintenance rule now states that this file must not describe environments. * scripts/p4_p5_loop.sh no longer ships a default staging password and no longer hardcodes the remote MySQL instance directory: STAGE_DB_PWD and REMOTE_RDS_HOME must come from the environment and fail fast when unset. * scripts/rds_p4_provision.py replaces internal host literals in its usage examples with placeholders; the source host defaults to loopback and stays overridable via --source-host. * scripts/probe/nginx_probe.py reads its probe targets from the PROBE_NODES environment variable (JSON array) and defaults to a single loopback target; deployment paths in the docstring are placeholders. * scripts/migrate_chat_cwd.py documents a placeholder data root instead of an absolute user path. Verification: a scan of every tracked file under configs/ and scripts/ for internal address ranges, absolute deployment paths and the staging password now returns nothing; tests/scripts, tests/arch and the ownership tests pass (94 passed); bash -n and py_compile are clean on the touched scripts. | 8 days ago | |
docs(db): record the merge-gate-log duplicate cleanup in production grape_t_merge_gate_log is the audit trail of the PR merge gate (pre_merge_qa, pre_merge and post_merge decisions) written best-effort by insight public. Both production copies were empty, so the runtime duplicate was backed up to /home/grape/merge-gate-log-runtime-copy-backup-20261115.sql and dropped, leaving insight as the single owner. The ownership guard now reports should_skip(...,runtime)=True and should_skip(...,insight)=False, so no other process will recreate it. | 8 days ago | |
grape kit adapter & plugin market Co-authored-by: zrr<zrr@local> Co-authored-by: grape_bot<grape_bot@noreply.git.com> Co-authored-by: my_grape_bot<my_grape_bot@noreply.git.com> Co-authored-by: zrr000212<zrr000212@noreply.gitcode.com> | 3 days ago | |
grape kit adapter & plugin market Co-authored-by: zrr<zrr@local> Co-authored-by: grape_bot<grape_bot@noreply.git.com> Co-authored-by: my_grape_bot<my_grape_bot@noreply.git.com> Co-authored-by: zrr000212<zrr000212@noreply.gitcode.com> | 3 days ago | |
fix(security): stop hardcoding OBS AK/SK in scripts + repo-wide secrets guard Audit finding (2026-10-21): the release-bucket Access Key / Secret Key were hardcoded in plaintext inside scripts/release_pack.py and scripts/release_admin_pack.py, and the dev-bucket pair in scripts/verify_obs_storage.py / verify_obs_skill_e2e.py. The files are tracked in the open-source branch (weekly-07-clean) and shipped inside every release package uploaded to OBS -- i.e. the credentials were effectively published, and no guard existed to catch it (check-doc-redaction.py only scans docs/** and has no key patterns; the QA compliance bot only reviews PR deltas and these files predate them). Changes: 1. scripts/obs_credentials.py (new): single place that resolves credentials at runtime -- environment first (OBS_RELEASE_AK/SK for the release bucket, OBS_ACCESS_KEY/OBS_SECRET_KEY for the runtime bucket), then a non-repo config (/etc/grape/release-obs.json, /etc/grape/grape.env). If nothing is found it raises with instructions: no silent fallback, no placeholder values, and never 'upload anyway'. 2. release_pack.py / release_admin_pack.py: build the obsutil argv from the resolved credentials; abort with a clear message when they are missing. 3. verify_obs_storage.py / verify_obs_skill_e2e.py: inject the runtime OBS config instead of literal keys. 4. scripts/check-secrets.py (new): repo-wide plaintext-key scanner (Huawei AK/SK, AWS AK/SK, GitHub tokens, private-key blocks, explicit key assignments). Scans git-tracked files by default, masks matched values in its output, supports an inline 'secrets-check: allow' escape hatch. 5. check-all.sh: run the docs-redaction and secrets checks together. Verified: - scripts/check-secrets.py -> OK on all 1419 tracked files (0 hits) - resolved credentials work against the real bucket (obsutil ls, read-only) - missing credentials produce an explicit error instead of a silent upload Note: the two exposed pairs must still be rotated/revoked at the console (purging them from git history of a public branch is a separate decision). Credentials now live outside the repo: /etc/grape/release-obs.json (0600). Signed-off-by: liufei_cloud <gcw_3FZApeLT@noreply.gitcode.com> | 1 month ago | |
fix(release-pack): address arch-guardian F1-F4 on three-db dumps F1: enumerate BASE TABLE only (SHOW FULL TABLES WHERE Table_type='BASE TABLE'); views exported separately as grape-db-<ts>-<domain>-views.sql.gz with DROP VIEW + CREATE VIEW (DEFINER stripped), never DROP TABLE / INSERT INTO a view. F2: seed routing by configs/table_ownership.json (skill/agent_type/scene_category/ global_im_bot_config/agent_type_runtime_pool -> runtime; meta keys -> runtime). F3: DB connect timeout reuses project convention src/kernel/mysql_compat.py (10s), overridable via GRAPE_PACK_DB_CONNECT_TIMEOUT; measured 7.8-10ms on dev build-007. F4: dedupe table enumeration (agent_type_runtime_pool appeared twice). Also: mask host in pack log and SQL file headers (compliance 1.1-1-5); self-check gains a "no views mixed into base dumps" gate; INSTALL.md documents base->views order. | 1 day ago | |
fix(review): align the cloud executor and guard the redaction boundary The cloud sandbox executor derived the repository platform from the bare full name, which is the value the dispatch side strips the provider prefix from, and an unprefixed value defaults to gitcode in the repository key parser. Gitee and github repositories were therefore cloned from the wrong host there, and the token environment name fell back to the gitcode one. The executor now prefers the prefixed key, in the same order as the sandbox context, with the bare name kept for runbook URLs, and a scenario pins the ordering. The remaining review findings were documentation hygiene: a real account name, real database names, a developer home path and a backup directory appeared in the design notes, the repair script usage and six test fixtures. They are replaced with placeholders and a neutral account. A ratchet now scans only the files this branch changed for those real identifiers, so pre-existing history is not blamed on this work while a new violation fails, and requirements and the design note state the platform rule, the placeholder vocabulary and why the ordering matters. Verification, one file per pytest invocation, deployment virtualenv: - tests/runtime/test_sandbox_clone_provider.py 6 passed - tests/arch/test_public_docs_redaction.py 1 passed - tests/kernel/test_project_info.py 10 passed - tests/api/test_issue_3713_dual_entry_credential.py 10 passed - tests/api/test_repo_credential_empty_semantics.py 4 passed - tests/kernel/test_issue_3713_action_handler_level.py 4 passed - tests/runtime/test_issue_3713_task_credential_stage.py 12 passed - tests/runtime/test_clone_endpoint_multiplatform.py 25 passed - tests/runtime/test_clone_identity_dynamic.py 13 passed Signed-off-by: grape-bot <bot@grapedev.cn> | 1 day ago | |
fix: #699 address Phase 2 review comments (prefix strip, schema_mode alignment, placeholder, logging) | 20 days ago | |
refactor: #699 reorganize src/ into domains (mgmt/runtime/insight/contracts) with re-export shims | 20 days ago | |
refactor: #2010 group src top-level modules into responsibility subpackages Move the 19 flat top-level modules into src/repos, src/authn, src/help and src/infra with git mv (history preserved), add package __init__ files and keep src/ top level limited to __init__.py plus subpackage directories. Old top-level paths (src.config, src.lock, ...) stay importable through a lazy alias layer registered in src/__init__.py; aliases resolve to the same module objects, so import, monkeypatch and attribute assignment semantics are unchanged. Sync internal imports to canonical modules and update worker packaging manifest, release packaging, code version fingerprint, architecture checks and tests. | 12 days ago | |
bugfix and promote response Co-authored-by: songspace<songspace@grape.dev> Co-authored-by: lvjuntao<jentle_81@163.com> | 8 days ago | |
feat: #3202 skill card layout, tag tiers and metadata PATCH | 4 days ago | |
fix(#2524): scan_pgconn 模块环境不再收集函数体赋值(消除作用域混叠),改显式参数来源传播 + 函数内别名导入识别;同步基线(总量 282 不变,分布修正) | 8 days ago | |
feat(vcs): multi-platform decoupling with card-driven OAuth and repo credentials Baseline: arch-weekly-11 (13c6d0979). All conflicts resolved in favour of the baseline; weekly-10 capabilities are re-implemented on top of the arch layout instead of being restored verbatim, so the baseline behaviour is preserved. Capabilities delivered (design/use-case docs under docs/weekly-09/multi-platform-decouple): - OAuth platform configuration: login channels are driven by meta.oauth_providers_config (card JSON) plus oauth_<p>_client_id/secret, the login page renders the configured channels (gitcode/github/gitee/huawei) and degrades to the "unconfigured" hint instead of hiding providers. - Repository support is configurable and decoupled from OAuth: platform cards (configs/platforms/*.json + vcs_providers_config) declare host, dialect, API auth, webhook verification, clone auth, storage fields and resource mapping. Repository credentials live in repo_credentials (repo_key x cred_type, UNIQUE contract) and are resolved through repo_key_candidates / get_platform_card, never through login identities. - Onboarding a new platform is a card-only change: registry, webhook, verification token, resource adapter, credential family and bot identity are all derived from the card (UC65 acceptance lock, including the negative case "no card, no onboarding"). - Account system on grape_accounts only: user_accounts is a retired dead table (zero writes, 10 deprecated write helpers removed), identity binding goes through external_identities, and account ids are UUID (D105/D105b). - ITX/VCS related primary keys are UUID/TEXT: issue, session token, account FK, credential and event ids use uuid7 with explicit generation (no raw INSERT + lastrowid in uuid domains). - Provider-generic token resolution (D37/S57): call sites derive the provider from repo_key or the platform card; the arch-specific legacy symbols are declared per card (legacy_token_symbol) and resolved lazily, so no platform name is hard-coded in business paths. Baseline-preserving details worth reviewing: - build_app gains an optional default_response_class (default = baseline FastAPI behaviour) used only by the single-process entry for safe JSON serialisation (Issues #684/#818). - Verify-token / login-whitelist gates are card-derived while keeping the baseline status codes and the downstream config_store.verify_token call. - get_user_github_token_with_refresh is kept as an arch-native compatibility symbol (two baseline tests patch it) but delegates to the generic resolver and keeps the baseline PAT early-return semantics. - QA conclusion gate (#1739/#1963): baseline port is authoritative (blocked issues stage to pending_review); the stale src.user import in the baseline annotation path is repaired to the canonical module and the provider is derived from repo_key. - Tests: module paths adapted to the arch layout (rename table 4ebe33b7b..1938d6591), duplicate guard helpers collapsed to the baseline definition, and expectations updated only where the baseline deliberately changed behaviour (documented inline). Baseline sync notes (13c6d0979): the AtomCode engine (cards/backends/_BACKENDS entry), its CI job and the ACP safe-termination wrapper are taken from the baseline; our provider-derived token resolution in executor/agent and the pytest guard around engine termination are re-applied on top. Verification (isolated, one file per run, unshare + private tmpfs): - platform cards: test_platform_card_matrix 28P, test_s3_card_driven_resources 21P, test_platform_onboarding_acceptance 11P, test_platform_whitelist_ratchet 4P, test_s115_platform_gate_closure 16P, test_s120_agent_chain_credentials 6P - identity/accounts: test_d105_batch2_account_uuid_pk 7P, test_d105_uuid_pk_migration 4P, test_account_fk_user_id_text_migration 10P, test_schema_fk_type_invariant 4P, test_user_accounts_write_freeze_guard 2P, test_uc42_system_credentials 11P, test_uc42b_retirement 5P - provider-generic tokens: test_multi_platform_decouple_step1 9P, test_s73_family_closure 3P, test_login_provider 21P, test_repos_host_provider 7P, test_issue_372_round8_audit 13P (2 baseline pre-existing failures, unchanged), test_probe_github_hooks_404 3P (3 pre-existing, unchanged) - delivery/pipeline: test_issue_1739_qa_close_gate 52P, test_d29_comment_delivery_card_driven 8P, test_issue_1668 16P, test_issue_1770_a2a_dispatch_guard 17P+1XPASS, test_port_qa_gate_p1 7P, test_port_p2_acceptance 7P, test_result_post_policy 38P - engine: test_atomcode_runtime 39P, test_kill_stale_engine_no_tty 3P/2F (identical to baseline), test_issue_1811 6P - VCS API: test_git_repo_api 69P+1xfail; live end-to-end on a verification instance: issue create/comment/close and pull create/comment/close against gitcode and github repositories (7/7 each) Docs: docs/weekly-09/multi-platform-decouple/ (design + UC mapping), platform card schema in configs/platforms/SCHEMA.md. Scope of this MR (narrowed after review): - only the multi-platform decoupling work is included: platform cards and provider adapters, OAuth channel configuration, repository/credential decoupling, account system and UUID primary keys, provider-generic token resolution, plus the tests and design docs that back them - excluded on purpose: per-issue working docs (docs/issue-*), the IM engine design notes and its test suite, and the unreferenced IM adapter modules that arrived with an unrelated work stream. IM source modules that are referenced from observability/scheduler/chat wiring stay in the tree to avoid broken imports; a separate MR should move the whole IM stream out together with that wiring. Review-round fixes (squashed into this commit, PR #1231): Compliance (open-source review): - placeholder-ize internal usernames, repo names, hosts, the public IP and RDS/db capacity data across docs, source comments, dingtalk card template mockData, smoke scripts and test fixtures (example-user/example-org/example-repo, <public-host>, <worker-host>, <public-server-ip>); wecom card fallback URL is a non-routable placeholder; /root/grape doc paths become <repo-root> - configs/platforms/*.json kept as code-level default platform cards (data-driven feature core, no credentials) Guard realignment (deep review): - bump app.js cache version to 253; repoint s100/s96/s103 guard reads to the arch layout; fix the s122 src/ segment; drop now-legal domains modules from the legacy-shim blacklist; register the merged-baseline silent-except points; check-arch whitelist for the deferred kernel->domains lookups (R1), the baseline-inherited R5/R6 findings, plus canonicalizing the 4 new shim imports (same module objects) Routing fix found by the new coverage: - the im router was included after the SPA catch-all so GET /api/im/* never reached its handlers; it is now included before attach_frontend Milestone create due_on contract (three-platform live-fire finding): - GitCode/Gitee v5 upstreams require due_on on milestone create; the proxy now rejects a missing due_on with a readable 400 via the MILESTONE_DUE_ON_REQUIRED provider contract switch (no silent default date - a fabricated due date would pollute ordering/overdue reporting); GitHub stays optional; date-only coercion unchanged Verification (isolated, plus targeted regression): - platform cards: test_platform_card_matrix 28P, test_s3_card_driven 21P, test_platform_onboarding_acceptance 11P, test_platform_whitelist_ratchet 4P, test_s115 16P, test_s120 6P; identity/accounts: d105 family 25P+; token generalization: multi_platform_decouple_step1 9P, login_provider 21P - VCS API: test_git_repo_api 69P+1xfail; live end-to-end on a verification instance against gitcode and github repositories (issue create/comment/close and pull create/comment/close, 7/7 each) - review-round regression: 131 targeted tests green, scripts/check-arch.py PASS, sensitive-token sweep over the increment clean - due_on gate: tests/test_milestone_due_on_contract.py 6P; proxy contract and dialect backend suites 67P green Docs: docs/weekly-09/multi-platform-decouple/ (design + UC mapping), configs/platforms/SCHEMA.md (platform card contract). Architecture-guard round fixes (rounds 3/4, squashed into this commit): - release_pack.py: the if __name__ == "__main__" guard sat before tools_manifest_files() (script-mode run -> NameError in pack_tools); the guard now terminates the file and the duplicated trailing shebang/docstring dead block is removed; entry-order guard test added - frontend cache versions: the 16 changed page modules are bumped and a frozen-map ratchet test locks page-module ?v= values (bump must pair with a test update); app.js stays at 253 - i18n: account.js's 28 new hardcoded zh user-visible strings are keyed to app.account.* (31 new keys in zh/en app.json, sets verified equal); the || 'zh fallback' literals are dropped in dashboard/skills; a Chinese-literal ratchet freezes per-file counts (only-decrease) - credential tables renamed to the grape_t_ prefix (rule A6): repo_credentials -> grape_t_repo_credentials, system_credentials -> grape_t_system_credentials across DDL/SQL/ORM/tests/docs; both tables are introduced by this PR and no merged database carries the old names, so no rename migration is required; grape_t_credential_usage_log.credential_kind values are D100 domain labels and intentionally keep their unprefixed spelling - check-arch: the 13 new whitelist entries are registered at (file x import-target) precision (dict targets form; the string form stays legacy whole-rule for pre-existing entries), so new dependencies in the same file are no longer silently swallowed; reasons carry evidence pointers and a due Phase; the Phase 5 clearance criteria are written into docs (05-quality-infra.md); the configs/platforms exception is registered in SCHEMA.md - domain boundaries: the legacy-shim blacklist is restored to the baseline list (src.user / src.vc assertions pass on the arch tree) - milestone due_on dialect symmetry (three-platform live-fire follow up): MILESTONE_DUE_TIME_ONLY on github normalizes plain dates to T00:00:00Z (upstream 422 "not a valid date-time" otherwise); the update endpoint normalizes with the same dialect switches as create Verification: 284 targeted tests green across the guard, credential, proxy and IM suites; scripts/check-arch.py PASS; check-i18n-keys OK; node --check clean on the touched page modules. Known pre-existing reds on this line (stale guard paths / a script dropped by the port, verified identical before and after this commit): test_issue_1005, test_issue_1076, test_s118, test_uc39 (missing scripts/check_deploy_backfill.py), test_uc40 nested round9 path, test_migration_no_baseline_version_collision, s119 uc23. QA round-6 fixes (head 8be42d4c review, squashed into this commit): - conftest: the unguarded duplicate test-db deletion block is removed (it defeated the GRAPE_PYTEST_NESTED guard and re-triggered the D100 nested-run DB pollution path; the guarded import-time deletion stays) - check-arch C-1 verification: a precision guard test locks every dict-form whitelist entry to the exact set of actual kernel->domains / shim imports in that file (extra registration = stale, missing registration = new dependency fails immediately); string-form (whole-rule) entries are frozen to the pre-existing legacy set - check-destructive-ddl: coverage extended to scripts/migrations/*.py (QA M-2) with a sanctioned-channel concept - migration destructive DDL is reported as INFO (one-shot, constant-driven, reviewed per file) while db_setup rules stay unchanged; live run PASS - check-i18n-keys: module list now derives from locales/zh/*.json so every language pack is covered (QA M-3); all 19 modules validate OK - deploy_mysql_gate: database passwords travel via MYSQL_PWD env instead of -p argv (QA M-4; ps/history-visible); run_cmd gains an env pass-through and the gate tests now assert no password ever appears in argv and MYSQL_PWD is injected - migrations/002: the global_im_bot_config DROP is deferred (QA M-5) - bot_lease/feishu_async still hold lease-fallback reads against that table, so dropping it would cut the fallback chain; the report now states the deferral and db_setup DDL stays consistent with the readers Verification: 189 targeted tests green (3 pre-existing order/stale-path reds identical on the pre-change tree: s118 x2, s78 order-dependent); check-arch PASS; check-destructive-ddl PASS; check-i18n-keys all 19 modules OK; deploy_mysql_gate 20/20 with the new password assertions. Signed-off-by: xiaowu2119 <xiaowu2119@noreply.gitcode.com> | 12 days ago | |
fix(mgmt): harden the credential rebuild and unblock PAT-only platform lists Two review rounds against arch-weekly-11 left two independent defect groups with the same outcome: credentials or repositories silently invisible. They are combined into one commit because they sit on the same base and were verified together. Credential rebuild (migrations 202611170007 / 202611170008): - Every early return now audits leftover tables and raises instead of returning, so a half swap (live table gone, backup or scratch table still holding rows) is no longer mistaken for a fresh install and stamped. - The SQLite two-step RENAME re-checks each step, and the swap is followed by a structural check of the unique key, because _destructive_ddl swallows every non-MDL failure and reports success. - A strict gate refuses to rebuild when meta.min_code_version is unset or this instance is behind it (GRAPE_ALLOW_UNGUARDED_CLEANUP=1 for single-node and test environments). The shared _destructive_ddl default is untouched, so historical migrations keep their behaviour. - The post-swap check compares table content (decrypted), not row counts: an OAuth refresh during the window overwrites config_json without changing the row count, and the same rule protects the early-exit path. - The kind backfill runs before every early return, and a new migration 202611170008 re-runs it on databases where an older 007 was already stamped. 008 skips while the unique key still lacks kind, and the backfill rolls back its failed transaction. - The rebuild DDL and the CREATE TABLE definition use VARCHAR(191) with literal defaults, which keeps the defaults on MySQL at any version. - scripts/check-destructive-ddl.py now classifies table-level forms too, and docs/issue-536/task.md moves the min_code_version write into the write-stop window, before the restart. Repository visibility: - Saving a new platform token goes through platform_tokens, whose key ends in _tokens, so the cache-invalidation check that only looked for <p>_token / <p>_pat never fired and /api/repos/member kept serving the stale snapshot for its 30-minute TTL. - The project lobby derives platform tabs from the repositories actually present, with identity bindings kept as the fallback for an empty list, so a PAT-only platform gets a tab instead of hiding behind pagination. - The generic provider port returns created_at, so card-driven platforms no longer sort to the bottom of the lobby. - app.js no longer reads b.provider off an array of provider strings. - The strict gate no longer dead-ends mirror deployments: current_code_version honours GRAPE_DEPLOY_VERSION, and set_min_code_version accepts an fp- fingerprint so a no-.git deploy can write the value it actually runs. The refusal message names both options. - The post-swap check compares per key instead of whole-row content: a missing key is a real loss, and a differing row only counts as one when the backup's updated_at is newer. An OAuth refresh that overwrote the live value no longer stops the migration for good. - JS edits bump their ?v= in index.html (repos.js 68, app.js 261). The early-exit cleanup re-checks the drop, the platform filter treats a bare repo key as gitcode like the platform bar does, the guard's own verdict tests use the (file, line) contract, and docs/issue-536/task.md points at the real test paths. Verified: SQLite targeted sets match base 8c49b861 failure for failure (credential set 80 passed / 4 failed, repository set 37 passed / 9 failed, guard set 45 passed / 2 failed; every failure is identical on base). A MySQL 8.0.46 drill covers the rebuild path, a half-swapped database, the meta-unset refusal, content-only loss and a second boot with zero pending. tests/mgmt/test_pat_identity_boundary.py is 10 passed with a new case pinning the platform_tokens invalidation; the node suites (tests/js/*.js, i18n, host_provider, persist_on_refresh) pass and test_unbind_repo_list_invisible matches base at 37 passed / 7 failed. Signed-off-by: yang-aiwu-new <yang-aiwu-new@noreply.git.com> | 10 days ago | |
fix(issue-348): admin i18n + CSS tokens + health panel + OAuth whitelist + user CRUD + security hardening Resolves #348 (merges #332). Part A — Admin i18n + CSS Tokens + Bot Token Health Panel: - Extract tokens.css shared variable layer from app.css :root + apple-theme.css - i18n.js MODULES adds 'admin', _INLINE_PACKS adds admin critical strings - New zh/en admin.json locale packs (208 keys each, full parity) - admin.html: all Chinese → data-i18n, CSS hardcoded → var(--xxx, fallback) - Apple theme detection + first-paint flash prevention - Health panel: consume nested {overall, platforms, checked_at} structure - Per-platform rendering via Object.keys(platforms) iteration - esc() XSS fix: add double-quote escaping - Config page placeholder re-render on language switch (cached data, no API call) - Nav highlight in showCfg() to match showUsers/showWhitelist pattern - showWhitelist ev.target.closest('a') fix for span-inside-a case - 4 contract check scripts + check-all.sh + smoke-admin.sh - contracts/health.schema.json JSON Schema Part B — OAuth Login Whitelist + User CRUD (#332): - GET/POST/DELETE /api/admin/whitelist + PUT /api/admin/whitelist/toggle - POST /api/admin/users + PUT /api/admin/users/{id} + POST /users/{id}/reset-password - login_whitelist DDL: github_username UNIQUE partial index - Frontend: OAuth whitelist UI + create/edit/reset-password user modal - editUser uses cached page data (no redundant API call) - list_grape_users SELECT includes nickname Part C — Security Hardening: - Admin login brute-force protection (login_throttle, account + IP dimension) - Admin password SHA-256 → bcrypt migration with transparent upgrade - Password strength check (3 paths: change/create/reset) - Audit logs for all write endpoints (14 event types, including pre-existing change-password and PUT /config brought to parity) - All API error/success messages unified to English (45 messages) - Error code + frontend i18n mapping: backend returns error_code field, frontend errMsg() maps to admin.error.* locale keys, raw message → console only - .gitignore: configs/db-backend.json.* wildcard (credential leak prevention) - Case-insensitive queries: 8 WHERE username=? → LOWER(username)=LOWER(?) - DB layer case-insensitive unique indexes (SQLite expr index + MySQL generated column) - Forward-compat migration: _migrate_allow_signup_default (preserve baseline on upgrade) - invalidate_login_whitelist_cache() for immediate toggle effect - Health status flip notification (log.warning/log.info) - Dead code cleanup: _hash_password SHA-256, duplicate esc(), /whitelist-status endpoint Part D — allow_signup value consistency fix (regression from round 1/2 audit): - _migrate_allow_signup_default: write "1" instead of "true" (align with toggle endpoint) - read_public_config(): normalize via _is_allow_signup() → always return "1"/"0" (handles "true"/"1"/"yes"/"" in meta table uniformly) - Add TestAllowSignupValueConsistency (4 cases: true/1/yes/empty → 1/1/1/0) Signed-off-by: Hermes Agent <hermes@nousresearch.com> Signed-off-by: grape <grape@local> | 1 month ago | |
bugfix and promote response Co-authored-by: songspace<songspace@grape.dev> Co-authored-by: lvjuntao<jentle_81@163.com> | 8 days ago | |
fix(qa): close the 2 Critical + 2 Medium from the guard re-review head b95f3cd74 的定向重查:前轮 7 项全部关闭,本轮新发现 2 Critical + 2 Medium + 4 Info。 ensure_runtime_type_info_columns.py 用 session_manager.db(进程库)执行 ALTER, scan_pgconn.py --check 净新增 1 处。没有去 --update-baseline 放宽基线,而是消除它: 改用 db_registry.connection_for("runtime") 取 owner 库连接(kernel 层可 import, 不必绕 api 层的 _migration_conn),三库未启用时回落进程库。 实测 scan_pgconn.py --check:该文件已不在上升清单,剩余 6 条全是 base 存量 (a2a_repo_scope / engine_select / health_scorer / service / notify / runtime.py), QA 明示不溯及本 PR。 rds_next_batch.py:113 与 split_migration_sql.py:29 生成的「每批验收口径」命令仍是 foreign_table_refs.py --owner configs/table_ownership.json --check —— --owner 是 TSV 解析器,喂 JSON 归属恒空 → 输出「23 项下降/清零 OK」且 exit 0,真实 62 处跨域引用零检查。 这与 rds_gate.sh:18 的注释「必须用 --owner-json」直接矛盾:守卫自己修了,但它**教给 下一批人的命令**还是错的。两处文案改 --owner-json 并写明原因。 QA 指出:grape_t_guard_check/grape_t_guard_finding 全仓零引用,而同类的 admin_user_role_rel / sandbox_whitelist / template_usage 被移入「不算在用」段。 实查后**不移**,因为判据不是「本仓 grep 命中」而是「是否仍在被活跃写入」: grape_t_guard_check insight 实存 1412 行,checked_at 2026-11-17T11:18:38 ~ 2026-11-18T17:32:29 grape_t_guard_finding insight 实存 2621 行,同区间,最新 2026-11-18T17:32:29 列名即用途:role / unit_active / unit_restarts / pid / port_listening / health_code / db_name / expected_tables / actual_tables / missing_tables / foreign_tables → 外部巡检守护按角色巡检进程/端口/健康码/库表一致性,写入方在本仓代码之外 核对时刻 2 分钟前仍有写入 移入 _not_in_current_schema 会让归属检查放过真实的跨域引用。改为在 json 新增 _provenance 段记录来源、活跃证据、列语义与裁决理由,供后续复核(QA 说 「INSUFFICIENT DATA TO VERIFY」正因缺这份证据)。tables 段仍是 139 条,未增删。 三处定义统一为 VARCHAR(32) NOT NULL DEFAULT 'local' / TEXT (db_setup 的 _ensure_column、schema_ddl 的 DDL、迁移 202611180002)。 只影响新建库路径;存量库已是 varchar(64) NOT NULL DEFAULT '',两者对 'local'/'sandbox' 等价,无需 ALTER。 I-1 check-arch.py:75 注释自相矛盾(「json 已并入并删除」→ 实为 tsv 已并入 json 后删除) I-2 issue_ident_columns.py docstring 仍以已删除的 tsv 为口径来源,改为 JSON 权威 I-3 sync_to_sibling.sh 口令从 sshpass -p(进 argv,ps 可见)改 sshpass -e(SSHPASS 环境变量);内网默认值加注「开源分发时由部署方覆盖」 I-4 rds_next_batch.py 变量名 OWNER_TSV 指向 JSON → 改 OWNER_JSON 顺带修掉自己引入的一处静默 except(commit 失败被 pass 吞掉 → 改为 warning 留痕, silent-except 棘轮因此回绿),并重算 cross-domain-reads / foreign-refs 基线。 门禁:check-arch PASS · make lint exit=0 · 242 passed。 | 5 days ago | |
fix(qa): close the 7 findings from the PR #1602 guard review QA 在 head 51cd0d18e 上逐项实跑,列出 7 项整改。全部有可复现证据,逐条修: configs/table_ownership.json 成为唯一权威后,运行期与主检查器都走 load_owner_json,但这条链上还有 5 个脚本仍在用 TSV 解析器(按 schema\ttable 切行)读 JSON —— JSON 没有制表符,解析结果恒为空,于是: scripts/rds_gate.sh:18 --owner(TSV)→ 归属为空 → 23 对基线全判「清零」 → 恒打印 OK = 守卫被掏空。改 --owner-json。 scripts/gen_domain_dependency_board.py:32 路径指向 docs/weekly-11/table_ownership.json(404) → rds_gate 的 P3 步直接 FileNotFoundError。 路径改 configs/,:60 改 load_owner_json。 scripts/rds_burndown.py:44 load_owner → load_owner_json scripts/rds_burndown.py:79 同一 404 路径 → 改用 OWNER 常量 scripts/rds_next_batch.py:73 load_owner → load_owner_json scripts/split_schema_ddl.py:36 自带 TSV 行解析 → 读 JSON scripts/split_migration_sql.py:107 同上 修完实测(改前全是 0 / 崩溃): rds_gate --quick 剩余跨域 SQL 62 处 / 20 张表(改前静默 0) rds_burndown RESULT: 未清零(静态 62 / 运行 0) rds_next_batch 输出真实候选文件清单 split_schema_ddl --dry-run 可搬 DDL 常量 2 个(改前 0) split_migration_sql --dry-run 输出真实迁移待搬清单(改前 0) B-2 FROZEN index.html:app.js 冻结 273、实际 274(bump 时漏改登记)。改 274。 B-1 i18n 语言包指纹:tasks.json 的 tag_* 去掉 <b></b> 前缀后内容变了,但 LOCALE_FINGERPRINT 仍是 base 的值。按守卫同款算法(sha256,{lang}/{name}: + 文件字节,无分隔符)实算 42 个语言包 = a241ecb4b93db836,与 QA 数值一致。 同时四页 cacheVer 各升一档并同步 CACHE_VER —— 只改指纹能让守卫变绿,但老 客户端仍会命中浏览器里的旧 JSON,本次文案修正对存量用户不生效: index.html 63 → 64 admin.html 20261117-3 → 20261117-4 register.html 49 → 50 forgot.html 49 → 50 顺带重算了因为 owner 解析恢复而变化的两个基线:dependency-matrix/board 重新生成, cross-domain-reads 与 foreign-refs 基线收紧(62 refs / 23 pairs)。 门禁:check-arch PASS · make lint exit=0 · 242 passed(arch+contracts+scripts+ ownership+migration_guard+两个前端守卫)。 未处理(QA 明示不判本 PR,属基线红):scan_pgconn.py --check 的 5 处上升, base 与 head 同红同清单。 | 5 days ago | |
fix(chat): make conversation creation idempotent on MySQL unique key Empty-body probing of write endpoints surfaced 1062 on chat_conversations: MySQL enforces a unique key over (user_id, repo_key, issue_number, conv_type) that the sqlite test schema does not, so a second create blew up with 500. Creation is get-or-create anyway, so on duplicate we now return the existing conversation id, reusing the existing read path to avoid adding cross-domain SQL. Stage write scan is 172 checks / 0 failures, incl. 46 probed POST/PUT endpoints. | 9 days ago | |
grape kit adapter & plugin market Co-authored-by: zrr<zrr@local> Co-authored-by: grape_bot<grape_bot@noreply.git.com> Co-authored-by: my_grape_bot<my_grape_bot@noreply.git.com> Co-authored-by: zrr000212<zrr000212@noreply.gitcode.com> | 3 days ago | |
grape kit adapter & plugin market Co-authored-by: zrr<zrr@local> Co-authored-by: grape_bot<grape_bot@noreply.git.com> Co-authored-by: my_grape_bot<my_grape_bot@noreply.git.com> Co-authored-by: zrr000212<zrr000212@noreply.gitcode.com> | 3 days ago | |
fix(qa): view-supply reproducibility for 13 sandbox tables; devbox EIP placeholder + guard rule Three small remediations from the round-6 compliance reports: - sync_domain_views.py DEFAULT_SYNC_TABLES + 13 sandbox control-plane tables. Reproducibility gap proven live on the 8070 three-db instance: mgmt-side views for these tables existed only as hand-run CREATE VIEW statements (built during session hotfixing), so any fresh install or redeploy would re-hit the 1146 chain (_build_cred_map -> provider_id empty -> sandbox credential detail button never renders; takeover sessions 500). Admission keeps the established pattern: the code-side default set carries table names only (no real db names in-tree); per-instance view-allowlist files stay local per the chore(oss) redaction ruling (view-allowlist.txt deliberately untracked since 3ce512d72). Can be re-derived from the ownership canon once G-21 is adjudicated. - devbox_dns.py docstring example EIP 110.41.x.x -> RFC5737 doc reserved 203.0.113.10 (compliance round-6 manual-review item). - check-doc-redaction.py: new EIP rule for the 110.41.0.0/16 devbox gateway segment so the docstring class of leak is no longer missed (the old rules only covered 121.36.33.* / 124.70.*). Verification (env -u PYTHONPATH aw11 venv): - py_compile all three files; check-doc-redaction --diff base: 0 hits on the new rule (the old example is now a reserved address); the 57 pre-existing hits are the G-03 backlog fixture/policy-CIDR set, double-tree-verified earlier as non-assets, unchanged by this diff. - tests/arch/ 35 passed. | 6 days ago | |
refactor: #699 extract src/kernel/ (18 shared modules, auth_sdk, db_migrations) with re-export shims | 20 days ago | |
feat(org): add organization pipeline, dispatch, and repo map Add the organization workbench pipeline: intake, dispatch, aggregation, context publishing/snapshots, repo map analysis, knowledge, audit, and retention. Includes the org management API, Vue workbench pages, CLI contracts, UUID-primary-key migrations with grape_t_ prefixes, metrics, and guard/test coverage. Review remediation included in this commit: - route destructive DDL through _destructive_ddl; - register the lazy VcsApiClient export in the A3 gate; - retire the standalone org-pipeline page behind an explicit redirect and replace its stale source assertions with a retirement contract test; - squash the branch onto arch-weekly-11 and refresh the migration and cross-domain-read baselines after rebasing on the target branch; - treat dispatch ids and org issue idents as strings/uuids end to end in the aggregation closure, and keep the top-bar org default contract; - add a single-db fallback for the mgmt read port so structured task memory works outside the three-db topology. Signed-off-by: chenyan <1534887760@qq.com> | 3 days ago | |
refactor(templates): move official project templates to standalone grape-template repo - remove examples/hello-* templates + configs/project-templates.json (now synced from grape-dev/grape-template via scripts/sync_templates.sh) - add examples/.gitkeep placeholder - add scripts/sync_templates.sh (build-time pull of templates + registry) - update README / CODEOWNERS / DEPLOYMENT-REMOTE about template source - docker-compose: fix duplicate volumes block, mount ./examples:/app/examples - docs: add project-templates-standalone-repo-design.md (方案 C) | 2 months ago | |
fix(compliance): close the 2 non-conforming findings + bump the two stale frontend versions (Issue #3023) 合规审查(head b95f3cd7)2 项不符合,都是本轮增量引入的 IP 泄露;另有一条前端缓存 建议指出真实问题。 ## §1.1-1-5 内网/公网 IP 落仓(2 项) ① deploy/nginx-gzip.conf:4 注释写了公网 EIP 120.***.***.1:38080(fc78df70 新增) → 改 <PUBLIC_EIP>:38080,实测数据保留(LAN 190ms / 公网 1452-3271ms → gzip 后 145-257ms) ② scripts/sync_to_sibling.sh 默认 SIBLING=192.168.**.*** → 改 ${SIBLING:?需要 SIBLING(兄弟机地址,例如 <sibling-host>)},无默认值; 用法注释与说明同步。示例地址也用占位符,避免自己再次命中扫描。 顺带(I-3):口令从 sshpass -p(进 argv,ps 与 /proc cmdline 可见)改 sshpass -e (读 SSHPASS 环境变量,仅本进程及子进程可见)。 ## 前端两个版本号只改内容没 bump(合规建议 #3) shell/js/api.js 的取消信号修复(!navSignal.aborted)早已上线,但 ?v=35 没动; issues-view.js 同样停在 ?v=61,而 IssuesView.vue 已 +50 行(silent abort 不再 吞掉加载终态那笔)。后果:老客户端继续执行缓存里的旧 JS,两次修复对存量用户都不生效 ——正是「改了代码但用户还是老毛病」的形态。 api.js 35 → 36(index / register / forgot 三页一致) issues-view.js 61 → 62 FROZEN 同步 test_frontend_cache_version_ratchet.py 4 处 ## 其余三条人工复核项的处置 - 表归属(M-1):不移表,改为在 configs/table_ownership.json 增 _provenance 段给出 可核查证据——两表在 insight 库分别有 1412 / 2621 行,checked_at 最新 2026-11-18T17:32:29(核对时刻 2 分钟前仍在写),列名即为巡检对象(role/unit_active/ port_listening/health_check/db_name/expected_tables…),写入方在本仓之外。零引用≠死表。 - 棘轮基线(async_blocking 272→274、silent_except 新增 3 文件):前者来自 base 侧 mgmt/user/db.py 与本 PR 的新迁移,后者是本 PR 合入 base 时带进来的条目;两者都是 「合入 base 后的必然结果」而非本 PR 新增的静默/阻塞形态。本 PR 自己引入的一处静默 except(迁移 commit 失败 pass)已改 warning 留痕。 - §2-3 关联后缀:本提交起带 (Issue #3023)。 门禁:check-arch PASS · make lint exit=0(async-blocking 274/274)· 242 passed。 | 5 days ago | |
feat(sandbox,uuid): port the sandbox + engine-uid overhaul line onto arch-weekly-11 Squash-replay of the 28-commit feat/sandbox-uuid-onto-arch-weekly-11 stack (rewritten history backup: and-zj2 backup/sandbox-uuid-aw11-20261116-2121, post-identity-normalization head b47126ecf: backup/sandbox-uuid-aw11-rewritten-20261116-2124) onto the current arch-weekly-11 tip ff9573026 (repo merge_method=ff). Carried changes: - Engine uid overhaul (#646/#826/#868/#1011) adapted to the arch-weekly-11 domain topology; sandbox domain squashed from feat/devbox-sandbox-integration7; tag-based scheduling (selector, #1208). - Vue shell ports M1-M4 (sandbox admin, selector engine modal, observability sandboxes tab + two-level LLM credentials, sandbox badges/deeplinks/event-info); autopilot uid surface (#1011); legacy static tree removed. - E-02 fresh-instance replay fixes: sandbox egress chain + post-create reachability assertion, cloud execution chain (binary prefix, PTY wrapper, platform URL), first-time engine registration cloud metadata, sandbox-provider-report 500 (MariaDB 1292), scene-tags custodian access, agent_runtimes org_id '0' normalization; DB migration hygiene (engine_template_binding 3-tuple UNIQUE, ledger collision renumbering, autopilot_tasks.created_by UUID ids). Merge-conflict resolutions over base (32 new base commits overlapped this stack): - src/api/db_setup.py: union of both sides' appended migrations; verified no ledger version collisions (PR side keeps its own 20261103/08 slots). - index.html: ?v= line-level max merge (base bumps kept: dashboard-view 73, app.js 269, ...); sandbox-view.js v2 registered; i18n cacheVer bumped to 55 (locales gained sandbox.json etc. from this stack) and the four pages' cacheVer bumped per the ratchet contract. - Ratchet guards regenerated from the merged tree: FROZEN rescanned from the four pages (VENDOR/DATE_VERSIONED unions of both sides, PAGE_OWN_CHUNKS ported from base); i18n fingerprint recomputed (4d577b61faf9ddf8), floors take the max of both sides. - openapi.json: both sides' re-sorted entries kept, no duplicate operationIds (342 ops); help.html kept base's redacted variant (ff9573026 internal-runbook redaction must not regress). - src/domains/runtime/routes/runtime.py: restored /api/runtime/issues/takeover-context (runtime_takeover_context) silently dropped by the auto-merge. - src/domains/mgmt/routes/scenes.py: fixed the scenes_detail route binding — the @router.get decorator had landed on the _scene_node_scope_check helper (squash-rebase lineage bug present in the PR stack itself), leaving get_scene_detail undecorated; restored the base structure with helpers. - Full operationId reconciliation vs base: base-only set is empty; 42 new public ops come from this stack. Verification: - pytest tests/api/test_openapi.py tests/api/test_frontend_cache_version_ratchet.py tests/api/test_i18n_locale_cache_ratchet.py: 13 passed, 1 failed = test_public_ops_have_operation_id_summary_security, which is baseline-red on arch-weekly-11 ff9573026 (verified in a clean base worktree: same failure). - node --check on the four rebased view entries. Compliance redaction (QA round 1 on PR #1507, F1/F4/F5): - docs/sandbox/bwrap/engine-sandbox-toggle-design.md, docs/sandbox/platform/bola-simplify-design.md: replaced the real DB host/password/instance, worker runtime token (rta_...), internal host ids and runtime ids in the verification-environment blocks with placeholders. The leaked credentials must still be rotated server-side; redaction here only stops further exposure from the public tree. - configs/cubesandbox-config.example.json, docs/sandbox/cloud-sandbox-engine.md: real platform template ids -> <template-id-*> placeholders. - .gitignore: ignore configs/cubesandbox-config.json (real config copied from the example carries api_key/grape_cli_token). | 6 days ago | |
fix(deploy): honor --dry-run when syncing the engine skill tree | 7 days ago | |
refactor(ownership): make configs/table_ownership.json the single source of truth for table ownership Two manifests were being maintained in parallel and had drifted by 19 tables — the JSON listed tables the TSV did not. Three of them (grape_t_oauth_channels, devops_agent_runtime_binding, grape_t_category_dict) are used by production code today. Because the TSV had no entry for them, foreign_table_refs could not tell which domain owned them and reported no violation — a false green. The JSON is a strict superset (137 tables vs 118) and it is what the code already read at runtime: src/kernel/table_ownership.py, scripts/foreign_table_refs.py and scripts/scan_pgconn.py all load it. The TSV was only ever read by three checkers (check-arch R8, verify_domain_isolation, the foreign-table-refs test) and quoted in comments. So the JSON becomes the only source and the TSV is removed; a copy is kept outside the repo for the historical P0 ruling record. Changes: configs/table_ownership.json _comment rewritten to state it is authoritative and warn against a second manifest src/kernel/table_ownership.py new owner_map() so scripts and tests share one loader scripts/check-arch.py R8 reads the JSON; load_r8_owner() accepts .json or the legacy two-column TSV scripts/verify_domain_isolation.py uses load_owner_json() tests/arch/test_foreign_table_refs.py asserts against the JSON 108 references in 32 files docs/weekly-11/table-owner.tsv -> configs/table_ownership.json docs/weekly-11/table-owner.tsv deleted Switching to the superset immediately surfaced the violation that the gap had been hiding: 新增跨域引用 devops_agent_runtime_binding←runtime: 3 处 新增跨域引用 grape_t_category_dict←api: 2 处 Both are registered in foreign-refs-allowlist.csv (37 pairs) as known debt to be collected into the owner's public surface later — registering them is honest bookkeeping, not a fix, and the ratchet now tracks them. check-arch PASS · make lint clean · pytest tests/arch+contracts+scripts+table_ownership 233 passed. | 5 days ago | |
refactor: #699 reorganize src/ into domains (mgmt/runtime/insight/contracts) with re-export shims | 20 days ago | |
refactor: #699 reorganize src/ into domains (mgmt/runtime/insight/contracts) with re-export shims | 20 days ago | |
feat(guards): cross-domain view freshness guard with migration ordering and fail-closed deploy step Non-owner domain databases only hold views, and a view's column list is frozen when it is created. When an owner table gains or drops columns, changes a column type, is created, dropped or renamed, the other domains keep reading a stale definition and the endpoints answer 500 with 1054/1146 while every existing check stays green. Changes: - scripts/view_ddl_builder.py: single implementation of the CREATE OR REPLACE VIEW DDL plus identifier allowlisting, shared with sync_domain_views.py. - scripts/domain_view_freshness.py reports missing columns, extra columns left after an owner DROP, missing views, orphan views (owner table dropped or renamed, resolved through every FROM/JOIN reference of the view definition) and column type drift. When a definition is not readable (no SHOW VIEW) the view is reported as UNKNOWN instead of silently passing. - owner ambiguity is never guessed: tables that are BASE TABLE in several domain DBs are recorded and never repaired, their copies are compared against each other, and the views of those tables are still checked against the columns every copy shares, so an allowlisted table cannot hide a missing column. --strict-owner turns an unlisted duplicate into exit 2 ahead of exit 1. - missing views are reported but do not fail by default: a new owner-only table must not block every deploy. Tables that need cross-domain reads are listed in --create-missing-tables and only those get a view created; --fail-on-missing-view restores the strict behaviour. - intentionally narrowed views are listed in --narrowed-tables: a rebuild keeps the existing projection (drops stale columns only) and never re-exposes the columns that were left out on purpose. - repair is a write path and therefore strict: --repair implies --strict, so a missing database, an unreachable server (distinguished from "not configured"), an unidentified environment family or a missing CREATE VIEW grant exits 3 instead of looking like a successful no-op. --definer keeps the view owner stable and is validated before it is interpolated into the DDL. - scripts/deploy-after-migrate.sh runs the three steps in the only order that works: migrations (init_database) -> view repair -> verification, prints the go-ahead only on exit 0 and prints an explicit "do not restart the four processes" for every failure code. - deploy/hosted/entrypoint.sh and deploy/systemd/grape-server.service stop repairing before startup (migrations run at import time, so a pre-start repair only fixes the previous schema) and run a read-only check instead. - docs/weekly-11/domain-view-and-ignore-pitfalls.md: the release checklist now points at scripts/deploy-after-migrate.sh instead of sync_domain_views.py, which is kept only as a manual emergency tool for its five fixed tables. - deploy/README.md documents the migration -> repair -> restart order, the exit codes, the allowlists, the CREATE VIEW / SHOW VIEW privileges and the DEFINER caveat. - scripts/check-all.sh runs the check with --skip-if-unavailable, --strict-owner and the three allowlists; the route probe uses --warmup so a cold worker-package build is not mistaken for an unreachable route. Tests: 32 cases in tests/api/test_domain_view_freshness.py plus the existing 13 in tests/scripts/test_sync_domain_views_config.py (45 in total, all passing): environment family resolution and ambiguity, database validation, all five drift classes, ambiguous owners (no judgement, no DDL, copy drift reported, shared-column check on their views), missing-view policy in both modes, narrowed projection, unreadable definitions, exit-code precedence, CREATE VIEW preflight, --definer validation, pure-JSON repair output, and a subprocess case asserting that deploy-after-migrate.sh exits exactly 3 and never claims it is ready to restart when the database environment is absent. Verification on dev: 252 views with 0 missing/extra columns, 0 missing views, 0 orphan views and 0 type drift; the 11 known duplicate base tables are allowlisted and takeover_sessions (33 vs 26 columns) is reported as copy drift; deploy-after-migrate.sh exits 3 without a database and 0 with one; scripts/check-all.sh exits 0. Signed-off-by: grape-dev <dev@grape.local> Refs #2333. | 10 days ago | |
feat(boot): refuse to start on incomplete domain wiring or stale views Yesterday's 500 happened because two invariants were only checked by hand: cross-domain DSNs (missing ones silently fell back to the process database) and cross-database view freshness (a VIEW keeps the column snapshot it was created with). Both are now startup checks. domain_topology asserts that every non-own domain has GRAPE_DSN_<DOMAIN> in multi-database mode and exits 6 with the exact missing variable otherwise; single-database topologies compare equal and pass, GRAPE_CROSS_DOMAIN_STRICT=0 keeps an explicit escape hatch. domain_views owns the DDL builder (scripts/view_ddl_builder.py is now a thin re-export) and repairs only views in the process's own database, only when the owner base table is unique: missing/extra columns and type drift are rebuilt from the owner's column set, while ambiguous owners, orphaned views and views whose definition is unreadable are reported but never guessed at. If a stale view survives repair the process exits 7 instead of serving 1054s. Signed-off-by: org-b <org-b@noreply.git.com> | 3 days ago | |
feat(guards)!: table ownership manifest + DDL owner guard, stop duplicate base tables When several domain processes share one schema set, every process runs the same migration module and creates every table, so a table that belongs to one domain also exists as a base table in the other databases. Those copies then diverge: writes go to one copy while reads come from another, and after a host split they become orphaned data. This change makes table ownership explicit and enforces it at the DDL entry points: - configs/table_ownership.json: ownership manifest for 136 base tables (mgmt 81 / runtime 45 / insight 10). The eleven tables that previously had several base copies are decided to runtime, based on which process writes them and which copy actually holds data. - src/kernel/table_ownership.py: domain resolution (DEVOPS_DB_NAME, then GRAPE_PROCESS_ROLE), manifest lookup with mtime based reload, and a guard that is enabled only for the MySQL multi-schema backend so single-file sqlite deployments and the test suite keep building a complete schema. - src/api/db_setup.py: _create_tables, _create_indexes and _ensure_column skip tables owned by another domain and log [DDL_SKIP] with the owner, so the guard is visible in normal startup logs. Unknown tables are still created, and GRAPE_DDL_OWNER_GUARD=0 disables the guard as an escape hatch. - scripts/view_owner_known_duplicates.txt: the allowlist shrank from eleven to the two tables whose copies are still needed until the mgmt code paths move to the runtime library. Cleanup applied on dev with the guard in place: the seven mgmt copies of the IM channel tables, the mgmt and insight copies of branch_guard_state, the insight copies of the two credential tables and the insight copy of takeover_sessions were dropped, and takeover_sessions gained the seven columns that only existed in the mgmt copy. Duplicate base tables went from eleven to two. Tests: 18 cases covering manifest coverage, domain detection for every naming shape, owner resolution, unknown tables passing through, guard disable via env and via sqlite backend, index table-name parsing, and the db_setup hook. Signed-off-by: grape-dev <dev@grape.local> Refs #699. | 10 days ago | |
feat(guards): cross-domain view freshness guard with migration ordering and fail-closed deploy step Non-owner domain databases only hold views, and a view's column list is frozen when it is created. When an owner table gains or drops columns, changes a column type, is created, dropped or renamed, the other domains keep reading a stale definition and the endpoints answer 500 with 1054/1146 while every existing check stays green. Changes: - scripts/view_ddl_builder.py: single implementation of the CREATE OR REPLACE VIEW DDL plus identifier allowlisting, shared with sync_domain_views.py. - scripts/domain_view_freshness.py reports missing columns, extra columns left after an owner DROP, missing views, orphan views (owner table dropped or renamed, resolved through every FROM/JOIN reference of the view definition) and column type drift. When a definition is not readable (no SHOW VIEW) the view is reported as UNKNOWN instead of silently passing. - owner ambiguity is never guessed: tables that are BASE TABLE in several domain DBs are recorded and never repaired, their copies are compared against each other, and the views of those tables are still checked against the columns every copy shares, so an allowlisted table cannot hide a missing column. --strict-owner turns an unlisted duplicate into exit 2 ahead of exit 1. - missing views are reported but do not fail by default: a new owner-only table must not block every deploy. Tables that need cross-domain reads are listed in --create-missing-tables and only those get a view created; --fail-on-missing-view restores the strict behaviour. - intentionally narrowed views are listed in --narrowed-tables: a rebuild keeps the existing projection (drops stale columns only) and never re-exposes the columns that were left out on purpose. - repair is a write path and therefore strict: --repair implies --strict, so a missing database, an unreachable server (distinguished from "not configured"), an unidentified environment family or a missing CREATE VIEW grant exits 3 instead of looking like a successful no-op. --definer keeps the view owner stable and is validated before it is interpolated into the DDL. - scripts/deploy-after-migrate.sh runs the three steps in the only order that works: migrations (init_database) -> view repair -> verification, prints the go-ahead only on exit 0 and prints an explicit "do not restart the four processes" for every failure code. - deploy/hosted/entrypoint.sh and deploy/systemd/grape-server.service stop repairing before startup (migrations run at import time, so a pre-start repair only fixes the previous schema) and run a read-only check instead. - docs/weekly-11/domain-view-and-ignore-pitfalls.md: the release checklist now points at scripts/deploy-after-migrate.sh instead of sync_domain_views.py, which is kept only as a manual emergency tool for its five fixed tables. - deploy/README.md documents the migration -> repair -> restart order, the exit codes, the allowlists, the CREATE VIEW / SHOW VIEW privileges and the DEFINER caveat. - scripts/check-all.sh runs the check with --skip-if-unavailable, --strict-owner and the three allowlists; the route probe uses --warmup so a cold worker-package build is not mistaken for an unreachable route. Tests: 32 cases in tests/api/test_domain_view_freshness.py plus the existing 13 in tests/scripts/test_sync_domain_views_config.py (45 in total, all passing): environment family resolution and ambiguity, database validation, all five drift classes, ambiguous owners (no judgement, no DDL, copy drift reported, shared-column check on their views), missing-view policy in both modes, narrowed projection, unreadable definitions, exit-code precedence, CREATE VIEW preflight, --definer validation, pure-JSON repair output, and a subprocess case asserting that deploy-after-migrate.sh exits exactly 3 and never claims it is ready to restart when the database environment is absent. Verification on dev: 252 views with 0 missing/extra columns, 0 missing views, 0 orphan views and 0 type drift; the 11 known duplicate base tables are allowlisted and takeover_sessions (33 vs 26 columns) is reported as copy drift; deploy-after-migrate.sh exits 3 without a database and 0 with one; scripts/check-all.sh exits 0. Signed-off-by: grape-dev <dev@grape.local> Refs #2333. | 10 days ago | |
fix(write): rename the intent log to the grape_t_ convention and document tunables Addresses the architecture review on PR #1390. - F1 (Critical, rule A6): the compensation log table becomes grape_t_xwrite_log, so it follows the grape_t_xxx naming rule. The table has not been created in any environment yet, so this is a rename with no migration cost; the known-duplicates registry entry moves with it. - F4 (Medium, rule B2): the new constants now carry their rationale - the retry cap of five attempts spans the backoff window and matches the patrol cadence, the 30 second backoff deliberately avoids landing on the same tick as the five minute drain timer, the per-run limit of 50 is thirty times the observed cross-domain write peak, and the 8 second connect timeout leaves two seconds of margin under the ten second read budget. Tests: the cross-write, registry and lease suites pass (29 cases). Deferred with a plan: F2 (the write primitives still use MySQL dialect, so the sqlite reuse path is not usable) will be handled by tightening availability to an own-DSN check and adding a sqlite-backed case; the informational items are left as recorded by the reviewer. Signed-off-by: grape-dev <dev@grape.local> Refs #1390. | 10 days ago | |
fix(issue-3054): harden OAuth login, bind tickets and buttons OAuth login chain - P0 login page security and robustness - unknown OAuth providers are dropped before touching the DOM, whitelist errors no longer carry the external ident, popup results verify event.source before reading data, and error params are encoded once and decoded defensively (XSS/reflection). - the popup reference is now registered where the popup is opened (AccountView), so the shell's event.source double check actually runs instead of being dead code. OAuth login chain - P1 credentials and refresh chain - one encrypted credential source (the channel row) feeds both login and refresh; decrypt failures are explicit (credential_decrypt_failed) instead of silently falling back to meta; exchange_token retries transient errors only, 4xx returns the provider error immediately. OAuth login chain - P2 login decision and status=4 deadlock - status=4 identities recover after a fresh authorisation, rebind keeps the old external_id as a tombstone and releases UNIQUE(provider, external_id), status=4 rows can be unbound and receive tickets instead of bind_failed. - MySQL correctness: the unbind UPDATE declares status=0 after both CASE WHEN status=4 expressions. MySQL evaluates a single-table UPDATE's SET list left to right, so the old order made the release-key and tombstone expressions fall through to ELSE while SQLite kept them green; a statement-order test pins both dialects. - "keep at least one login method" is unified in auth_guards.LoginMethodPolicy (LOGIN_STATUSES=(1,4)) and used by the unbind pre-gate, the transfer pre-check, UnbindGuard.rejection and the settings endpoint; count_user_identities keeps its (1,) default so other callers do not change behaviour. OAuth login chain - P3 state machine and account lifecycle - unbind evaluates "keep at least one login method" inside a single conditional UPDATE so concurrent unbinds cannot lock the account; associate/register share the login throttle; oauth nonce becomes a multi-slot set; deactivation cascades to identities and tokens; state is peeked before consume so a failed attempt can be retried in place; account-status errors distinguish cooldown/disabled/deleted. string issue idents (A/B/C) - kernel/issue_ident is the single predicate/coercion source; isdigit gates and int() casts are gone, so platform idents keep working through A2A handoff, cancellation, comments, completion and task bookkeeping. The grammar is [A-Z][A-Z0-9]* so real gitee idents (I1J8U4) stay valid; real-shape cases are in the suite. - A2A accepts platform idents and resolves bare owner/repo through the mgmt-domain public lookup, scoping mismatch evidence to the same provider. - a registered migration (202611172020, renumbered past the new base head) widens the MySQL issue ident columns, rewrites issue_number=0 rows to pr:<id>, rebuilds the unique index and refuses to stamp itself outside the runtime owner domain. OAuth bind and transfer confirm flow - the popup deliberately never returns binding_ticket, yet all three frontend call sites read it from the callback URL / GET /auth/me, so a conflicting bind dismissed the popup with no dialog and no error. app.js, AccountView.vue and BindDialog.vue now take the ticket from GET /auth/transfer-context and surface transfer_context_expired (zh/en) when it is gone; need_transfer no longer sets done=true before the request, so the 60s fallback toast fires. - placeholder-account merge: a missing/unreadable table (MySQL 1146) now means "no business data" with a structured warn instead of the old conservative "has data" that disabled merging on the split DB. mgmt-local tables stay on the caller cursor; the four runtime-owned tables go through the RuntimeService contract (user_business_table_counts). - engine reference reconciliation moved out of mgmt/user/db.py into the runtime owner domain (engine/refs_reconcile.py, 6 runtime tables). Cross-process calls use RuntimeService.reconcile_engine_references (Local/Remote routed by the GSB provider); a failed call is queued as a replayable engine_refs_reconcile intent with a drain handler. Placeholder merge transfers runtime rows through the contract, and fails visibly so the caller can roll back. - contracts: RuntimeService gains N14/N15/N16 with matching Local/Remote implementations and /internal endpoints (business-table-counts, reconcile-engine-references, transfer-user-business-data). This is the only cross-domain path used by the changes above. button spec convergence and atomic list rows - the single button size source is already in the base (--btn-h/-sm/-xs); this commit covers the remaining gaps: .ac__prow / .cred-row share one row spec (--row-pad-y/-x, --row-radius, --row-gap, --row-min-h in app.css section 23c) instead of 14x16 vs 12x16, and the credential row gains the same shadow. - account rows are a 3-column grid (avatar / content / actions) with a shared 88px min-height and single-line ellipsis hints, so unavailable / expired / bound / unbound rows are equal height; the expired state gained its avatar slot. - cache bumps: index i18n cacheVer 58 -> 59 (locales union of both lines), register/forgot 47 -> 48, admin 20261116-2 -> 20261117-1, app.css 8, all-views.css 11, account-view.js 56; FROZEN map and the locale fingerprint are derived from the merged files. Architecture - each concern lives in its own small module: identity_unbind (value object, keep-one predicate, per-dialect statement classes, gateway), identity_lifecycle, auth_guards (OAuthStateStore / LoginThrottlePolicy / LoginMethodPolicy / UnbindGuard / AccountDeactivationCascade / ChannelGate), credential_source, retry_policy, kernel/issue_ident, runtime/a2a_repo_scope, runtime/migrations/issue_ident_columns, mgmt/auth/business_data, runtime/engine/refs_reconcile. db_setup.py, grape_auth.py, webhook.py and event_pipeline.py only wire calls. - cross-domain access goes through contracts only: RuntimeService for the runtime-owned tables (counts / reconcile / transfer), GSB provider routing, and no mgmt code holding runtime SQL. foreign-table refs allowlist tightened to the measured values (ratchet only goes down). follow-up - provider email normalisation and failed-signup rollback - provider private/relay mailboxes (gitee/gitcode/github/gitlab/apple noreply) are no longer stored as a real email: auth/identity_email.ProviderEmailPolicy is the single source, and create_grape_account_oauth stores (NULL, email_is_placeholder=1), so they stop occupying the email unique key and stop pushing logins into the "register / link existing account" dead end. - a failed OAuth signup rolls back by releasing email and username instead of entering the 30-day deactivation cooldown (AccountDeactivationCascade.rollback_signup -> release_failed_signup_account): username gets a _void_<id8> suffix for audit, identities go status=0 with tokens cleared; a real account deletion keeps the old cooldown semantics. - the email-first link page only triggers for provider-verified emails; an unverified or missing address no longer sends the user to the two-choice page and cannot be used to probe whether an email is registered. Remaining review items (same commit) - issue-ident placeholder prefix: the migration now writes pr_<id> (matching every startswith("pr_") check in the codebase) and normalises legacy pr:<id> rows once; 0-number rows are never auto-restored - the rewrite list is logged and backtracking is a documented SQL, because pairing the wrong issue to a rewritten row is worse than keeping a placeholder. - ident coercions: event_pipeline and issues_center stop int()-ing idents; the AST ratchet now scans issues_center as well. - config_store: stripping the secret from the card JSON / oauth-providers.json now requires the table to hold a decryptable copy (same gate as the flat meta keys), so a deployment with no table row can never lose its only plaintext copy. - build_auth_url refuses to build a URL when client_id is missing instead of sending the user to the provider's error page. - registration failures count by provider+IP instead of the submitted username (nobody can lock another account by hammering its username); exchange stops retrying 5xx after one retry, since a code that the provider already consumed must not be presented twice (RFC 6749 revokes the issued token). - admin channel save writes client_secret into grape_t_oauth_channels (mgmt-owned table) via OAuthChannelRepo.set_client_credentials; the meta copy keeps only client_id, and client_secret_set reads the table (meta remains a fallback window). - tombstones move to their own table: external_identity_tombstones with UNIQUE(provider, external_id), owner=mgmt, registered migration 202611172100 that backfills from metadata. Writes dual-write, reads hit the unique index first, metadata stays as a fallback window for not-yet-backfilled rows. - deactivation now releases UNIQUE(provider, external_id) (external_id -> unbound:<row id> plus a tombstone), so a platform account is not blocked for the whole 30-day cooldown; the original user is still found through the tombstone when they sign back in. Baseline sync (arch-weekly-11 @ 6266f5f7f) - merged the 28 baseline commits under the feature work. Conflicts were resolved in favour of the baseline and the feature was re-implemented on the new structure: * pipeline title backfill: the baseline moved placeholder detection and the API backfill into pipeline/title_backfill.py (baseline title-backfill work). Our ident support is re-written there: _issue_number_of now returns platform idents through kernel.issue_ident instead of isdigit() (which returned None for IKW28R/I1J8U4), and the per-row serial API fallback is dropped because the baseline's bounded concurrent backfill replaces it. * db_setup: both migration functions kept - baseline issue-2925 (issue.title_fetched_at) and our issue-3054 tombstone table + issue-3055 ident schema. * shell pages: baseline favicons kept; our cache versions kept (app.css 8, index cacheVer 59, register/forgot 48, admin 20261117-1) and the locale fingerprint recomputed from the merged files; foreign-table refs allowlist re-measured (agent_runtimes<-mgmt 10 -> 5, ratchet only goes down). Review follow-up (second QA round) - callback state: peek (no consume) -> provider/nonce checks -> atomic consume. A cross-provider callback or a nonce mismatch no longer burns a valid state, which was a reachable state_invalid path; provider_mismatch and state_invalid stay apart. - OAuth auto-create now passes through the signup policy (verified address aware): disabled sign-ups, or a non-empty allowlist with no usable address, block account creation instead of silently creating one. - placeholder business-data probe splits "table missing" (topology -> no data) from "table unreadable" (transient -> indeterminate, treated as has-data so nothing is auto-merged); the verdict carries an explicit reason. - the ident migration is registered as a backfill (it updates existing rows, not pure DDL) and logs the rewritten zero-row ids with a restore statement for audit. - the deleted-account error got its frontend mapping, and the new sign-up-blocked error carries zh/en text with the locale fingerprint and cache version bumped. - second sync (6266f5f7f): the baseline reworked the migration runner to run only the migrations of the owning domain and to label cross-domain ones explicitly. The ident migration is now registered with domains=("runtime",) (issue and chat_conversations live in the runtime database); leaving the default would file it under mgmt and the runtime process would never execute it, so the column width would never converge and idents would keep being truncated to 0 by the INT column. Shell cache versions and the locale fingerprint were recomputed from the merged files (index 61, app.js 272, app.css 8, all-views 11, onboarding 8); the frontend ratchets and the deleted-account / sign-up-blocked strings are carried over on top of the baseline's own bumps. - third review round: the new table follows the grape_t_ prefix rule (grape_t_external_identity_tombstones) across the DDL, the ownership manifests, the store constant and the allowlist. The unbind path now dual-writes that table as well: it used to record the tombstone only in the metadata JSON, so on MySQL a released key left no indexed trace (found by the real-MySQL run, not by the SQLite suites). Verified on the dev MySQL with the three-database / four-process layout: registrations land in the mgmt database, expired-status unbind releases the unique key and writes the tombstone row, another account can bind the same platform id immediately, deactivation releases keys with reason=account_soft_delete, an ident is stored and read back as text, and the business data probe reaches the runtime domain through the contract with no missing-table errors. - follow-ups from the third review: * the popup listener keeps its origin+source guard and now documents why it is dormant (sign-in redirects the whole page), so nobody deletes the only P0-2 implementation; * the column widen states ALGORITHM=COPY, LOCK=SHARED explicitly - INT to VARCHAR is a type change, so INPLACE would fail with 1846; the migration test asserts COPY and rejects INPLACE so it cannot be "optimised" back; * the admin secret fallback carries its keep/exit conditions and the residual plaintext risk in a comment next to the warning it already logged. Verification (per-file isolated runs, each file its own process and private /tmp) - p2 status4 8, email rollback 14, p3 state lifecycle 15, 3055 schema migration 18, p1 credentials 19, p0 oauth security 16 passed (2 failed = base-red, same node ids), 3055 ident 14, auth_routes 19, contracts 39, issue_868 20, transfer_context_wiring 4, button_spec 6, i18n ratchet 4, frontend cache ratchet 2, foreign-table refs 3, d48 9, issue_376 18 - green; check_lib_query_names.py PASS. - known base-reds unchanged (same node ids on the clean base): test_transfer_bind 3 failed, s59 1 failed, issue_372 6 failed, oauth_security_p0 2 failed, test_migration_no_baseline_version_collision 1 failed. - table ownership / migration guard / contracts / issue_868: 18 / 3 / 39 / 20 green; foreign-table refs ratchet 3 green after the baseline sync re-measure. - Chrome against the real vite build: 12 class combos give identical height/font-size/padding in bare / .cd / .cd .cd-h / after-.srow contexts (36 / 30 / 26 tiers only); the four account states and the credential row are all 88px; every row's action button right-aligns. Signed-off-by: yang-aiwu-new <yang-aiwu-new@noreply.git.com> | 5 days ago | |
feat(lib): reconcile and archive the cross-domain intent logs grape_t_xwrite_log is per-domain by design, and since unique_key() every real call appends a row (idempotency moved into the target primitive), so the applied rows only grow. That turns the drain's status IN (pending, failed) scan into a growing table scan, and nothing was watching for dead letters. scripts/xwrite_reconcile.py connects all three domains in one run: - report: counts per status, oldest open intent age, top actions, dead-letter sample - archive: delete applied rows older than N days in batches (dry-run by default) - requeue: reset one dead letter to failed/attempts=0 after a human fixes the cause - daily: archive + report, exits non-zero when a domain has dead letters or cannot be reached, so the timer turns red instead of failing silently Installed as a daily 03:20 timer on both hosts. | 10 days ago |
| Files | Last commit | Last update |
|---|---|---|
| 11 days ago | ||
| 4 hours ago | ||
| 6 hours ago | ||
| 8 days ago | ||
| 11 days ago | ||
| 1 month ago | ||
| 20 days ago | ||
| 20 days ago | ||
| 21 days ago | ||
| 5 days ago | ||
| 11 days ago | ||
| 20 days ago | ||
| 11 days ago | ||
| 20 days ago | ||
| 5 days ago | ||
| 20 days ago | ||
| 10 days ago | ||
| 20 days ago | ||
| 9 days ago | ||
| 6 hours ago | ||
| 3 days ago | ||
| 3 days ago | ||
| 4 days ago | ||
| 10 days ago | ||
| 10 days ago | ||
| 6 days ago | ||
| 1 month ago | ||
| 10 days ago | ||
| 3 days ago | ||
| 1 month ago | ||
| 10 days ago | ||
| 3 days ago | ||
| 5 days ago | ||
| 9 days ago | ||
| 3 days ago | ||
| 8 days ago | ||
| 8 days ago | ||
| 1 month ago | ||
| 2 months ago | ||
| 20 days ago | ||
| 10 days ago | ||
| 8 days ago | ||
| 7 days ago | ||
| 20 days ago | ||
| 12 days ago | ||
| 9 days ago | ||
| 20 days ago | ||
| 20 days ago | ||
| 11 days ago | ||
| 3 months ago | ||
| 5 days ago | ||
| 11 days ago | ||
| 11 days ago | ||
| 5 days ago | ||
| 9 days ago | ||
| 3 days ago | ||
| 7 days ago | ||
| 3 months ago | ||
| 8 days ago | ||
| 6 hours ago | ||
| 6 hours ago | ||
| 8 days ago | ||
| 20 days ago | ||
| 20 days ago | ||
| 8 days ago | ||
| 11 days ago | ||
| 12 days ago | ||
| 12 days ago | ||
| 1 month ago | ||
| 8 days ago | ||
| 8 days ago | ||
| 3 days ago | ||
| 5 days ago | ||
| 8 days ago | ||
| 5 days ago | ||
| 9 days ago | ||
| 5 days ago | ||
| 8 days ago | ||
| 8 days ago | ||
| 3 days ago | ||
| 3 days ago | ||
| 1 month ago | ||
| 1 day ago | ||
| 1 day ago | ||
| 20 days ago | ||
| 20 days ago | ||
| 12 days ago | ||
| 8 days ago | ||
| 4 days ago | ||
| 8 days ago | ||
| 12 days ago | ||
| 10 days ago | ||
| 1 month ago | ||
| 8 days ago | ||
| 5 days ago | ||
| 5 days ago | ||
| 9 days ago | ||
| 3 days ago | ||
| 3 days ago | ||
| 6 days ago | ||
| 20 days ago | ||
| 3 days ago | ||
| 2 months ago | ||
| 5 days ago | ||
| 6 days ago | ||
| 7 days ago | ||
| 5 days ago | ||
| 20 days ago | ||
| 20 days ago | ||
| 10 days ago | ||
| 3 days ago | ||
| 10 days ago | ||
| 10 days ago | ||
| 10 days ago | ||
| 5 days ago | ||
| 10 days ago |