Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 0 additions & 20 deletions .agents/plugins/marketplace.json

This file was deleted.

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Minified build artifacts can contain semantic whitespace inside template literals.
veadk/webui/assets/**/*.js -whitespace
veadk/webui/website-integration.js -whitespace
*.sh text eol=lf
2 changes: 1 addition & 1 deletion .github/workflows/secrets-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
- name: Secret Scanning
uses: trufflesecurity/trufflehog@7dc056a193116ba8d82154bf0549381c8fb8545c # v3.88.14
with:
extra_args: --results=verified,unknown
extra_args: --results=verified,unknown --exclude-paths=.trufflehog-exclude-paths.txt
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,31 @@ cython_debug/
.trae
.claude
.agents
/.dbg/
/debug-*.md
.adk/
**/.adk/

# Local AI/design and verification artifacts. Keep evidence summaries in
# PRD/spec documents, not raw screenshots, traces, manifests, or run logs.
/.artifacts/
/.superpowers/
/evidence/

# AgentKit deploy config (contains account-specific secrets)
agentkit.yaml
agentkit*.yaml
.agentkit/

# veadk mpa create config (contains PG/model/OpenViking/Feishu secrets).
# Only the committed *.example.yaml template is allowed.
mpa-create.config.yaml
mpa-create.config*.yaml
!mpa-create.config.example.yaml
**/mpa-create.config.yaml
**/mpa-create.config*.yaml
!**/mpa-create.config.example.yaml

# PiAgent release archives are downloaded and verified during image builds.
examples/piagent_with_mcp/vendor/pi-*.tar.gz
.gstack/
5 changes: 5 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ id = "empty-env-key-pattern"
description = "Empty environment variables with KEY pattern"
regex = '''os\.environ\[".*?KEY"\]\s*=\s*".+"'''

[[rules]]
id = "hardcoded-api-key-token-secret"
description = "Hardcoded API key, token, secret, password, or credential assignment"
regex = '''(?i)\b(api[_-]?key|apikey|access[_-]?key|secret[_-]?key|client[_-]?secret|auth[_-]?token|access[_-]?token|refresh[_-]?token|session[_-]?token|bearer[_-]?token|password|credential)\b["'\s:=]{0,16}["'][A-Za-z0-9_./+=:@%-]{16,}["']'''

[allowlist]
# veadk/webui is the built (minified) web UI bundle — generated output reviewed
# via its source under frontend/, not hand-written. Minified vendor libs
Expand Down
9 changes: 8 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,11 @@ repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.24.2
hooks:
- id: gitleaks
- id: gitleaks
- repo: local
hooks:
- id: yaml-secret-scan
name: Detect concrete secrets in YAML
entry: scripts/scan_yaml_secrets.py
language: python
types_or: [yaml]
1 change: 1 addition & 0 deletions .trufflehog-exclude-paths.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
^tests/integrations/mpa_managed/test_(admin_database|auto_pg|config|deployment_database_unit|registry_url|service)\.py$
68 changes: 61 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,63 @@
# Agent Instructions

- Do not use `codex/` as a branch name prefix in this repository. Use semantic branch prefixes such as `feat/`, `fix/`, `chore/`, or `docs/`; for example, `feat/pr-748-dev`.
- Before modifying frontend code, read `frontend/SPEC.md`.
- When the user describes a requirement, propose an implementation plan before changing code, and wait for the user to be satisfied before making edits.
- After creating or switching to a new branch, run `git pull` before development. Branch names must use semantic prefixes and reflect the requirement content.
- When committing, include only changes related to the current feature or fix.
- Before committing, fetch the latest remote code, rebase the branch onto it, then run pre-commit and unit tests.
- When execution hits a pitfall such as insufficient permissions or missing dependencies, ask the user whether to document that pitfall.
VeADK includes a Python SDK, CLI/runtime integrations, and AgentKit Studio with a TypeScript/React frontend and supporting Python services. Base decisions on the relevant implementation, tests, and existing contracts rather than assumptions from another repository.

## Language and document ownership

