lastgen 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,9 +4,11 @@
4
4
 
5
5
  Check if you started coding before or after AI agents.
6
6
 
7
- [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
8
- [![Node](https://img.shields.io/badge/node-%E2%89%A522.18.0-green)](https://nodejs.org)
9
- [![Zero Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)]()
7
+ ![License:MIT](https://img.shields.io/static/v1?label=License&message=MIT&color=blue&style=flat-square)
8
+ [![npm downloads](https://img.shields.io/npm/dm/lastgen.svg)](https://www.npmjs.com/package/lastgen)
9
+ [![npm version](https://img.shields.io/npm/v/lastgen?style=flat-square)](https://www.npmjs.com/package/lastgen)
10
+ [![Install size](https://packagephobia.com/badge?p=lastgen)](https://packagephobia.com/result?p=lastgen)
11
+ [![Dependencies](https://img.shields.io/badge/dependencies-zero-brightgreen)](https://www.npmjs.com/package/lastgen)
10
12
 
11
13
  </div>
12
14
 
@@ -120,11 +122,14 @@ Checks include:
120
122
  | ---------------------- | --------------------------------------------------------- |
121
123
  | **Hash integrity** | Recomputes SHA-256 hash to detect tampering |
122
124
  | **Era classification** | Confirms era matches the proof date |
125
+ | **Proof date** | Re-derives proof date from commit and account data |
123
126
  | **Identity** | 3-way match: author login, committer login, noreply email |
124
127
  | **Repo ownership** | Reports whether commit is in a self-owned or third-party repo |
125
128
  | **GitHub ID** | Matches commit author ID against certificate |
126
129
  | **Commit date** | Fetches the commit from GitHub and compares dates |
127
130
  | **Date consistency** | Detects forged author dates via author/committer drift |
131
+ | **Root commit** | Notes if commit has no parents (higher trust) |
132
+ | **GPG signature** | Notes if commit is cryptographically signed |
128
133
 
129
134
  ## License
130
135
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lastgen",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Check if you started coding before or after AI agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -31,6 +31,10 @@
31
31
  "coder",
32
32
  "cli"
33
33
  ],
34
+ "publishConfig": {
35
+ "access": "public",
36
+ "provenance": true
37
+ },
34
38
  "license": "MIT",
35
39
  "repository": {
36
40
  "type": "git",
package/src/index.ts CHANGED
File without changes
package/src/proof.ts CHANGED
@@ -6,7 +6,7 @@ import { createHash } from 'node:crypto';
6
6
 
7
7
  import type { Certificate, EraKey, FirstCommit, GitHubUser } from './types.ts';
8
8
 
9
- import { CERTIFICATE_SALT, CERTIFICATE_VERSION, CUTOFF_DATE } from './types.ts';
9
+ import { CERTIFICATE_SALT, CERTIFICATE_VERSION, CUTOFF_DATE, THIRTY_DAYS_MS } from './types.ts';
10
10
 
11
11
  export function classifyEra(proofDate: string): EraKey {
12
12
  const cutoff = new Date(CUTOFF_DATE).getTime();
@@ -14,8 +14,6 @@ export function classifyEra(proofDate: string): EraKey {
14
14
  return date < cutoff ? 'LAST_GEN' : 'AI_NATIVE';
15
15
  }
16
16
 
17
- const THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1000;
18
-
19
17
  export function resolveProofDate(user: GitHubUser, firstCommit: FirstCommit | null): string {
20
18
  if (!firstCommit) {
21
19
  return new Date().toISOString();
package/src/types.ts CHANGED
@@ -19,6 +19,7 @@ export type EraKey = keyof typeof ERAS;
19
19
 
20
20
  export const CERTIFICATE_VERSION = '1.0';
21
21
  export const CERTIFICATE_SALT = 'lastgen_v1';
22
+ export const THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1000;
22
23
 
23
24
  export interface GitHubUser {
24
25
  login: string;
package/src/verify.ts CHANGED
@@ -5,7 +5,7 @@
5
5
  import { readFileSync } from 'node:fs';
6
6
 
7
7
  import type { Certificate, VerifyResult } from './types.ts';
8
- import { CUTOFF_DATE } from './types.ts';
8
+ import { CUTOFF_DATE, THIRTY_DAYS_MS } from './types.ts';
9
9
  import { fetchCommit } from './github.ts';
10
10
  import { generateCertificateHash, resolveProofDate } from './proof.ts';
11
11
  import { BOX_WIDTH, boxLine, boxRule, error, info, style } from './display.ts';
@@ -186,7 +186,7 @@ export async function verifyCertificate(filePath: string, token?: string): Promi
186
186
  const authorTime = new Date(commitDetail.authorDate).getTime();
187
187
  const committerTime = new Date(commitDetail.committerDate).getTime();
188
188
  const driftMs = Math.abs(committerTime - authorTime);
189
- const thirtyDaysMs = 30 * 24 * 60 * 60 * 1000;
189
+ const thirtyDaysMs = THIRTY_DAYS_MS;
190
190
  const driftDays = Math.round(driftMs / (24 * 60 * 60 * 1000));
191
191
  const consistent = driftMs <= thirtyDaysMs;
192
192
  results.push({