Skip to content

Instantly share code, notes, and snippets.

@nestharus
nestharus / ADR.md
Created January 1, 2026 12:18
Planning Documents

ADR-### — {decision title}

Status: {Proposed | Accepted | Superseded | Deprecated} Date: YYYY-MM-DD Supersedes: ADR-### Superseded-by: ADR-###

ADRs record decisions about invariants, boundaries, and relationships. Do not specify concrete schema field/key names or data types; express impact as ID-level changes and link to PRD/Design Map IDs.

@nestharus
nestharus / TEST.md
Created December 11, 2025 14:13
Testing Python

Async Testing

  • pytest-asyncio==1.3.0 is already listed in pyproject.toml, so async tests can be awaited seamlessly.
  • Prefer explicit marks for readability:
import pytest
from app.routes import metadata_router_v1

@pytest.mark.asyncio
@nestharus
nestharus / conflict-resolver.md
Created December 10, 2025 06:03
Rebase Command

note This still needs some refinement. It needs to look up the original implementation plan behind each commit and come up with an integration plan to bring the two together. This is currently a naive conflict resolution approach.


name: conflict-resolver description: Resolves a single git merge conflict by analyzing both sides' intent and stitching changes together model: opus tools: Read, Edit, Bash, Grep, Glob

@nestharus
nestharus / Prompt Refiner.txt
Created December 4, 2025 14:02
Prompt Refiner (for use with GPT 5.1 Pro or GPT 5.1 Heavy Thinking)
You will be given a very unrefined prompt containing many interleaved requirements. Do **not** create an implementation plan. Do **not** add assumptions about my repo/system. Your job is only to **unmangle and restructure** what I said.
Produce three sections:
1. **Topics (Unmangled)**
* Extract and list all distinct topics/concerns present in my text.
* Phrase them as short topic titles.
2. **Organized Requirements (Same content, reordered)**
@nestharus
nestharus / README.txt
Last active December 4, 2025 11:51
Claude Code Task Executor And Reviewer
# Plan
## Overview
## Current State (Problems)
## Target State
## Additional Info
@nestharus
nestharus / fact_redesign.md
Created December 3, 2025 13:22
Planning Workflow

Here's a redesign that fully treats:

  • object IDs as entities,
  • field names as part of the fact,
  • and object membership (ancestor chain) as the core context.

I'll start with the shared data model and then show how extract_ids_and_text, resolution_tracker.py, and candidate_extraction.py change, plus how this plugs into your fact pipeline.


Download as zip
Create empty auths folder in directory
Create empty logs folder in directory
Within directory
docker-compose up -d
OpenAI: docker exec -it cli-proxy-api ./CLIProxyAPI --codex-login
Google: docker exec -it cli-proxy-api ./CLIProxyAPI --login
@nestharus
nestharus / reranker.py
Created August 17, 2025 16:07
Reranker FastAPI Qwen3
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from typing import List, Optional
from vllm import LLM, SamplingParams
from vllm.inputs.data import TokensPrompt
from transformers import AutoTokenizer
import math
class RerankRequest(BaseModel):
query: str
public static Map<String, Set<String>> idsAndFields(final Collection<Match> matches) {
return matches.stream()
.collect(Collectors.groupingBy(
match -> match.id,
Collectors.flatMapping(
match -> match.positions().stream()
.map(position -> position.fieldName),
Collectors.toSet()
)
));
# 2 [ 1]
# 3 [ 3, 1]
# 5 [5, 3, 1, 3, 1, 3, 5, 1]
# (19) 7 [9, 1, 3, 1, 3, 5, 1, 5, 3, 1, 3, 5, 5, 1, 5, 3, 1, 5, 3, 5, 7, 3, 1, 3, 1, 3********************************************************************, 7, 5, 3, 5, 1, 3, 5, 1, 5, 5, 3, 1, 3, 5, 1, 5, 3, 1, 3, 1, 9, 1]
# ( 9) 11 [11, 3, 1, 3, 5, 1, 5, 3, 1, 3, 5, 5, 1, 5, 3, 1, 5, 3, 5, 7, 3, 1, 3, 1, 3, 13, 3, 5, 1, 9, 1, 5, 5, 3********************************************************************, 1, 3, 5, 1, 9, 1, 3, 1, 11, 9, 1, 3, 1, 3, 5, 1, 5, 3, 5, 5, 5, 1, 5, 3, 1, 5, 3, 5, 7, 3, 1, 3, 5, 7, 5, 9, 1, 3, 5, 1, 5, 5, 3, 1, 3, 5, 1, 5, 3, 1, 5, 9, 1, 9, 1, 3, 1, 3, 5, 7, 3, 1, 3, 11, 1, 5, 3, 1, 5, 3, 5, 11, 1, 3, 1, 3, 7, 5, 3, 5, 1, 3, 5, 1, 5, 9, 1, 3,5, 1, 5, 3, 1, 3, 1, 9, 1, 9, 1, 3, 5, 5, 1, 5, 5, 3, 5, 5, 1, 5, 3, 1, 5, 3, 5, 7, 3, 1, 5,3, 7, 5, 3, 5, 1, 3, 5, 7, 5, 3, 1, 9, 1, 5, 3, 1, 3, 1, 9, 1, 9, 1, 3, 1, 3, 7, 5, 3, 1, 3,5, 5, 1, 5, 3, 7, 3, 5, 7, 3, 1, 3, 1, 3, 7, 5, 3, 5, 5, 5, 1, 5, 5, 3, 1, 3, 5, 1, 5