- Keep this repository-wide development standard in English. Use English for new code identifiers, comments, and docstrings; user-facing text follows the owning area's localization rules.
- Read [prd-spec/README.md](prd-spec/README.md) before creating or updating a change design. Every PRD/design must have complete English `.md` and Chinese `.zh.md` counterparts, sharing the same directory, date, and basename.
- Read [specs/README.md](specs/README.md) before defining or changing a component contract. Maintain each component under `specs/<component>/README.md` and `README.zh.md`.
- Keep both languages semantically equivalent and update them in the same change. Preserve identifiers, commands, examples, limits, and acceptance criteria across translations. Missing or conflicting counterparts block approval and delivery.
- PRDs own change-specific intent, scope, tasks, and acceptance; component specs own maintained responsibilities, interfaces, state, data, and failure semantics. Link them rather than duplicate contracts.
- Before modifying frontend code, read `frontend/SPEC.md`; also apply it to its supporting backend interfaces as specified there. It remains the Studio development standard and is not replaced or translated by this document.
- Preserve existing user-documentation conventions: the documentation site uses Chinese `.mdx` and English `.en.mdx`; bilingual module/example READMEs use English `README.md` and Chinese `README.zh.md`.

## Required development workflow

1. **Inspect and agree on scope.** Read the affected implementation, tests, and contracts. When the user describes a requirement, propose an implementation plan and wait for the user to be satisfied before making edits. Distinguish verified facts from assumptions.
2. **Design before implementation.** Features, refactors, and bugfixes require a bilingual PRD under `prd-spec/features/`, `prd-spec/refactors/`, or `prd-spec/bugfixes/`. Include background/evidence, goals, non-goals, scenarios, requirements, design, affected files, tasks, tests, risks, and acceptance criteria.
3. **Assess component contracts.** Create or update affected bilingual component specs for changes to ownership, APIs, configuration, state/data, events, permissions, security, compatibility, runtime behavior, or observability. Record a justified no-impact conclusion when no component contract changes. Do not backfill unrelated components.
4. **Clear design review.** Review PRD/spec consistency, feasibility, boundaries, errors, security, compatibility, testability, and bilingual equivalence. Use the available `review-spec` skill; if unavailable, perform and record the same review directly. Resolve blockers and record user approval before modifying production code or tests. A generic skill's Chinese-only default does not override this repository's bilingual rule.
5. **Implement against the approved design.** Map changes to requirements/tasks, write a failing regression or contract test first, then implement and refactor within scope. Contract or scope changes return to design review before implementation proceeds.
6. **Verify and review.** Run affected tests first, then required repository and component gates. Review both implementation correctness and edge cases, resource handling, security, test quality, and contract alignment. Fix blocking findings and rerun affected checks.
7. **Reconcile and deliver.** Synchronize both document languages, component contracts, affected user docs/examples, and required generated artifacts. Record actual verification commands, results, unverified areas, and remaining risks. All agreed tasks and acceptance criteria must be satisfied before declaring completion; deferred scope requires user agreement.

Pure documentation, translation, or formatting changes that preserve runtime behavior and public contracts do not need a recursive PRD. They still require an agreed approach, applicable bilingual updates, and proportionate checks. This exception includes maintaining these development guidelines; it does not exempt code or behavioral changes.

## Implementation boundaries

- Make the smallest complete change that satisfies the approved requirement. Reuse existing modules and dependencies; avoid unrelated cleanup, speculative abstractions, and partially wired features.
- Treat public Python imports/signatures, CLI/configuration behavior, generated projects, Studio API types, and runtime/event contracts as consumer-facing boundaries. Breaking changes require explicit approval and a plan for affected callers and data; do not copy another project's blanket no-compatibility policy.
- Cover asynchronous cancellation, timeouts, late responses/events, terminal states, and resource cleanup where affected. Do not turn errors into silent success or empty results.
- Keep real credentials, signed URLs, personal data, and unredacted production logs out of source, design documents, reports, test fixtures, and generated artifacts.
- Isolate tests from real user state and external services by default. Real cloud/provider operations need explicit authorization and an isolated smoke/E2E procedure; report simulated and live verification separately.

## Verification gates

Use the repository-local Python environment and current `pyproject.toml`, `pytest.ini`, package scripts, and CI workflows as command references. Do not invent `make` targets, copy another repository's coverage thresholds, or treat an unavailable check as passing.

