Skip to content

Sync back from odpi main 06038b2d (#121, #122) - #1117

Merged
dwolfson merged 9 commits into
mainfrom
claude/sync-back-from-odpi-2026-11-19
Nov 19, 2026
Merged

dwolfson merged 9 commits into
mainfrom
claude/sync-back-from-odpi-2026-11-19

Conversation

@dwolfson

Copy link
Copy Markdown
Owner

Sync back from odpi/egeria-trellis main (06038b2)

This brings fork main up to odpi main after odpi#126. It is a fast-forward: fork main 6b80583 is an ancestor of odpi main 06038b2. After it merges, the fork and odpi hold the same code.

What it adds to fork main:

No new code beyond those two external contributions. They were checked before #126 merged:

  • the Architect's read-back passed;
  • gate b459 passed on this exact tree, a0f0fc24: RE 15566 passed, 0 failed; trellis-context 31; trellis-querycache 41.

Please merge it with a merge commit or a fast-forward, not a squash, so fork main keeps odpi's history.

🤖 Generated with Claude Code

dwolfson and others added 9 commits November 8, 2026 08:09
pack() admitted sections breadth-first in spec order. An optional section
declared ahead of a required one could therefore spend the budget the
required one needed, and the compile failed with "required section ...
does not fit" even though the required section fitted on its own. That
contradicts Section.required ("never dropped; the compile fails only if it
cannot fit even at its coarsest allowed rung") and the role docstring
("a packer drops evidence before instructions"), and made whether a valid
spec compiled depend on declaration order.

Admission now runs in two tiers: required sections first, then optional
ones, each tier in spec order. A symmetric group with any required member
is admitted in the required tier, because group members are admitted
together. Only the admission order changes: the packed sections and the
manifest stay in spec order, and the upgrade pass is untouched. Specs that
already declare their required sections first (Resource Explorer's
context_compile.py) pack exactly as before.

Tests: a new TestRequiredFirst class covers a required section declared
after an optional one, a required group declared after an optional
section (both raised BudgetError before this change), and that output
order still follows the spec.

Fixes #119

Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
With backend="redis", any Redis error from get() or set() reached the
caller. A Redis outage therefore failed every cached request path (for
example Resource Explorer's RAG queries, which consult the cache first)
with redis.exceptions.ConnectionError, instead of running them uncached.
The class already holds that "a cache that cannot store something must
still not break the operation it was speeding up", but applied it only
to values that aren't JSON-serializable.

Now:
- get() treats a RedisError as a miss (counted in the stats) and logs a
  warning;
- set() treats a RedisError as "not cached" and logs a warning;
- invalidate_scope() and clear() still raise. They are explicit
  maintenance calls, and reporting an invalidation that never reached
  Redis as done would leave stale answers to be served once Redis is back.

The exception class is captured in _connect_redis, so the redis package
is still imported only when Redis is configured. Only RedisError is
absorbed; any other exception still propagates.

Writes also register the key in its scope set before storing the value.
Previously the value went first, so a failure between the two commands
left an entry its scope did not list, which invalidate_scope() could
never remove. In the new order the same failure leaves only a set
member with no entry, which is harmless.

Tests: the Redis backend had no coverage. A small in-memory stand-in for
the redis module (installed through sys.modules, so neither a server nor
the optional extra is needed) now covers round-trips, scope invalidation,
unserializable values, reads and writes during an outage, recovery,
logging, invalidation still raising, non-Redis errors still raising, and
the partial-write case. The README's design notes describe the outage
behaviour.

Fixes #120

Signed-off-by: NopeCharon <115794254+NopeCharon@users.noreply.github.com>
Sync main from dwolfson/trellis (c6a1b64 → 65fb2ea): newcomer install docs + 2026-11-08..18 work
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
… before optional ones in pack()

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…Redis as a cache miss

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…nto the odpi sync

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson merged commit 1e96b27 into main Nov 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants