knowledge: 8 insights — Python class introspection, PG derived-table SubLink duplication, browser console-capture gaps, extension reload, degenerate expectation sets, ORM-generated test schema, APFS recovery - #119
Conversation
|
Cross-Check: independent adversarial Note: the |
…SubLink duplication, browser console-capture gaps, extension reload, degenerate expectation sets, ORM-generated test schema, APFS recovery (#119) * knowledge: ingest 8 verified insight(s) * knowledge: record cross-check marker in the ingest report
Knowledge flush — 8 insight(s)
8 queued candidates → 7 new pages (two candidates share one mechanism and were
merged into a single page), 7 existing pages amended with reciprocal
related:links, 5 domain indexes updated,
log.mdappended.Verified best-practice
1.
inspect.getsourceon a class from a path-loaded module →verifiedClaim: a module loaded via
spec_from_file_location/module_from_spec/exec_modulewithout
sys.modulesregistration makes class introspection fail withTypeError: … is a built-in class, while function/method introspection works.How verified: reproduced locally 2026-08-18 on CPython 3.9.6, 3.11.13, 3.13.11,
3.14.6 — the headline behaviour is identical on all four: class →
TypeError: <class 'aw.Handler'> is a built-in class;m.Handler.do_GETandm.select→ source returned; aftersys.modules[spec.name] = mthe class call returns source. Mechanism read directly fromthe shipped
inspect.py(3.14.6)getfile: the class branch resolves throughsys.modules.get(object.__module__), the function branch falls through toobject.__code__.co_filename. The registration line was confirmed to be part of thestandard library's own documented recipe.
Sources checked (opened this session): docs.python.org/3/library/importlib.html
("Importing a source file directly" recipe,
sys.modules[module_name] = module),docs.python.org/3/library/inspect.html, docs.python.org/3/reference/import.html,
local
inspect.pysource.2. Unpacked Chromium extension reload →
verifiedClaim: after editing a content script, the host-page refresh alone re-injects the
cached copy; the extension itself must be reloaded too.
How verified: Chrome's official Hello-World tutorial was opened and states "After
saving the file, to see this change in the browser you also have to refresh the
extension", with its reload table listing content scripts as "Yes (plus the host page)".
chrome.runtime.getManifest()(used for the running-build marker directive) wasconfirmed on the official runtime API page. The
#dev-reload-buttonshadow-root path islabelled in-page as a measured internal detail, not a documented API, with instructions
to re-derive it when it stops matching. Field evidence: okta-autofill, page-refresh-only →
field stayed empty; extension reload → flow completed.
Sources checked (opened): developer.chrome.com get-started tutorial,
develop/concepts/content-scripts, reference/api/runtime.
3+8. Browser-automation console capture gaps →
verified(merged page)Claim A (candidate 8): a collector attached after navigation loses load-time records.
Claim B (candidate 3): extension content-script logs live in an isolated execution
context that a main-world collector never reports.
How verified: Claim A independently reproduced this session (Aside CLI
1.26.810.1915 / daemon 1.26.818.1059) against a local
python3 -m http.serverpage whoseinline script logs one
logand oneerror:openTab→[]; aftersleep(800)→[];after
console.clear()+reload()+sleep(300)→ both records. Claim B's mechanism isdocumented — Chrome content-scripts page ("An isolated world is a private execution
environment that isn't accessible to the page…") and CDP
Runtime.consoleAPICalledcarrying
executionContextId, "Identifier of the context where the call was made"; thedefault/isolated/worker distinction is carried in
executionContextCreated'sauxData("Embedder-specific auxiliary data"), and the page now says so rather than presenting it
as a documented field of its own. The tool-specific miss stays labelled as a field
measurement.
Correction made: a drafted
playwright.dev/docs/api/class-pagecitation was dropped— the fetch did not surface the
consoleevent section, so the claim could not beconfirmed from it.
Sources checked (opened): chromedevtools.github.io Runtime domain,
developer.chrome.com content-scripts. (playwright.dev opened, not confirmable → removed.)
4. Correlated SubLink duplicated by derived-table pull-up →
verifiedClaim: a derived table carrying no aggregate/LIMIT/DISTINCT/set-op is flattened, its
select-list SubLink is substituted into every referencing aggregate, and PostgreSQL does
not CSE SubPlans — so N outer references cost N evaluations per row;
OFFSET 0,MATERIALIZED, orLATERALfix it.How verified: the harvested evidence was second-hand (a worker's measurement the
harvesting session could not re-run). Reproduced from scratch this session on a
throwaway local cluster, PostgreSQL 16.11 (Homebrew), 5 driving rows:
bool_or+sumSubPlan 1+SubPlan 2, eachloops=5(10 evaluations)OFFSET 0inside the derived tableSubPlan,loops=5WITH … AS MATERIALIZEDSubPlanunder aCTEnodeWITH(not materialized)SubPlannodes — a plain CTE is not a fenceLEFT JOIN LATERALSubPlan— Nested Loop Left JoinGROUP BYSubPlanSubPlannodesThe plain-CTE and reference-count rows are additions the candidate did not contain.
Doc quotes obtained verbatim:
OFFSET 0"is the same as omitting theOFFSETclause"(queries-limit), and the folding/
MATERIALIZED/push-down-restriction sentences(queries-with). The pull-up predicate is cited by location (
is_simple_subquery()inprepjointree.c) and explicitly marked as measured-not-quoted, because the only doxygenrendering available returned a paraphrase rather than the source comment.
Sources checked (opened): postgresql.org queries-limit.html, queries-with.html;
local EXPLAIN / EXPLAIN ANALYZE runs.
5. Expectation sets with one distinct value →
verifiedClaim: when every case expects the same literal, a hardcoded constant at the assembly
point is observationally identical to the wired computation, so adding assertions cannot
kill it; a delete probe only proves key presence.
How verified: reproduced with a minimal control (CPython 3.9.6,
unittest):3 cases all expecting
"HAS_VACANCY"→ constant mutant survived (0 failures);adding one case expecting
"UNSURVEYED"→ same constant killed (1 failure); wiredbaseline green in both sets; a delete probe reddened via
KeyError, i.e. on key presencealone. Field measurement (rtb-unified NEWRTB-2786, 2046-test api suite) retained as the
production instance.
Correction made: the Stryker and PIT quotes were re-fetched rather than inherited —
the real sentences are "When all tests passed while this mutant was active, the mutant
survived. You're missing a test for it." and "Survived means the mutation was not detected
by the covering test." A third drafted citation (testing.googleblog.com) was dropped as
unopened.
Sources checked (opened): stryker-mutator.io mutant-states-and-metrics, pitest.org
basic_concepts; local reproduction.
6. ORM-generated test schema hides model-vs-DB drift →
field-testedClaim: with
ddl-auto: create-drop/create/updatethe test schema is generatedfrom the entity model, so an entity-vs-database drift cannot exist there and "add a
reproducing test" is unachievable; verification must move to a migration-built DB with
validateor aninformation_schemagate.How verified — and why not
verified: the knobs are documented (Spring Boot: JPAdatabases "are automatically created only if you use an embedded database"; the
ddl-auto↔hibernate.hbm2ddl.automapping; "If you are using a higher-level databasemigration tool, like Flyway or Liquibase, you should use them alone to create and
initialize the schema"; Jakarta
@Column.nullable= "(Optional) Whether the databasecolumn is nullable"). The consequence — that the drifted state is unconstructible in a
generated schema — follows from those but was not executed here (no JVM reproduction
run), so the page stays
field-testedon the manage-repo observation rather than claiminga measurement it does not have. A Hibernate User Guide fetch for the
hbm2ddl.autovaluetable returned a truncated section, so the value enumeration was first folded into the
Spring Boot bullet — which does not enumerate the values. The cross-check caught that;
the enumeration now cites Hibernate's
org.hibernate.tool.schema.Actionjavadoc directly(
NONE/CREATE_DROP/UPDATE/VALIDATEwith their legacyhbm2ddl.autonames), whichalso supplies the "Drop the schema and then recreate it on
SessionFactorystartup"semantics the page's mechanism rests on.
Sources checked (opened): docs.spring.io reference/data/sql.html,
how-to/data-initialization.html, jakarta.ee
@Columnjavadoc.7. Deleted-file recovery on macOS/APFS →
field-testedClaim: check TRIM and APFS snapshots before recommending any recovery tool, work copy
sources in fidelity order, and read the exact path from an app's bookmark blob when the
remembered name is wrong.
How verified: the probe commands were run locally 2026-08-18 (macOS 15, Darwin
25.5.0, APPLE SSD AP0512Z):
system_profiler SPNVMeDataType→ "TRIM Support: Yes";tmutil listlocalsnapshots /System/Volumes/Dataruns and prints its header with nosnapshots. Man pages quoted:
tmutil(8)listlocalsnapshots/localsnapshot,trimforce(8)("By default, TRIM commands are not sent to third-party drives" — the basis for the
third-party edge case). The strongest claim — that carving is not a viable path with TRIM
active — has no Apple statement behind it, so the page keeps
field-testedand phrasesthe directive as routing to copy sources rather than asserting impossibility.
Correction made: two drafted Apple URLs (a Disk Utility support page and the NSURL
bookmarkDatadeveloper page) were dropped — the developer page is JS-rendered andreturned no body, and neither was confirmable; the page now cites the local man pages and
measurements instead.
Existing-layer check
Routing started at
INDEX.md, then each domainindex.md; every category directory thatcould plausibly own a candidate was listed and the overlapping pages were opened in full.
Pages read: testing-quality-checks-that-cannot-pass, testing-quality-generated-sql-property-assertions, testing-quality-source-text-wiring-assertions, testing-quality-tests-that-cannot-fail, testing-quality-unasserted-return-fields, testing-quality-default-values-under-test, qa-environments-test-environment-parity, backend-java-jpa-entity-mapping, platforms-tools-version-keyed-artifact-cache, backend-python-language-bytecode-cache-staleness
Overlaps found and how they were resolved
backend-python-language-bytecode-cache-staleness(same "edited/loaded source vs what runs" family),testing-quality-checks-that-cannot-pass(an always-red check)platforms-tools-version-keyed-artifact-cache(cache serves the old artifact)qa-environments-headless-browser-bot-blocking(only other browser-environment page);platforms-processes-tool-diagnostics-without-a-failing-exit-code(empty result ≠ clean)testing-quality-generated-sql-property-assertions— its step 4 said an aggregate-occurrence count "doubles as the single-evaluation regression guard for a correlated subquery"testing-quality-default-values-under-teststep 1 covers the same degeneracy scoped to a constructor/factory default;unasserted-return-fieldscovers fields no assertion readsqa-environments-test-environment-parity(parity inventory),backend-java-jpa-entity-mappingplatforms/filesystemsConflicts flagged: none. No candidate contradicted an existing directive.
New categories: none — all seven pages landed in existing categories.
Open-PR check
gh pr list --repo choiyounggi/dev-loop --state open --limit 50returned zero rows(also with
--search "head:knowledge/"). There are noknowledge/*heads in flight, sono candidate could overlap a pending PR.
Routing decision
backend/python/language/source-introspection-of-a-dynamically-loaded-module.mddatabases/query-optimization/repeated-sublinks-in-a-pulled-up-derived-table.mdqa/environments/browser-console-capture-gaps.mdplatforms/tools/unpacked-extension-source-reload.mdtesting/quality/expectation-sets-with-one-distinct-value.mdtesting/strategy/orm-generated-test-schema.mdplatforms/filesystems/deleted-file-recovery-on-apfs.mdRouting notes:
fact (which artifact the runtime is serving), not web-UI code;
frontend/has noextensions category and creating one for a tooling lesson would split the
cache-staleness family across domains.
system's output as a release/QA verdict, not writing automated test code.
level can hold this defect", which is
test-level-choice's neighbourhood; the paritypage keeps the release-decision framing and now links here.
Verification of this change
node scripts/wiki-structure-checks.js wiki→ pages: 249, indexes: 13, findings: 0node scripts/wiki-lint-prohibitions.js wiki→ directives: 71, compliant: 71,violations: 0 (1 pre-existing info row in
infrastructure/config, untouched here)moved the linter to
violations: 1; restoring from acpbackup returned it toviolations: 0with the mutation marker absent and the file byte-identical (cmp).Without this the green run would not have been evidence the new pages were scanned.
bats tests/suite (bats is not installed on this machine) —CI runs it on this PR.
Cross-Check
An independent adversarial reviewer (separate
claude -pprocess,--permission-mode plan,no shared context) was run against this branch before the PR, tasked only with source
fidelity, overclaim, cross-page contradiction, report accuracy and AGENTS.md compliance.
Verdict: REVISE — 4 major, 8 minor. All were addressed, and each major was re-checked
by me independently rather than taken on the reviewer's word:
optimizer/plan/prepjointree.cdoes not existgh api repos/postgres/postgres/contents/…: the file is underoptimizer/prep/, notplan/sortClause; I measured it (derived table withORDER BY→ oneSubPlan) and added both the decision row and the measurement arm__main__edge case is version-dependent, while the page claimed four versions behaved "identical"python -c(so__main__has no__file__): 3.9.6 →TypeError, 3.11.13 / 3.13.11 / 3.14.6 →OSError: source code not availableddl-autovalue enumeration was attributed to a Spring Boot page that does not enumerate itActionjavadoc, opened this sessiongenerated-sql-property-assertions, which this report had declared conflict-freeMinor findings applied: version-scoped the planner claim to the measured 16.11; labelled
the push-down rationale as inferred rather than cited; "three assertions" → "three cases"
in the expectation page (the very axis that page teaches); rewrote three source bullets
that had dropped their source's hedge or scope (
getfilevsgetsourceargument list,getManifest()wording,executionContextCreatedauxData); dropped two weakly-adjacentrelated:ids from the APFS page and replaced its one hedged cell with the statedcondition; corrected the lint numbers and the body-line range in this report.
Not changed, with reasons: the "Also when" trigger shape flagged on the console page is
house convention (71 of 252 pages use it) and both halves share one decision point;
.dev-loop/CROSSCHECK_FINDINGS.mdand.dev-loop/fold-note-73.mdare pre-existinguntracked scratch from an earlier flush — this commit stages explicit paths only, so
neither ships, and neither is mine to delete.
The reviewer stated it could not verify the off-checkout evidence (the Aside runs, the
okta-autofill observation, NEWRTB-2786, the
managerepo, the PG 16.11 EXPLAIN runs, andthe lint mutation control) and neither confirmed nor refuted it — those rest on the
measurements recorded in the pages.