Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b2915fe
fix(core): 修复关系分页造成的路径误判
xiaoland Nov 27, 2026
8d222d0
fix(memos): 保留并发上传追加的全部附件
xiaoland Nov 27, 2026
92ffd57
fix(core): 恢复扩展共享状态的数据库写入保护
xiaoland Nov 27, 2026
d60bc6c
chore(tests): 补齐行为契约与持久化验收入口
xiaoland Nov 27, 2026
2922000
fix(tests): 让 PostgREST 验收遵循共享状态删除约束
xiaoland Nov 27, 2026
6096624
docs(tests): 记录完整镜像验收与审计交付证据
xiaoland Nov 27, 2026
4c64ef4
ref(tests): 为全库场景提供独占的迁移数据库
xiaoland Nov 28, 2026
62dbebf
fix(capture): 读取截图并拒绝空采集与超限材料
xiaoland Nov 28, 2026
012a088
fix(core): 按原文位置截取 Unicode 词法命中
xiaoland Nov 28, 2026
0b42ce0
fix(twitter): 恢复账户页的同源断开表单
xiaoland Nov 28, 2026
56a2f99
ref(core): 以真实启动、调度和 HTTP 替换测试旁路
xiaoland Nov 28, 2026
5e1e733
ref(extensions): 通过持久图和协议验证来源契约
xiaoland Nov 28, 2026
f5d7bf5
ref(tests): 在独立信息库和命令进程验证检索行为
xiaoland Nov 28, 2026
7a0a32d
chore(ci): 发现全部默认测试并验证真实重置与制品恢复
xiaoland Nov 28, 2026
e1490c2
docs(tests): 记录全仓二次审计与独立保留复核
xiaoland Nov 28, 2026
4943a58
ref(tests): 删除重复验证和测试专用生产接口
xiaoland Nov 28, 2026
39f4d18
docs(tests): 记录删项和继续承担契约的验证入口
xiaoland Nov 28, 2026
ccda5bf
fix(database): 缺少角色密码时保留开发库数据
xiaoland Nov 28, 2026
eb26cf9
ref(tests): 按真实调用边界复审测试与验收
xiaoland Nov 28, 2026
564724a
Merge commit 'eb26cf9' into test/job-closure-audit-integration
xiaoland Nov 28, 2026
cc644b1
test(job): 证明另一 Peer 不会终结清理中的执行
xiaoland Nov 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changes/development-reset-secret-guard.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
开发库重置会在清空数据前检查用于重新配置数据库角色的密码。缺少密码时保留原有数据。
1 change: 1 addition & 0 deletions .changes/extension-state-guard.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
恢复 Extension 共享状态的数据库写入保护:禁止插入非空状态或删除仍持有状态的 Extension,避免原生数据库调用绕过状态生命周期。已部署数据库通过新增迁移修复,既有数据不被改写。
1 change: 1 addition & 0 deletions .changes/graph-path-pagination.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
修复图导航最短路径在大量平行关系遮住较早关系时误报不存在的问题:遍历完整的 endpoint 分页,继续遵守调用方的跳数与 Block 探索预算。
1 change: 1 addition & 0 deletions .changes/lexical-unicode-excerpt.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
修复词法检索在多语种正文中返回错误摘录的问题。命中词之前出现 ß 等大小写折叠后长度变化的字符时,摘录仍按原文位置展示命中内容。
17 changes: 6 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ jobs:
--health-interval 5s
--health-timeout 5s
--health-retries 12
env:
PRODUCTION_PREFLIGHT_TEST_DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/inkcre
steps:
- name: Checkout
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
Expand All @@ -72,11 +70,8 @@ jobs:
RELEASE_PR: ${{ github.event.pull_request.head.ref == 'release/next' }}
run: bash scripts/automation/repository_check.sh release-intent

- name: Run repository contract
run: pdm run check

- name: Verify ChatGPT deployment lifecycle
run: pdm run python -m pytest -q deploy/integrations/chatgpt/tests
- name: Run repository static and package checks
run: pdm run check:code

- name: Initialize disposable business-test database
env:
Expand All @@ -86,15 +81,15 @@ jobs:
POSTGREST_DATABASE_PASSWORD: ci-postgrest-test-password-at-least-32-bytes
run: pdm run db:init --profile development

- name: Run required PostgreSQL business scenarios
- name: Run the repository suite with disposable PostgreSQL
env:
CORE_DATABASE_PASSWORD: ci-core-test-password-at-least-32-bytes
POSTGREST_DATABASE_PASSWORD: ci-postgrest-test-password-at-least-32-bytes
INKCRE_TEST_DATABASE_URL: postgresql+psycopg://inkcre_core:ci-core-test-password-at-least-32-bytes@127.0.0.1:5432/inkcre
MIGRATION_DATABASE_URL: postgresql+psycopg://postgres:postgres@127.0.0.1:5432/inkcre
INKCRE_TEST_POSTGRES_ADMIN_URL: postgresql://postgres:postgres@127.0.0.1:5432/inkcre
run: pdm run test:database