| Change area | Required verification |
| --- | --- |
| Python SDK, CLI, and backend | Targeted tests via `uv run --extra dev pytest <test-paths>`; broader regression tests when shared contracts or dependencies are affected. |
| Default parallel Python regression | `uv run --extra dev pytest -n 2 -m "not codex_smoke and not piagent_smoke"`; adjust worker count to available resources and record the selection. Explicit smoke runs are separate. |
| Codex runtime smoke | When affected and the environment is prepared: `CODEX_RUN_SMOKE=1 uv run --extra dev pytest -m codex_smoke -p no:xdist -rs`. This test starts real processes and binds ports; never run it under parallel pytest. Verify it actually ran rather than skipped. |
| Studio frontend | `npm --prefix frontend test` and `npm --prefix frontend run build`, plus real browser checks of the normal flow and affected loading, empty, error, cancellation, retry, keyboard/IME, and narrow-window cases. Follow `frontend/SPEC.md` for additional checks and release asset requirements. |
| Studio backend or generated Python | Targeted Python tests plus Ruff and Pyright for changed Python files, as required by `frontend/SPEC.md`; verify generated code, dependencies, configuration, and deployment payloads together. |
| Harness/sidecar contracts | The affected checks and existing coverage thresholds in `.github/workflows/harness-sidecar-release-gate.yaml`, including `npm --prefix frontend run test:harness-sidecar-coverage` when frontend sidecar contracts change. |
| PRD/spec and guideline-only changes | Check paired-language completeness, contract/identifier consistency, relative links, referenced paths/commands, and diff whitespace. No runtime test result may be claimed from documentation checks. |
| User documentation site | The affected Markdown/MDX checks and build/type checks defined in `docs/package.json`; do not apply site-specific tooling to unrelated plain Markdown without checking its scope. |

- Before committing, run `uv run --extra dev pre-commit run --all-files` and unit tests after synchronizing the branch as described below. Pre-commit includes Ruff and secret scanning; it does not replace browser, integration, or runtime verification.
- Prefer targeted checks during iteration. Expand to affected integration/E2E and regression gates for shared or high-risk changes and final delivery; explain any omitted required check.
- Record check outcomes as `pass`, `fail`, `blocked`, `not_run`, or `not_applicable`, with reasons for the last three. Include the tested revision/diff scope and execution date. Skipped tests do not prove the relevant behavior.
- Keep change-specific review and verification summaries in the bilingual PRD by default. Separate evidence artifacts are optional when useful; OpenSpec and a multi-report hierarchy are not prerequisites.

## Git and execution safety

