Skip to content

Serve no knowledge tied to the evaluated problem families - #74

Merged
alhermann merged 2 commits into
mainfrom
fix/family-specific-knowledge
Oct 15, 2026
Merged

alhermann merged 2 commits into
mainfrom
fix/family-specific-knowledge

Conversation

@alhermann

Copy link
Copy Markdown
Collaborator

Why

An audit of the knowledge openPASO served during its evaluation found entries tied to the problem families it was evaluated on. Each carried one of these: a family's tensor, contrast or Poisson's ratio; values of a development solution; the leading terms of a development problem's source term; or the name of a development run. Each entry below keeps its lesson and loses the family-specific part.

What changes

Where Before After
NGSolve pitfalls (matrix CoefficientFunction, specialcf.xref) measured with a family's tensor, domain, element and mesh; quoted the maximum and the order of a development solution re-measured on K = [[5,2],[2,4]], u = sin(pi x) sin(pi y), maxh 1/4 to 1/32, NGSolve 6.2.2604 (below)
audit_results, the xref finding quoted the same development values quotes the new measurement
weak-form check (error message, argument examples) the family's tensor; leading terms of a development source term [[5,2],[2,4]]; 2*pi**2*sin(pi*x)*sin(pi*y)
coupling knowledge, flux recovery (two copies) the contrast and coarsest mesh of a family, and the error at them "a high-contrast pair at a coarse mesh, more than the 5% tolerance"
DUNE coupling contract config example built from a development source term; the error size of a development run neutral example; no number
4C HEX8 locking entry measurement at NUE 0.4999 with KINEM linear, a family's setting dropped; the measurement at NUE 0.499 stays
FEBio body-force entry; deck-grammar docstring named development runs no names
rule "a solver's input language is not Python"; deck-lint docstring examples from development source terms neutral examples; the 4C parse error re-measured for the new expression

The two scikit-fem templates the audit also listed (biharmonic with Morley elements, Stokes with Taylor–Hood elements) are generic templates of their method and stay.

Measurements behind the new text

NGSolve 6.2.2604, H1 order 1, unit square, maxh = 1/4, 1/8, 1/16, 1/32:

spelling error against sin(pi x) sin(pi y) at maxh = 1/32 order (last pair) own successive differences
CoefficientFunction((5,2,2,4), dims=(2,2)) 0.14 % 2.07 order 2.3
CoefficientFunction([[5,2],[2,4]]) 12.5 % 0.02 order 2.2 to 2.5
matrix form, source built from specialcf.xref 46 % 0.06 factor 2.7 per level

The nested-list spelling assembles the same stiffness matrix, bit for bit, as CoefficientFunction(5.0). Its field differs from that solve by at most 2.3e-15.

4C 2026.2.0-dev, SYMBOLIC_FUNCTION_OF_SPACE_TIME: "2*pi**2*sin(pi*x)*sin(pi*y)" stops with Error while parsing: ... Expected a primary expression.; the same expression with ^ runs to processor 0 finished normally.

New guard

test_no_polynomial_source_term_as_an_example: agent-reachable text carries no polynomial with numeric coefficients as an example, the shape of a development problem's source term. On the current main it fails on exactly the three examples above; on this branch it passes. A planted test shows that it can fail.

Tests

  • .venv: 101 passed, 13 skipped (tests/ without test_web_search_reports_a_block.py; the skips are a missing 4C source tree, dolfinx not importable, and backends without reference-only areas).
  • .venv-lg: 11 passed (test_web_search_reports_a_block.py).

🤖 Generated with Claude Code

An audit of the knowledge openPASO served during its evaluation found
entries tied to the problem families it was evaluated on: a family's
tensor, contrast or Poisson's ratio, values of a development solution,
the leading terms of a development problem's source term, or the name of
a development run. Each entry keeps its lesson and loses the
family-specific part.

- NGSolve: the pitfalls on a matrix CoefficientFunction and on
  specialcf.xref are re-measured on a tensor and a solution no family
  uses (K = [[5,2],[2,4]], u = sin(pi x) sin(pi y), maxh 1/4 to 1/32,
  NGSolve 6.2.2604); the xref finding of audit_results quotes the new
  measurement.
- Weak-form check: its error message and argument examples use a neutral
  tensor and source term.
- Coupling knowledge: the flux-recovery measurement no longer names the
  contrast and mesh it was measured at (both copies); the DUNE contract's
  config example and a development error size are neutral.
- 4C: the HEX8 locking entry drops the measurement at NUE 0.4999 with
  KINEM linear.
- FEBio: the body-force entry and the deck-grammar module no longer name
  development runs.
- Input-language rule: neutral examples; the 4C parse error is quoted as
  measured on 4C 2026.2.0-dev for the new expression; the deck-lint
  docstring no longer quotes a development source term.
- New guard: agent-reachable text carries no polynomial with numeric
  coefficients as an example, the shape of a development problem's
  source term. It fails on the previous text and passes now.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new contamination guard misses powered polynomial examples when a preceding linear pair consumes an overlapping match.

1 open finding
What changed in this PR

Removes evaluation-family-specific details from served solver knowledge while preserving general guidance.

Changes:

  • Replaces development-problem examples and measurements with neutral alternatives.
  • Removes development-run identifiers and selected family-specific values.
  • Adds a guard against polynomial source-term examples.
File Description
tests/​test_knowledge_not_contaminated.py Adds polynomial-example detection and planted checks.
src/​tools/​result_audit.py Replaces development-specific xref measurements.
src/​tools/​knowledge.py Uses a neutral expression-parser example.
src/​tools/​fourc_deck_lint.py Generalizes a docstring’s source-term example.
src/​tools/​coupling_knowledge.py Removes family-specific coupling examples and values.
src/​tools/​consolidated.py Updates weak-form examples and flux guidance.
src/​backends/​ngsolve/​generators/​poisson.py Replaces tensor and coordinate-pitfall measurements.
src/​backends/​fourc/​generators/​solid_mechanics.py Removes a family-specific locking measurement.
src/​backends/​febio/​deck_grammar.py Removes a development-run identifier from documentation.
src/​backends/​febio/​backend.py Removes a development-run identifier from guidance.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

finditer took non-overlapping pairs, so in 3*x + 2*y - 7*x**2*y the linear
pair consumed the 2*y that starts the pair with the power, and the example
passed. The guard now looks ahead at every monomial start; a planted case
with a leading linear pair shows it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused knowledge edits and contamination guard have no unresolved findings, and the prior overlapping-pair issue is addressed.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@alhermann
alhermann merged commit fd19a85 into main Oct 15, 2026
3 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