- name: Verify documentation publication and partial Preview reporting
run: pdm run python -m pytest -q scripts/tests/test_extension_documentation.py scripts/tests/test_preview_delivery.py

- name: Build and verify all first-party wheels
env:
SOURCE_DATE_EPOCH: "315532800"
Expand Down
10 changes: 7 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ pdm run check
`doctor` reports a mismatch when the local toolchain does not match that contract.

Git hook 需要在每个本地 checkout 安装;提交前会执行与 CI 相同的格式和 lint 入口。
移动仓库目录后,需要重建含旧绝对路径的虚拟环境入口并重新安装 hook;CI 的完整
`check` 仍是交付检查依据。
移动仓库目录后,需要重建含旧绝对路径的虚拟环境入口并重新安装 hook;CI 使用同一份检查配置。

`check` is the same hermetic repository gate used by CI. It verifies the lock and
`check` runs the local repository gate. CI runs its static and package checks before executing the same test collection with disposable PostgreSQL. It verifies the lock and
requirements export, migration configuration and append-only baseline, Ruff formatting,
repository lint, static types, and the repository test suite. Use narrower commands while iterating:

Expand All @@ -38,6 +37,11 @@ pdm run lint
pdm run check:foundation
```

默认测试覆盖 `tests/`、`scripts/tests/` 和 ChatGPT 伴随进程生命周期,排除显式 `acceptance`。
数据库回归由 `pdm run test:database` 在一次性 PostgreSQL 集群执行;环境输入、各验证层的含义及
真实供应商验收边界见[开发环境](docs/40-deployment/development-environment.md#required-environment-variables)。
本机重型构建(包括检查中的 wheel 构建)使用 `agent-build` 启动,例如 `agent-build pdm run check`。

Verification follows the organization-wide
[Verification and Test Policy](https://github.com/InKCre/.github/blob/main/TESTING.md). The remaining
migration, integration, and acceptance suites are repository-local admitted exceptions; they do not
Expand Down
57 changes: 3 additions & 54 deletions app/business/extension/distribution.py
Original file line number Diff line number Diff line change
@@ -1,61 +1,10 @@
"""Core facade for Distribution acquisition owned by the Extension Runtime."""

import typing
from pathlib import Path
"""Core imports for the Extension Runtime's package acquisition API."""

from inkcre_extension_runtime_core_py.distribution import (
AcquiredDistribution,
PipDistributionConsumer as RuntimePipDistributionConsumer,
PipDistributionConsumer,
)
from inkcre_extension_runtime_core_py.modules import DistributionModules

from .release import ExtensionReleaseDescriptor, PythonReleaseDescriptor


class DistributionConsumer(typing.Protocol):
def download(
self,
release: ExtensionReleaseDescriptor,
association: PythonReleaseDescriptor,
host_version: str,
wheel_dir: Path,
) -> Path: ...

def apply(
self,
extension_wheel: Path,
release: ExtensionReleaseDescriptor,
association: PythonReleaseDescriptor,
host_version: str,
) -> AcquiredDistribution: ...


class PipDistributionConsumer:
def __init__(self, origin: str) -> None:
self._runtime = RuntimePipDistributionConsumer(origin)

def download(
self,
release: ExtensionReleaseDescriptor,
association: PythonReleaseDescriptor,
host_version: str,
wheel_dir: Path,
) -> Path:
return self._runtime.download(release, association, host_version, wheel_dir)

def apply(
self,
extension_wheel: Path,
release: ExtensionReleaseDescriptor,
association: PythonReleaseDescriptor,
host_version: str,
) -> AcquiredDistribution:
return self._runtime.apply(extension_wheel, release, association, host_version)


__all__ = [
"AcquiredDistribution",
"DistributionConsumer",
"DistributionModules",
"PipDistributionConsumer",
]
__all__ = ["AcquiredDistribution", "DistributionModules", "PipDistributionConsumer"]
39 changes: 10 additions & 29 deletions app/business/extension/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

from .distribution import (
AcquiredDistribution,
DistributionConsumer,
DistributionModules,
PipDistributionConsumer,
)
Expand All @@ -57,7 +56,6 @@
PythonReleaseDescriptor,
RegistryReleaseClient,
ReleaseState,
ReleaseResolver,
require_python_association,
validate_coordinate,
)
Expand All @@ -68,7 +66,6 @@
)
from .state import (
ExtensionParticipation,
ExtensionStore,
InstalledExtension,
ExtensionStateService,
)
Expand Down Expand Up @@ -121,7 +118,7 @@ class _ActiveExtensionModel:

name: str
config: dict[str, typing.Any]
store: ExtensionStore
store: ExtensionStateService
peer_id: typing.Any
distribution: str
version: str
Expand Down Expand Up @@ -179,20 +176,8 @@ class RunningExtension:
class ExtensionHost:
"""Core’s Python-only runtime over shared identities and Peer selections."""

def __init__(
self,
*,
store: ExtensionStore | None = None,
release_client: ReleaseResolver | None = None,
distribution_consumer: DistributionConsumer | None = None,
registry_origin_resolver: typing.Callable[[], typing.Awaitable[str]] | None = None,
) -> None:
self.store = store or ExtensionStateService()
self.release_client = release_client
self.distribution_consumer = distribution_consumer
self.registry_origin_resolver = (
registry_origin_resolver or resolve_extension_registry_origin
)
def __init__(self) -> None:
self.store = ExtensionStateService()
self.running: dict[str, RunningExtension] = {}
self.fastapi_app: fastapi.FastAPI | None = None
self._loaded_versions: dict[str, str] = {}
Expand Down Expand Up @@ -325,7 +310,7 @@ def _resolve(
version: str,
*,
allow_yanked: bool,
release_client: ReleaseResolver,
release_client: RegistryReleaseClient,
):
release = release_client.get(name, version)
if release.state is ReleaseState.yanked and allow_yanked:
Expand Down Expand Up @@ -564,17 +549,13 @@ async def patch_config(
name, {**current.config, **patch}, peer_id=peer_id
)

async def _operation_consumers(
self,
) -> tuple[ReleaseResolver, DistributionConsumer]:
if self.release_client is not None and self.distribution_consumer is not None:
return self.release_client, self.distribution_consumer
origin = await self.registry_origin_resolver()
release_client = self.release_client or RegistryReleaseClient(
origin, settings.extension_registry_timeout_seconds
@staticmethod
async def _operation_consumers() -> tuple[RegistryReleaseClient, PipDistributionConsumer]:
origin = await resolve_extension_registry_origin()
return (
RegistryReleaseClient(origin, settings.extension_registry_timeout_seconds),
PipDistributionConsumer(origin),
)
consumer = self.distribution_consumer or PipDistributionConsumer(origin)
return release_client, consumer

async def provision_enabled_distributions(self) -> None:
"""Apply missing exact enabled Python pins before this process starts serving."""
Expand Down
7 changes: 0 additions & 7 deletions app/business/extension/release.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
"""Core facade for exact Release resolution owned by the Extension Runtime."""

import typing

from inkcre_extension_runtime_core_py.contracts import (
ExtensionReleaseDescriptor,
PythonReleaseDescriptor,
Expand All @@ -17,10 +15,6 @@
from app.version import CORE_VERSION


class ReleaseResolver(typing.Protocol):
def get(self, name: str, version: str) -> ExtensionReleaseDescriptor: ...


def require_python_association(
release: ExtensionReleaseDescriptor,
) -> PythonReleaseDescriptor:
Expand All @@ -31,7 +25,6 @@ def require_python_association(
"ExtensionReleaseDescriptor",
"PythonReleaseDescriptor",
"RegistryReleaseClient",
"ReleaseResolver",
"ReleaseState",
"require_python_association",
"simple_project_and_index_urls",
Expand Down
63 changes: 0 additions & 63 deletions app/business/extension/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,69 +46,6 @@ class ExtensionParticipation(pydantic.BaseModel):
]


class ExtensionStore(typing.Protocol):
async def list(self) -> tuple[InstalledExtension, ...]: ...

async def get(self, name: str) -> InstalledExtension | None: ...

async def ensure(self, name: str, nickname: str) -> InstalledExtension: ...

async def uninstall(self, name: str) -> None: ...

async def read_config(self, name: str) -> dict[str, typing.Any]: ...

async def update_config(
self, name: str, config: dict[str, typing.Any]
) -> InstalledExtension: ...

async def read_state(self, name: str) -> dict[str, typing.Any]: ...

async def mutate_state(
self, name: str, transform: StateMutation
) -> dict[str, typing.Any]: ...

async def mutate_config_and_state(
self,
name: str,
transform: ConfigStateMutation,
) -> tuple[dict[str, typing.Any], dict[str, typing.Any]]: ...

async def list_participations(
self, peer_id: uuid.UUID
) -> tuple[ExtensionParticipation, ...]: ...

async def get_participation(
self, peer_id: uuid.UUID, name: str
) -> ExtensionParticipation | None: ...

async def select_participation(
self,
peer_id: uuid.UUID,
name: str,
distribution: str,
version: str,
) -> ExtensionParticipation: ...

async def resolve_legacy_python_participation(
self, peer_id: uuid.UUID, name: str, version: str
) -> ExtensionParticipation: ...

async def set_participation_enabled(
self, peer_id: uuid.UUID, name: str, enabled: bool
) -> ExtensionParticipation: ...

async def remove_participation(self, peer_id: uuid.UUID, name: str) -> None: ...

async def update_participation_config_schema(
self,
peer_id: uuid.UUID,
name: str,
distribution: str,
version: str,
schema: dict[str, typing.Any],
) -> ExtensionParticipation: ...


class ExtensionStateService:
"""Transactional adapter over shared identity and Peer-scoped state."""

Expand Down
Loading
Loading