- Do not use `codex/` as a branch name prefix. Use semantic prefixes such as `feat/`, `fix/`, `chore/`, or `docs/`, with a name reflecting the requirement.
- After creating or switching to a new branch, run `git pull` before development. If no upstream exists or synchronization fails, resolve the target explicitly rather than guessing or bypassing the requirement.
- Before committing, fetch the latest remote code, rebase the branch onto the intended remote base, then run pre-commit and unit tests. Preserve unrelated user changes and stop if safe synchronization requires a user decision.
- Commit only changes related to the current feature or fix. Commit, push, PR creation, publication, and deployment require user authorization; approval of a design does not authorize them.
- Never commit real security-sensitive information or private data to GitHub. This includes API keys, access keys, secret keys, bearer/session/refresh tokens, cookies, signed URLs, private certificates, production logs with credentials, personal data dumps, and cloud account secrets. Use placeholders, environment variables, secret references, or documented local-only setup instead.
- The repository pre-commit configuration must reject hardcoded API key and token material before a commit is created. If secret scanning reports a finding, stop and remove or redact the value rather than bypassing the hook.
- When execution hits a pitfall such as insufficient permissions or missing dependencies, ask the user whether to document that pitfall. Report blocked checks honestly and do not alter machine-global configuration or bypass gates to hide the issue.
23 changes: 23 additions & 0 deletions contracts/mpa-p0/benchmark-report.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "MPA P0 benchmark report",
"type": "object",
"additionalProperties": false,
"required": [
"schemaVersion", "revision", "endpoint", "warmupCount",
"requestCount", "concurrency", "p50Milliseconds",
"p95Milliseconds", "maxMilliseconds", "errorRate"
],
"properties": {
"schemaVersion": {"const": 1},
"revision": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"endpoint": {"type": "string", "minLength": 1},
"warmupCount": {"const": 5},
"requestCount": {"const": 100},
"concurrency": {"const": 10},
"p50Milliseconds": {"type": "number", "minimum": 0},
"p95Milliseconds": {"type": "number", "minimum": 0},
"maxMilliseconds": {"type": "number", "minimum": 0},
"errorRate": {"type": "number", "minimum": 0, "maximum": 1}
}
}
20 changes: 20 additions & 0 deletions contracts/mpa-p0/compatibility-matrix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"schemaVersion": 1,
"rules": [
{
"id": "p0-codex-rest-v1",
"mpaProfileSchemaVersion": 1,
"agentkitSdkVersion": "0.8.5",
"runtimeExecutionCapability": "urn:veadk:mpa:execution:v1",
"sessionExecutionConfigSchemaVersion": 1,
"workerProtocol": "codex",
"workerRequiredEndpoints": [
"/health",
"/ready",
"/v1/sessions",
"/v1/sessions/{session_id}/turns",
"/v1/sessions/{session_id}/events"
]
}
]
}
12 changes: 11 additions & 1 deletion examples/piagent_with_mcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ piagent_with_mcp/
├── app.py # deployable FastAPI app on :8000
├── Dockerfile # AgentKit cloud build image
├── requirements.txt
├── piagent-mcp-agentkit.yaml # veadk agentkit launch config
├── piagent-mcp-agentkit.yaml # local-only veadk agentkit launch config
├── vendor/
│ └── veadk_python-*.whl # local VeADK build installed by Dockerfile
└── agents/
Expand Down Expand Up @@ -124,10 +124,20 @@ Then launch from this example directory:

```bash
cd examples/piagent_with_mcp
veadk agentkit config \
--agent_name piagent_with_mcp --entry_point app.py \
--language Python --language_version 3.12 \
--launch_type cloud --region cn-beijing \
--tos_bucket Auto \
--runtime_name piagent_with_mcp --runtime_apikey_name Auto
veadk agentkit launch --config-file piagent-mcp-agentkit.yaml --platform linux/amd64
veadk agentkit status --config-file piagent-mcp-agentkit.yaml
```

Move the generated `agentkit.yaml` to `piagent-mcp-agentkit.yaml` if you want
to follow the commands below. Keep that file local: it can contain runtime IDs,
account-specific endpoints, and API keys after launch.

Invoke after the runtime is ready:

```bash
Expand Down
14 changes: 7 additions & 7 deletions examples/piagent_with_mcp/piagent-mcp-agentkit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ launch_types:
cr_namespace_name: agentkit
cr_repo_name: piagent-with-mcp
cr_auto_create_instance_type: Micro
cr_image_full_url: agentkit-platform-2107625663-cn-beijing.cr.volces.com/agentkit/piagent-with-mcp:20260715155044
cr_image_full_url: <registry>/<namespace>/piagent-with-mcp:<tag>
build_timeout: 3600
cp_workspace_name: agentkit-cli-workspace
cp_pipeline_name: piagent-with-mcp
cp_pipeline_id: f472fcdc6f4848fe8889c0855caaa2d0
runtime_id: r-yeqksmpybko2eybtg5z8
cp_pipeline_id: <pipeline-id>
runtime_id: <runtime-id>
runtime_name: piagent-with-mcp
runtime_role_name: AgentKit_Runtime_Default_ServiceRole_j1gzh8c
runtime_role_name: <runtime-role-name>
runtime_auth_type: key_auth
runtime_apikey_name: API-KEY-da6ikern
runtime_apikey: BNwxzuKr9hoKhJwJgm2laluVs_yN_BIfzQKN
runtime_apikey_name: <runtime-api-key-name>
runtime_apikey: <runtime-api-key>
runtime_jwt_allowed_clients: []
runtime_endpoint: https://scd6b76f5sagn55rj2dh1.apigateway-cn-beijing.volceapi.com
runtime_endpoint: <runtime-endpoint>
docker_build:
platform: linux/amd64
Loading
Loading