Repository navigation
feat(api): result ledgers + report fields (policy R3) - #248
Merged
Merged
Conversation
Implements the ledger half of docs/api-error-policy.md.
- create_entities -> {created, existing}; create_relations ->
{created, skippedDuplicates}; add_observations gains alreadyPresent
- deletes return {deleted, notFound}: entities by name; relations with
reason entity|relation; observations with reason entity|observation
- open_nodes carries missing[] for partial misses; sequentialthinking
returns linkedTo
- random_walk reports modeUsed (merw | uniform | merw+fallback) and
fallbackSteps — the C walk now counts merw-requested steps that fell
back to uniform because psi weighting was unavailable (honest labeling,
cf. D_NoUsageClaimWithoutTheRealThing)
- kb_load returns per-stage counts: entities {created, existing},
relations {created, skippedDuplicates}
- tests: new ledger block (9 cases) + shape updates; suite 192/192
Co-Authored-By: Claude Code <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ledger half of
docs/api-error-policy.md: every mutating success now enumerates per-item outcomes — no more bare "successfully", no more ambiguous empty returns.What changed
create_entities→{created, existing};create_relations→{created, skippedDuplicates};add_observationsentries gainalreadyPresent.{deleted, notFound}: entities by name; relations withreason: entity | relation; observations withreason: entity | observation.open_nodescarriesmissing[]for partial misses (all-missing still errors, per R1).sequentialthinkingreturnslinkedTo.random_walkreportsmodeUsed(merw|uniform|merw+fallback) andfallbackSteps— the C walk now counts steps where merw-requested sampling fell back to uniform because ψ was unavailable, so the result never claims MERW it didn't run.kb_loadreturns per-stage counts:entities {created, existing},relations {created, skippedDuplicates}.Evidence
API ledgers (R3)test block (9 cases): dupe reporting, exact-duplicateexisting,notFoundreason discrimination, partialmissing[], walk mode reporting, chainlinkedTo.Heuristic_EmptyCreateRelationsReturnIsDedupat release time — an emptycreatedlist is now self-explanatory viaskippedDuplicates.Next in the policy: R5 cursor fingerprinting (
CURSOR_STALE).🤖 Generated with Claude Code