knowledge: doc-conformance check controls + object-storage key persistence (5 insights to 2 pages) - #9
Open
dch0202-rsquare wants to merge 3 commits into
Conversation
testing/docs-as-spec/document-conformance-checks (new category): positive + negative control per check for gates whose subject is a document; validate the pattern on a conforming sibling when the target file does not exist yet; split the requirement into structure / normative modality / enum completeness / cross-reference axes, each with a mutation that breaks only what it owns; pair coverage with value-validity; split Markdown rows on unescaped pipes. backend/common/storage/object-key-persistence (new category): persist the upload response Key (+Bucket) and derive URLs on read — Location is produced by two different code paths split at the managed uploader part size.
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.
Knowledge flush — 5 insight(s) → 2 pages
Queue drained: 5 pending candidates across 3 sessions. Four of them describe the
same situation at different granularity and were folded into one page (AGENTS.md
"one case per page" cuts by situation, not by candidate); the fifth is
unrelated and got its own page.
f997639131d8ec9etesting-docs-as-spec-document-conformance-checks(Do this §2)739b75ed972c60782e3fcd105c8512fas3.upload()Key, notLocationbackend-common-storage-object-key-persistence39dfae0d5a813cb418dc623000d54f07Verified best-practice
Insights 1, 2, 4 — controls on a document-conformance check →
confidence: verifiedClaim. A checker is unproven until it has been run against both a conforming
input (must PASS) and a deliberately-broken input (must FAIL), one control per
check; presence checks do not establish correctness.
Sources checked:
RuleTester— https://eslint.org/docs/latest/integrate/nodejs-api#ruletester —fetched; requires both a
validarray (rule must not fire on compliant code)and an
invalidarray whose cases must assert the errors the rule produces.This is the positive/negative control pair as an enforced API shape.
fetched;
ruleid:annotates true positives andok:true negatives, both inthe same test file. Second independent tool converging on the same requirement.
already cited elsewhere in this wiki; supports "insert a fault, require the
check to fail" as the measure of detection.
required— https://json-schema.org/understanding-json-schema/reference/object —fetched;
requiredasserts key presence and constrains no value (a requiredproperty may even be
null). This is the canonical statement of thecoverage-vs-validity split that insight 4 hit empirically.
How verified. The two linter sources are official docs for tools whose entire
job is "run a rule against a document/AST", and both mandate the two-sided test.
The candidates' own evidence (an independent auditor's 8 mutations passing a
16-gate suite; a
Boguscell surviving a coverage check) is the field half.Insight 1's specific mechanism — a missing target file makes every pattern
red, so red carries no information about the pattern — is a direct logical
consequence, and the candidate reports the positive control actually run
(7 sections matched on the conforming sibling
rfcs/0005).Insight 5 — unescaped-pipe splitting of GFM table rows →
confidence: verifiedfetched. Cells are "separated by pipes (
|)", and Example 200 shows you"include a pipe in a cell's content by escaping it, including inside other
inline spans" (
f\|oo, and an escaped pipe inside a code span and insideemphasis). So
\|is legal cell content andsplit("|")overcounts a correctrow.
re.split(r"(?<!\\)\|", row)over bothnew pages: cell counts come out uniform per table (4/4/4/4, then 3×6, 2×8,
3×7). The two rows in this PR that carry an escaped pipe in their text are
exactly the rows a naive split would have mis-flagged — the rule's own page is
its positive control.
Insight 3 — persist
Key, notLocation→confidence: verifiedCompleteMultipartUploadAPI reference — https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html —fetched.
Keyis documented as "The object key of the newly created object";Locationis documented only as "The URI that identifies the newly createdobject", with no encoding guarantee. That asymmetry is the load-bearing
fact: only one of the two fields has a contract.
AWS.S3.ManagedUploaddocs — https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3/ManagedUpload.html —fetched. Callback data carries
Location,ETag,Bucket,Key;minPartSize = 1024 * 1024 * 5and defaultpartSizeis 5 MB. Confirms thecandidate's 5,242,880-byte boundary and that
Keyis present on both paths.lib/s3/managed_upload.jssource — https://github.com/aws/aws-sdk-js/blob/master/lib/s3/managed_upload.js —fetched from
raw.githubusercontent.com.finishSinglePartbuildsdata.Locationfromendpoint.protocol + '//' + endpoint.host + httpReq.pathand sets
data.Keyfromparams.Key;finishMultiParttakes the service'sLocationand applies only.replace(/%2F/g, '/'). Exactly the two producersthe candidate described, verified line-for-line against current master.
fetched. Reported side by side: multipart returns
…/stream-uploads%2Fkokoko.gif, single-part returns…/stream-uploads/kokoko.gif,and
Keyis identical in both. Independent confirmation thatLocationispath-dependent and
Keyis stable.fetched. Same structural split in v3
lib-storage:__uploadUsingPutconstructs
Locationclient-side,CompleteMultipartUploadCommanddoes not.Widened
applies_toto[aws-s3, aws-sdk-js-v2, aws-sdk-js-v3]. (Closed forstaleness — no maintainer fix, so the directive is the workaround, not a bug
that has since been patched.)
One scope correction against the candidate. The candidate asserted the
multipart form is specifically
space → +. What is documented/reproduced inpublic sources is the slash case (
/→%2F, visible in #1158 and implied bythe SDK's
%2F-only repair). The+-for-space observation is field evidencefrom the originating production incident, consistent with form-urlencoding but
not shown in a cited source. The page therefore labels the encoding column
"Observed form" and does not claim a documented
+contract; the directive(store
Key) is fully verified and does not depend on which character it is.Existing-layer check
Pages read before routing:
INDEX.mdwiki/testing/index.md(all 8 "load when" lines)wiki/testing/quality/tests-that-cannot-fail.md(full)related:-links it and routes to it from an edge-case row ("subject is code, not a document")wiki/testing/quality/minimum-case-set.md,behavior-not-implementation.mdminimum-case-setadded torelated:wiki/qa/index.md+process/release-gates.md,acceptance-criteria.mddomain: qarelease-gatesis about which gates a release must clear, not whether a gate can fail — no overlap.acceptance-criteriaowns "make the requirement testable", which is upstream of "check the document encodes it"; linked inrelated:and in an edge-case row so the two composegrep -riloverwiki/for mutation / markdown / negative control / linter / lint rule / docs-as-spectests-that-cannot-failhit meaningfully; the rest are incidental word matches in frontend/security/backend pageswiki/backend/index.md+ all 8common/categoriesgrep -riloverwiki/for s3 / multipart / object storage / presigned / url-encodcolumn-data-types.mdandseverity-and-priority.mdmatch on unrelated substrings)Conflicts flagged: none. No existing directive is contradicted or overwritten;
both pages are additive.
Merge-before-create decision. Insights 1/2/4/5 merged into a single new
page rather than appended to
tests-that-cannot-fail: appending would havepushed that page past its one-case scope (test code → documents) and mixed two
trigger sets in one "When this applies". They merged with each other because
they share one situation — writing a checker whose subject is a document — which
is why 5 candidates produced 2 pages, not 5.
Related-links added:
testing-docs-as-spec-document-conformance-checks→testing-quality-tests-that-cannot-fail,testing-quality-minimum-case-set,qa-process-acceptance-criteria.backend-common-storage-object-key-persistence→backend-common-api-design-idempotency(backfill retry behaviour),
backend-node-boundaries-runtime-validation.All five ids verified to resolve to existing files; no duplicate ids in
wiki/.Routing decision
1.
wiki/testing/docs-as-spec/document-conformance-checks.md— NEW categorytestingoverqa(two candidates were taggedqa): the artifactbeing authored is an automated check, which
INDEX.mdroutes to testing;qais scoped to release process. Routing by "which artifact do you change"
(AGENTS.md step 1) puts it in testing.
docs-as-specrather thanquality. Every existing testingcategory — strategy, quality, data, mocking, flaky, async, e2e — is organized
around testing executable code, and their mechanics (assertions, fixtures,
fake timers, selectors) do not apply when the subject is a Markdown document.
Filing under
qualitywould have made the "load when" line collide withtests-that-cannot-fail's, which is the drift condition AGENTS.md invariant 1warns about. Single-page categories are already the norm here (
async,e2e,data,mocking,flakyeach hold one page).wiki/testing/index.mdwith a "load when" lineenumerating all four distinct uses (authoring the check pre-document; choosing
the mutation; a gate that passed on a degraded document; Markdown table
parsing); testing's "Route here for" preamble and the root
INDEX.mdtestingrow both extended with "checks whose subject is a document rather than code".
2.
wiki/backend/common/storage/object-key-persistence.md— NEW categorybackend, subtreecommonrather thannode. The directive("persist the identifier the service documents as canonical; derive URLs at
read time") is language-agnostic and reproduces in v2 and v3 — AGENTS.md says
common owns the principle and the stack page owns the mechanics, and there are
no Node-runtime mechanics here beyond the SDK field names.
storage. The eight existingcommon/categories areapi-design, reliability, caching, jobs, errors, auth, orm, concurrency —
none covers object storage.
api-designis about this service's own contract,not a dependency's response shape;
ormis DB persistence.### storagesection inwiki/backend/index.md(placedbefore
reliability), plus "object-storage references" added to thecommonsubtree route line and to the backend row of the root
INDEX.md.Cross-Check
Cross-Check: source-level, not adversarial-reviewer. Every claim in this PR was
re-derived in-session from the primary source rather than from the harvested
candidate text — five docs/issues fetched for the S3 page (including reading
managed_upload.jsonraw.githubusercontent.cominstead of trusting thecandidate's line numbers) and four for the doc-gate page, with two independent
tools (ESLint
RuleTester, Semgrep rule tests) converging on thepositive+negative control requirement. The pipe-splitting rule was reproduced
against this PR's own two pages. One candidate claim was downgraded on review
(the
space → +multipart form is field evidence, not a documented contract —see the scope correction above). No separate adversarial reviewer ran; the
owner's PR review is the remaining gate.
Decision Log (AI 생성)
의도 — 무엇을 / 왜
managed_upload.js소스를 직접 열어 대조했다 — 수확된 블록은 후보이지 검증된 지식이 아니기 때문.testing/docs-as-spec,backend/common/storage)를 만들었다. 기존 카테고리는 각각 "코드 테스트"와 "8개 common 관심사"로 짜여 있어 문서 검증·오브젝트 스토리지를 담을 자리가 없었다.배제한 대안 — 무엇을 안 했나 / 왜
testing/quality/tests-that-cannot-fail.md에 append하지 않았다. 그 페이지는 테스트 코드의 mutation 규칙을 소유하고 "load when" 라인이 충돌해 AGENTS.md invariant 1의 drift 조건에 걸린다. 대신 양방향 링크로 연결.domain: qa태그였지만 qa로 라우팅하지 않았다. qa는 릴리즈 프로세스 스코프이고, 여기서 만드는 산출물은 자동 체커라 testing이 소유한다.backend/node가 아닌backend/common에 뒀다. v2·v3 양쪽에서 재현되고 원리가 언어 무관이라, "common이 원리·stack이 메커닉"이라는 AGENTS.md 규칙에 따랐다.+"를 문서화된 계약으로 단정하지 않았다. 공개 소스로 확인되는 건/→%2F뿐이라 컬럼명을 "Observed form"으로 두고 스코프를 좁혔다.리뷰어가 볼 곳 — 신뢰성 판단 포인트
.dev-loop/INGEST_REPORT.md"Verified best-practice" — 인용 URL이 실제로 그 주장을 지지하는지. 특히 "One scope correction" 문단(후보보다 약하게 적은 부분).wiki/testing/docs-as-spec/document-conformance-checks.md:39-42— positive/negative control 표. ESLint valid/invalid + Semgrep ok/ruleid 두 출처가 실제로 이 형태를 강제하는지.wiki/backend/common/storage/object-key-persistence.md:40-43— 단일/멀티파트 인코딩 표. "Observed form" 열이 문서화된 계약처럼 읽히지 않는지.wiki/testing/index.md,wiki/backend/index.md— 새 "load when" 라인이 인접 페이지 트리거와 겹치지 않는지(AGENTS.md invariant 1).Invariants checked
related:id resolves; no duplicate ids acrosswiki/.index.md; both domains inINDEX.md.## [2026-07-30] ingestentries appended tolog.md.Instead ofrow paired withits replacement and a why.
documents.