English fallback
This translation is missing; the canonical English reference follows.
fuzzy1337.page_capture_worker¶
Internal packaged ADR 0052 one-connection worker for an already governed owned loopback request. Direct invocation establishes no authorization. It independently rechecks exact URL, canonical argv tokens, closed catalog and numeric quotas before the socket is created. No DNS, environment proxy, browser, credentials, redirect, retry or additional request is supported.
One monotonic deadline covers connection, send, complete strict CRLF headers, exact declared body and final EOF. Only a complete status-200 UTF-8 HTML response whose exact 541-byte body matches the reviewed SHA-256 is retained. Status reason and unknown header values are discarded. Unsupported encodings/framing, excess, truncated, changed or timed-out responses emit only a fixed canonical failure record and truthful process exit code, with no stderr or exception text.
Successful stdout contains exact measured normalized metadata and base64 of only already admitted known non-secret bytes. Parent record/evidence validation remains independent. The hash allowlist is neither general secret detection nor collector, service ownership or transport authentication.
fuzzy1337.page_capture_worker
¶
Internal one-connection worker retaining only an exact reviewed non-secret HTML body.
PageProtocolError
¶
Bases: ValueError
Framing cannot prove one complete bounded response.
源代码位于: fuzzy1337/page_capture_worker.py
35 36 | |
PageResponsePolicyError
¶
Bases: ValueError
Status, media or encoding is outside the closed acquisition profile.
源代码位于: fuzzy1337/page_capture_worker.py
39 40 | |
PageBodyPolicyError
¶
Bases: ValueError
Declared or received body differs from the closed reviewed catalog.
源代码位于: fuzzy1337/page_capture_worker.py
43 44 | |
Remaining(deadline: float) -> float
¶
Return the positive monotonic budget without renewing it after partial progress.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
deadline
|
float
|
Shared monotonic end time covering connect/send/headers/body/final EOF. |
必需 |
返回:
| 类型 | 描述 |
|---|---|
float
|
Remaining positive seconds for the next socket phase. |
源代码位于: fuzzy1337/page_capture_worker.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | |
ParseHeaders(raw: bytes, expected_size: int, max_body_bytes: int) -> dict[str, object]
¶
Validate CRLF/token framing then retain only measured normalized allowlisted metadata.
Unknown header values and status reason stay transient and are never returned or hashed.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
raw
|
bytes
|
Complete header section including final CRLFCRLF, at most 16384 bytes. |
必需 |
expected_size
|
int
|
Exact body size from the closed reviewed catalog. |
必需 |
max_body_bytes
|
int
|
Selected already-validated integer allocation ceiling. |
必需 |
返回:
| 类型 | 描述 |
|---|---|
dict[str, object]
|
Only measured counts and normalized version/status/media/charset/length metadata. |
引发:
| 类型 | 描述 |
|---|---|
PageProtocolError
|
Header grammar or bounded section/count/line rules fail. |
PageResponsePolicyError
|
Status/media/encoding is unsupported. |
PageBodyPolicyError
|
Declared body size differs from the reviewed body or limit. |
源代码位于: fuzzy1337/page_capture_worker.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
Probe(url: str, timeout_seconds: float, fixture_id: str, max_body_bytes: int) -> dict[str, object]
¶
Perform one exact GET and EOF-bounded closed-body acquisition without DNS or retry.
Calling this internal worker directly establishes no consent or authorization.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
url
|
str
|
Exact anonymous canonical literal-loopback plain-HTTP endpoint. |
必需 |
timeout_seconds
|
float
|
Whole request seconds in 0.05..5, excluding bool/nonfinite values. |
必需 |
fixture_id
|
str
|
Explicit closed reviewed fixture identifier, never a file path. |
必需 |
max_body_bytes
|
int
|
Exact integer body quota in 1..65536; selected body must fit. |
必需 |
返回:
| 类型 | 描述 |
|---|---|
dict[str, object]
|
Flat success fields containing only known non-secret admitted body bytes. |
引发:
| 类型 | 描述 |
|---|---|
ValueError
|
Destination, catalog or numeric inputs are outside the accepted profile. |
PageProtocolError
|
Framing/peer/complete-body/EOF rules fail. |
PageResponsePolicyError
|
Response status/media/encoding is refused. |
PageBodyPolicyError
|
Body declaration or exact hash differs. |
TimeoutError
|
The single request budget expires. |
OSError
|
The one literal socket connection fails. |
源代码位于: fuzzy1337/page_capture_worker.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | |
WorkerInputs(arguments: Sequence[str]) -> tuple[str, float, str, int]
¶
Bound canonical argv tokens before any numeric conversion or network operation.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
arguments
|
Sequence[str]
|
Exact tuple/list of four text URL/timeout/fixture/body-limit tokens. |
必需 |
返回:
| 类型 | 描述 |
|---|---|
tuple[str, float, str, int]
|
Independently validated canonical destination, timeout, fixture selection and quota. |
源代码位于: fuzzy1337/page_capture_worker.py
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | |
Main(argv: Sequence[str] | None = None) -> int
¶
Emit only one canonical known-body or fixed failure record with truthful exit status.
No raw header, reason, unexpected body, exception text or stderr is emitted.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
argv
|
Sequence[str] | None
|
Exact tuple/list of prepared tokens, or process arguments when omitted. |
None
|
返回:
| 类型 | 描述 |
|---|---|
int
|
Zero for admitted page, 64 for input, 124 for timeout, one for other fixed failures. |
源代码位于: fuzzy1337/page_capture_worker.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 | |