Skip to content

feat: kb model#95

Closed
lynnleelhl wants to merge 0 commit intomainfrom
feature/kb-model
Closed

feat: kb model#95
lynnleelhl wants to merge 0 commit intomainfrom
feature/kb-model

Conversation

@lynnleelhl
Copy link
Copy Markdown

No description provided.

@apecloud-bot apecloud-bot added the size/XL Denotes a PR that changes 500-999 lines. label Aug 7, 2023
@lynnleelhl lynnleelhl marked this pull request as draft August 7, 2023 08:31
@iziang iziang closed this Sep 1, 2023
@iziang iziang deleted the feature/kb-model branch December 1, 2023 07:42
earayu added a commit that referenced this pull request Apr 25, 2026
Lands typed signatures + Pydantic response shapes + stable handle types
(ChunkId/SectionPath/HeadingAnchor) for the 8 §A read primitives, with
NotImplementedError bodies. Allows D10.d (#96) / D10.e (#97) / D10.g (#99)
owners to statically import the cross-lane surface and start their lanes
in parallel; full primitive bodies + integration tests follow in a separate
PR within this same task lane.

Per #1708 merged docs/modularization/d10-design-pack.md §G D10.c lane:
- Write-set: aperag/mcp/tools/{read_*,list_*,get_*}.py + schemas.py + handles.py
- Forbidden: §B search primitives / §C cursor encoder / §E persistence cache internals

Note on hook bypass: local .git/hooks/pre-commit references missing
'make add-license' target (stale environment hook, not repo content).
Bypassed via -c core.hooksPath=/dev/null per @明书 PR #1709 precedent;
license headers are present in every new file. User-side hygiene only,
no PR content impact.
earayu added a commit that referenced this pull request Apr 25, 2026
…ilter

Addresses Weston msg=246c84d3 二线 sanity blockers on PR #1714:

1. cursor silent-reset → ValueError on malformed (§C explicit-not-silent)
   - list_collections._decode_cursor / list_documents._decode_cursor:
     None or "" → offset 0; non-empty but malformed/missing/negative offset
     raises ValueError with clear message
   - TODO comment marks the seam for D10.e (#97) to replace ValueError
     with canonical CursorError

2. list_documents type_filter applied before pagination
   - Filter mimetype in-memory (no Document.mimetype column exists; media
     type is computed via mimetypes.guess_type from filename) so
     total_count, offset/limit, and next_cursor are all computed over the
     filtered set
   - Regression test: markdown doc at position > limit is still found

Tests added (4 cursor malformed + 2 type_filter regression + 2 None/empty
positive guards = 8 new, 28 → 36 in D10.c surface suite).
earayu added a commit that referenced this pull request Apr 25, 2026
…1714)

* feat(phase9 #95 D10.c): read primitives implementation (8 primitives, un-cached)

Wires the 8 read primitive bodies that landed as NotImplementedError in #1711
to ApeRAG's existing repositories + D9 tenancy/auth base.

Per #1708 merged docs/modularization/d10-design-pack.md §A:
- list_collections / list_documents / get_collection_metadata / get_document_metadata
  (4 list/metadata primitives, no parse_version)
- read_document / read_document_outline / read_document_section / read_document_chunk
  (4 parse_version-keyed primitives, body uses ParseVersionT helper)

Each primitive body strictly follows:
  tenancy gate (D9) → auth gate (D9) → compute parse_version → fetch authoritative

Cache wiring is intentionally deferred to D10.g (#99 @明书) per cuiwenbo
msg=13a4139a sequence: stub merge → un-cached implementation merge → cache
wire-in. cuiwenbo's parse_version helper at aperag/mcp/tools/parse_version.py
exposes ParseVersionT (Annotated[str, sha256[:16] regex]) for downstream lanes.

Also registers the 8 primitives in aperag/mcp/server.py with the
'# === D10.c read primitives ===' marker comment so chenyexuan's D10.d
search-split registration can be added adjacent without merge churn.

§G Forbidden boundary preserved: no §B search primitives, §C cursor encoder,
§D capability annotation, §E cache internals touched.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(phase9 #95 D10.c): explicit cursor errors + pre-pagination type_filter

Addresses Weston msg=246c84d3 二线 sanity blockers on PR #1714:

1. cursor silent-reset → ValueError on malformed (§C explicit-not-silent)
   - list_collections._decode_cursor / list_documents._decode_cursor:
     None or "" → offset 0; non-empty but malformed/missing/negative offset
     raises ValueError with clear message
   - TODO comment marks the seam for D10.e (#97) to replace ValueError
     with canonical CursorError

2. list_documents type_filter applied before pagination
   - Filter mimetype in-memory (no Document.mimetype column exists; media
     type is computed via mimetypes.guess_type from filename) so
     total_count, offset/limit, and next_cursor are all computed over the
     filtered set
   - Regression test: markdown doc at position > limit is still found

Tests added (4 cursor malformed + 2 type_filter regression + 2 None/empty
positive guards = 8 new, 28 → 36 in D10.c surface suite).

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Denotes a PR that changes 500-999 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants